diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-06-07 21:46:22 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-06-07 21:46:22 +0000 |
commit | 410ea620fd05609810e3710ba2f75e1b763b0afc (patch) | |
tree | df5e2cea69e344dc4d7233a159b0ade87c3e6423 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | a2380ee70ae88d4dbce307112b66eb7563f72873 (diff) |
[c++1z] Support deducing B in noexcept(B).
This is not required by the standard (yet), but there seems to be reasonable
support for this being a defect according to CWG discussion, and libstdc++ 7.1
relies on it working.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 2279c9ca55..fe92dd8ac6 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -1692,20 +1692,26 @@ TypeSourceInfo *Sema::SubstFunctionDeclType(TypeSourceInfo *T, return TLB.getTypeSourceInfo(Context, Result); } +bool Sema::SubstExceptionSpec(SourceLocation Loc, + FunctionProtoType::ExceptionSpecInfo &ESI, + SmallVectorImpl<QualType> &ExceptionStorage, + const MultiLevelTemplateArgumentList &Args) { + assert(ESI.Type != EST_Uninstantiated); + + bool Changed = false; + TemplateInstantiator Instantiator(*this, Args, Loc, DeclarationName()); + return Instantiator.TransformExceptionSpec(Loc, ESI, ExceptionStorage, + Changed); +} + void Sema::SubstExceptionSpec(FunctionDecl *New, const FunctionProtoType *Proto, const MultiLevelTemplateArgumentList &Args) { FunctionProtoType::ExceptionSpecInfo ESI = Proto->getExtProtoInfo().ExceptionSpec; - assert(ESI.Type != EST_Uninstantiated); - - TemplateInstantiator Instantiator(*this, Args, New->getLocation(), - New->getDeclName()); SmallVector<QualType, 4> ExceptionStorage; - bool Changed = false; - if (Instantiator.TransformExceptionSpec( - New->getTypeSourceInfo()->getTypeLoc().getLocEnd(), ESI, - ExceptionStorage, Changed)) + if (SubstExceptionSpec(New->getTypeSourceInfo()->getTypeLoc().getLocEnd(), + ESI, ExceptionStorage, Args)) // On error, recover by dropping the exception specification. ESI.Type = EST_None; |