Open
Open
Copy link
Description
Given the following code...
class T{};
void f()
{
UNDEFINED_MACRO (T);
}
https://godbolt.org/z/5WjGM4KE6
we might expect an error regarding the undeclared identifier UNDEFINED_MACRO
however, in this specific case we get 'T' does not refer to a value
.
If we change the code to so that it passes a variable instead of a type, for example...
void f()
{
int i;
UNDEFINED_MACRO (i);
}
https://godbolt.org/z/YT1GGPG4Y
then the error is the more expected use of undeclared identifier 'UNDEFINED_MACRO'
.
gcc and MSVC both appear to error as we might expect in this scenario.
I've tested this using trunk on CompilerExplorer as linked above.
Metadata
Metadata
Assignees
Labels
New/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerVerified by a second partyVerified by a second party