-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillacclang:diagnosticsNew/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 analyzerconfirmedVerified by a second partyVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Description
| Bugzilla Link | 40177 |
| Version | trunk |
| OS | All |
| CC | @hfinkel,@zygoloid |
Extended Description
Test case (prog.c):
inline void f()
{
static int x;
}
int main()
{
}
Compilation command line:
clang prog.c -Wall -Wextra -std=c11 -pedantic-errors
Observed behaviour:
No error message outputed. Only a warning message outputed.
Expected behaviour:
An error message outputed.
The program violates 6.7.4/3:
"An inline definition of a function with external linkage shall not contain
a definition of a modifiable object with static or thread storage duration,
and shall not contain a reference to an identifier with internal linkage."
Since -pedantic-errors is used we should get an error instead of a warning.
Note:
GCC gives the expected error message.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillacclang:diagnosticsNew/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 analyzerconfirmedVerified by a second partyVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute