diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-11-30 00:13:55 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-11-30 00:13:55 +0000 |
commit | 13b40bcc0322e27eaa61b459dec8f898ea1f069d (patch) | |
tree | 51a5ed63dc1f7c26db52b4132d2246b35693d45c /clang/lib/Sema/SemaDecl.cpp | |
parent | f9b191f1356d29fa44f631a1b8454a80d28763a6 (diff) | |
download | bcm5719-llvm-13b40bcc0322e27eaa61b459dec8f898ea1f069d.tar.gz bcm5719-llvm-13b40bcc0322e27eaa61b459dec8f898ea1f069d.zip |
[c++1z] Improve support for -fno-exceptions: we can't just ignore exception
specifications in this mode in C++17, since they're part of the function type,
so check and diagnose them like we would if exceptions were enabled.
Better ideas welcome.
llvm-svn: 288220
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index e2951cf1744..6114c610bb7 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2949,15 +2949,6 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD, // but do not necessarily update the type of New. if (CheckEquivalentExceptionSpec(Old, New)) return true; - // If exceptions are disabled, we might not have resolved the exception spec - // of one or both declarations. Do so now in C++1z, so that we can properly - // compare the types. - if (getLangOpts().CPlusPlus1z) { - for (QualType T : {Old->getType(), New->getType()}) - if (auto *FPT = T->getAs<FunctionProtoType>()) - if (isUnresolvedExceptionSpec(FPT->getExceptionSpecType())) - ResolveExceptionSpec(New->getLocation(), FPT); - } OldQType = Context.getCanonicalType(Old->getType()); NewQType = Context.getCanonicalType(New->getType()); |