https://bugs.llvm.org/show_bug.cgi?id=48462
Bug ID: 48462
Summary: Macro expansion not performed on argument to
__has_cpp_attribute
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++2a
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
C++20 specifies that the pp-tokens given to __has_cpp_attribute are subject to
macro expansion (http://eel.is/c++draft/cpp.cond#5). GCC performs macro
expansion here, but clang does not. For example (compiled with -std=c++20):
#define X noreturn
#if !__has_cpp_attribute(X)
#error FAIL
#endif
(https://gcc.godbolt.org/z/jWG586)
The above program hits the error case, whereas using "noreturn" directly
instead of "X" does not.
--
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