Implement name mangling proposal for exception specifications from cxx-abi-dev 2016...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 26 Oct 2016 01:05:54 +0000 (01:05 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 26 Oct 2016 01:05:54 +0000 (01:05 +0000)
commitfda59e5851215850f9b9b534bfd8bda579089029
tree5275243be051d4b8a2e4728a161cbea4e948ec66
parent7ae21772627a6ce81ad0527640db55daf59bc999
Implement name mangling proposal for exception specifications from cxx-abi-dev 2016-10-11.

This has the following ABI impact:

 1) Functions whose parameter or return types are non-throwing function pointer
    types have different manglings in c++1z mode from prior modes. This is
    necessary because c++1z permits overloading on the noexceptness of function
    pointer parameter types. A warning is issued for cases that will change
    manglings in c++1z mode.

 2) Functions whose parameter or return types contain instantiation-dependent
    exception specifications change manglings in all modes. This is necessary
    to support overloading on / SFINAE in these exception specifications, which
    a careful reading of the standard indicates has essentially always been
    permitted.

Note that, in order to be affected by these changes, the code in question must
specify an exception specification on a function pointer/reference type that is
written syntactically within the declaration of another function. Such
declarations are very rare, and I have so far been unable to find any code
that would be affected by this. (Note that such things will probably become
more common in C++17, since it's a lot easier to get a noexcept function type
as a function parameter / return type there.)

This change does not affect the set of symbols produced by a build of clang,
libc++, or libc++abi.

llvm-svn: 285150
clang/include/clang/AST/Type.h
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/AST/ASTContext.cpp
clang/lib/AST/ItaniumMangle.cpp
clang/lib/AST/Type.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/TreeTransform.h
clang/test/CXX/drs/dr0xx.cpp
clang/test/CodeGenCXX/mangle-exception-spec.cpp [new file with mode: 0644]
clang/test/SemaCXX/cxx1z-noexcept-function-type.cpp