summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 3e368a3b10..fd54499c9e 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -9773,6 +9773,13 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func) {
// FIXME: Is this really right?
if (CurContext == Func) return;
+ // Instantiate the exception specification for any function which is
+ // used: CodeGen will need it.
+ if (Func->getTemplateInstantiationPattern() &&
+ Func->getType()->castAs<FunctionProtoType>()->getExceptionSpecType()
+ == EST_Uninstantiated)
+ InstantiateExceptionSpec(Loc, Func);
+
// Implicit instantiation of function templates and member functions of
// class templates.
if (Func->isImplicitlyInstantiable()) {