mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 02:40:29 +00:00
Insert fn for void functions (#596)
This commit is contained in:
1 parent
2344a52e24
commit
9bdabda851
14 files changed
+50
-35
No files matched your search
@@ -13,8 +13,13 @@ namespace Carbon {
|
||||
FnInserter::FnInserter(std::map<std::string, Replacements>& in_replacements,
|
||||
cam::MatchFinder* finder)
|
||||
: Matcher(in_replacements) {
|
||||
finder->addMatcher(cam::functionDecl(cam::hasTrailingReturn()).bind(Label),
|
||||
this);
|
||||
finder->addMatcher(
|
||||
cam::functionDecl(cam::anyOf(cam::hasTrailingReturn(),
|
||||
cam::returns(cam::asString("void"))),
|
||||
cam::unless(cam::anyOf(cam::cxxConstructorDecl(),
|
||||
cam::cxxDestructorDecl())))
|
||||
.bind(Label),
|
||||
this);
|
||||
}
|
||||
|
||||
void FnInserter::run(const cam::MatchFinder::MatchResult& result) {
|
||||
|
||||
Reference in new issue
Block a user