Open
Description
This warns (as it should):
Code:
[[noreturn]] void notreached();
void g();
void f() {
notreached();
g();
}
Output:
% clang -c notreach.cc -Wunreachable-code
notreach.cc:6:3: warning: code will never be executed [-Wunreachable-code]
6 | g();
| ^
1 warning generated.
This doesn't:
Code:
[[noreturn]] void notreached();
void g();
#define MY_MACRO(x) (void)(x)
void f() {
notreached();
MY_MACRO(5);
g();
}
Output:
% clang -c notreach2.cc -Wunreachable-code
# no output
Not emitting unreachable code warnings for the macro itself probably makes sense, but the diagnostic disappearing completely seems surprising.
(reported downstream at https://crbug.com/379845253)