aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp2
-rw-r--r--test/SemaTemplate/instantiate-function-2.cpp8
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index b6d5abfcc8..0a05d0e304 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -1090,7 +1090,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D,
Function->setLexicalDeclContext(LexicalDC);
// Attach the parameters
- if (isa<FunctionProtoType>(Function->getType())) {
+ if (isa<FunctionProtoType>(Function->getType().IgnoreParens())) {
// Adopt the already-instantiated parameters into our own context.
for (unsigned P = 0; P < Params.size(); ++P)
if (Params[P])
diff --git a/test/SemaTemplate/instantiate-function-2.cpp b/test/SemaTemplate/instantiate-function-2.cpp
index 21eccd4901..087ede2b89 100644
--- a/test/SemaTemplate/instantiate-function-2.cpp
+++ b/test/SemaTemplate/instantiate-function-2.cpp
@@ -56,3 +56,11 @@ namespace AliasTagDef {
int n = f<int>();
}
+
+namespace PR10273 {
+ template<typename T> void (f)(T t) {}
+
+ void g() {
+ (f)(17);
+ }
+}