[clang] [clang][Sema] Add diagnostic note for reference of function-like macros requiring without parentheses (PR #123495)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 19 15:51:56 PST 2025


================
@@ -5936,6 +5936,9 @@ def err_fold_expression_limit_exceeded: Error<
   "instantiating fold expression with %0 arguments exceeded expression nesting "
   "limit of %1">, DefaultFatal, NoSFINAE;
 
+def note_function_like_macro_requires_parens
+    : Note<"'%0' exists, but as a function-like macro; perhaps, did you forget "
+           "the parentheses?">;
----------------
Sirraide wrote:

```suggestion
    : Note<"'%0' is defined here as a function-like macro; did you mean to write '%0(...)'">;
```
Maybe something like that would be bit clearer?

https://github.com/llvm/llvm-project/pull/123495


More information about the cfe-commits mailing list