summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiate.cpp4
-rw-r--r--clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp7
2 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiate.cpp b/clang/lib/Sema/SemaTemplateInstantiate.cpp
index 5838f756885..25b2802f029 100644
--- a/clang/lib/Sema/SemaTemplateInstantiate.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiate.cpp
@@ -1577,8 +1577,8 @@ TypeSourceInfo *Sema::SubstFunctionDeclType(TypeSourceInfo *T,
QualType Result;
- // FIXME: What if the function type is parenthesized?
- if (FunctionProtoTypeLoc Proto = TL.getAs<FunctionProtoTypeLoc>()) {
+ if (FunctionProtoTypeLoc Proto =
+ TL.IgnoreParens().getAs<FunctionProtoTypeLoc>()) {
// Instantiate the type, other than its exception specification. The
// exception specification is instantiated in InitFunctionInstantiation
// once we've built the FunctionDecl.
diff --git a/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp b/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
index ae10399b9ad..f62ef61758a 100644
--- a/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
+++ b/clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
@@ -58,6 +58,13 @@ namespace dr1330_example {
S().f<S>(); // ok
S().f<int>(); // expected-note {{instantiation of exception spec}}
}
+
+ template<typename T>
+ struct U {
+ void f() noexcept(T::error);
+ void (g)() noexcept(T::error);
+ };
+ U<int> uint; // ok
}
namespace core_19754_example {
OpenPOWER on IntegriCloud