-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang: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 analyzer
Description
| Bugzilla Link | 14297 |
| Version | trunk |
| OS | MacOS X |
| CC | @DougGregor |
Extended Description
According to 15.4p3 "If any declaration of a function has an exception-specification, all declarations, including the definition and an explicit
specialization, of that function shall have an exception-specification with the same set of type-ids".
Clang does not generate error message for the following example
struct SomeStruct{};
template void Foo(T i) throw(T) { throw i; }
template void Foo(int a) throw (char); // explicit instantiation, argument is deduced. Wrong exception specification is provided
int main() {
try {
SomeStruct slawa;
Foo(slawa);
}
catch(...) { ;}
return(0);
}
clang++ -c test.cpp
Alexey Bataev
Software Engineer
Intel Compiler Team
Intel Corp.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang: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 analyzer