summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/vartemplate-lambda.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2016-04-29 02:24:14 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2016-04-29 02:24:14 +0000
commit10aced824a47d3f31dc9ec027808a3ba2a7c98e1 (patch)
treef0d76ff827bf7162e730595a07cf3820e7942751 /clang/test/SemaCXX/vartemplate-lambda.cpp
parent8dafa2da8e334121e7a7e34cb62c304e40da2d6a (diff)
downloadbcm5719-llvm-10aced824a47d3f31dc9ec027808a3ba2a7c98e1.tar.gz
bcm5719-llvm-10aced824a47d3f31dc9ec027808a3ba2a7c98e1.zip
[Parser] Clear the TemplateParamScope bit of the current scope's flag
if we are parsing a template specialization. This commit makes changes to clear the TemplateParamScope bit and set the TemplateParamParent field of the current scope to null if a template specialization is being parsed. Before this commit, Sema::ActOnStartOfLambdaDefinition would check whether the parent template scope had any decls to determine whether or not a template specialization was being parsed. This wasn't correct since it couldn't distinguish between a real template specialization and a template defintion with an unnamed template parameter (only template parameters with names are added to the scope's decl list). To fix the bug, this commit changes the code to check the pointer to the parent template scope rather than the decl list. rdar://problem/23440346 Differential Revision: http://reviews.llvm.org/D19175 llvm-svn: 267975
Diffstat (limited to 'clang/test/SemaCXX/vartemplate-lambda.cpp')
-rw-r--r--clang/test/SemaCXX/vartemplate-lambda.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/vartemplate-lambda.cpp b/clang/test/SemaCXX/vartemplate-lambda.cpp
index d5ad155d0e3..9dab6da3d1e 100644
--- a/clang/test/SemaCXX/vartemplate-lambda.cpp
+++ b/clang/test/SemaCXX/vartemplate-lambda.cpp
@@ -1,6 +1,9 @@
// RUN: %clang_cc1 -std=c++14 -fsyntax-only -verify %s
// expected-no-diagnostics
+template <class> auto fn0 = [] {};
+template <typename> void foo0() { fn0<char>(); }
+
template<typename T> auto fn1 = [](auto a) { return a + T(1); };
template <typename X>
OpenPOWER on IntegriCloud