[llvm-bugs] [Bug 43708] New: -Wc++2a-compat erroneously emitted before preprocessing is complete

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 17 16:30:13 PDT 2019


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: unassignedclangbugs at nondot.org
          Reporter: eniebler at boost.org
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191017/36d15791/attachment.html>


More information about the llvm-bugs mailing list