]> granicus.if.org Git - clang/commit
Promote a warning on ill-formed code (redeclaration missing an exception
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 30 Sep 2015 00:48:50 +0000 (00:48 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 30 Sep 2015 00:48:50 +0000 (00:48 +0000)
commit73d9148e4de2e2aee56b7b639df12c474fee7797
tree2431f33acd2a9b46f6307a949fdcf14dd6ea66fd
parent8de6c8647b729347be6cb3a275bd1cc8f2e407ea
Promote a warning on ill-formed code (redeclaration missing an exception
specification) to an error. No compiler other than Clang seems to allow this,
and it doesn't seem like a useful thing to accept as an extension in general.

The current behavior was added for PR5957, where the problem was specifically
related to mismatches of the exception specification on the implicitly-declared
global operator new and delete. To retain that workaround, we downgrade the
error to an ExtWarn when the declaration is of a replaceable global allocation
function.

Now that this is an error, stop trying (and failing) to recover from a missing
computed noexcept specification. That recovery didn't work, and led to crashes
in code like the added testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248867 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaExceptionSpec.cpp
test/CXX/drs/dr1xx.cpp
test/CXX/drs/dr5xx.cpp
test/CXX/except/except.spec/p3.cpp
test/CXX/except/except.spec/p4.cpp
test/CXX/except/except.spec/p5-pointers.cpp
test/FixIt/fixit.cpp
test/Misc/warning-flags.c
test/SemaCXX/exception-spec.cpp [new file with mode: 0644]