summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-09-18 00:12:09 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-09-18 00:12:09 +0000
commitbef6cd8b4325de6d05876260fe7c65442eff018d (patch)
tree7dfbab7802db12fd5bf542239d0490b2e84aa82c
parentd7e375d4b3da967424244ba98a8681a647741869 (diff)
downloadbcm5719-llvm-bef6cd8b4325de6d05876260fe7c65442eff018d.tar.gz
bcm5719-llvm-bef6cd8b4325de6d05876260fe7c65442eff018d.zip
Skip parens when detecting whether we're instantiating a function declaration.
llvm-svn: 217997
-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