DR1330: instantiate exception-specifications when "needed". We previously did
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 18 Oct 2016 23:39:12 +0000 (23:39 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 18 Oct 2016 23:39:12 +0000 (23:39 +0000)
commit84a0b6dba179126639a68a6925d9d0ceb0bb250a
tree5045f91a9ce4e1ebb736dfe5abbf8c60689b0000
parent832c383b251e81f76d6bc4fcc645c4c1b0423617
DR1330: instantiate exception-specifications when "needed". We previously did
not instantiate exception specifications of functions if they were only used in
unevaluated contexts (other than 'noexcept' expressions).

In C++17 onwards, this becomes essential since the exception specification is
now part of the function's type.

Note that this means that constructs like the following no longer work:

  struct A {
    static T f() noexcept(...);
    decltype(f()) *p;
  };

... because the decltype expression now needs the exception specification of
'f', which has not yet been parsed.

llvm-svn: 284549
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaOverload.cpp
clang/test/CXX/drs/dr13xx.cpp
clang/test/SemaCXX/constant-expression-cxx1z.cpp
clang/test/SemaCXX/cxx0x-defaulted-functions.cpp
clang/test/SemaCXX/libstdcxx_pair_swap_hack.cpp
clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
clang/www/cxx_dr_status.html