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
19 lines
344 B
C++
19 lines
344 B
C++
// 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>
|
|
int foo2() {
|
|
X a = 0x61;
|
|
fn1<char>(a);
|
|
return 0;
|
|
}
|
|
|
|
int main() {
|
|
foo2<int>();
|
|
}
|