https://bugs.llvm.org/show_bug.cgi?id=43708

            Bug ID: 43708
           Summary: -Wc++2a-compat erroneously emitted before
                    preprocessing is complete
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

Compile the following with -std=c++17 -Wc++2a-compat -Werror:

  #define LPAREN (
  #define EXPAND(...) __VA_ARGS__
  #define EAT(...)
  EAT(requires) // OK, no warning.
  EXPAND(EAT LPAREN requires)) // Oops, warning.

This file emits no tokens after full preprocessing; however, the compiler still
complains about the presence of the `requires` keyword on the last line. Note
that `EAT(requires)` compiles without warning, which leads me to believe that
the warning is looking for C++20 keywords after each macro expansion instead of
after full expansion.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to