diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -349,7 +349,7 @@ // There should be no other declarations or preprocessor directives between // comment and declaration. - if (Text.find_first_of(";{}#@") != StringRef::npos) + if (Text.find_last_of(";{}#@") != StringRef::npos) return nullptr; return CommentBeforeDecl;