================
@@ -26,6 +29,17 @@ bool isOverrideMethod(const FunctionDecl *Function) {
     return MD->size_overridden_methods() > 0 || MD->hasAttr<OverrideAttr>();
   return false;
 }
+
+bool hasAttrAfterParam(const SourceManager *SourceManager,
+                       const ParmVarDecl *Param) {
+  for (const auto *Attr : Param->attrs()) {
+    if (SourceManager->isBeforeInTranslationUnit(Param->getLocation(),
+                                                 Attr->getLocation())) {
+      return true;
+    }
+  }
+  return false;
+}
----------------
emaxx-google wrote:

I've run this example, and with my CL clang-tidy comments out the argument in 
the `ANNOTATE_BEFORE` case, while leaving the `ANNOTATE_AFTER` case as-is. Is 
that incorrect? In the former case, the grammar makes the attribute apply to 
the (unnamed) parameter. I've also verified the clang built with #118501 
doesn't complain on this.

But maybe I'm missing some other problem?..

https://github.com/llvm/llvm-project/pull/122286
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to