diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-03-20 21:47:22 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-03-20 21:47:22 +0000 |
commit | 564417a071794203dfff574b0aee897fc4643266 (patch) | |
tree | e372f810b434a87770d0d41a85f57b20194b612f /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 56b26a5707f482a480c124d84f25e427caa0513b (diff) | |
download | bcm5719-llvm-564417a071794203dfff574b0aee897fc4643266.tar.gz bcm5719-llvm-564417a071794203dfff574b0aee897fc4643266.zip |
When the exception specification for a function in an imported PCH or module is
resolved, emit an update record.
llvm-svn: 204403
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 8cfc4149e06..029f9a2dcbf 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -3131,19 +3131,13 @@ static void InstantiateExceptionSpec(Sema &SemaRef, FunctionDecl *New, } } - // Rebuild the function type - const FunctionProtoType *NewProto - = New->getType()->getAs<FunctionProtoType>(); - assert(NewProto && "Template instantiation without function prototype?"); - - FunctionProtoType::ExtProtoInfo EPI = NewProto->getExtProtoInfo(); + FunctionProtoType::ExtProtoInfo EPI; EPI.ExceptionSpecType = Proto->getExceptionSpecType(); EPI.NumExceptions = Exceptions.size(); EPI.Exceptions = Exceptions.data(); EPI.NoexceptExpr = NoexceptExpr; - New->setType(SemaRef.Context.getFunctionType(NewProto->getReturnType(), - NewProto->getParamTypes(), EPI)); + SemaRef.UpdateExceptionSpec(New, EPI); } void Sema::InstantiateExceptionSpec(SourceLocation PointOfInstantiation, @@ -3157,10 +3151,9 @@ void Sema::InstantiateExceptionSpec(SourceLocation PointOfInstantiation, if (Inst.isInvalid()) { // We hit the instantiation depth limit. Clear the exception specification // so that our callers don't have to cope with EST_Uninstantiated. - FunctionProtoType::ExtProtoInfo EPI = Proto->getExtProtoInfo(); + FunctionProtoType::ExtProtoInfo EPI; EPI.ExceptionSpecType = EST_None; - Decl->setType(Context.getFunctionType(Proto->getReturnType(), - Proto->getParamTypes(), EPI)); + UpdateExceptionSpec(Decl, EPI); return; } |