forked from OSchip/llvm-project
SubstTemplateTypeParmType can contain an 'auto' type in their replacement type
This fixes bug 36064 Differential Revision: https://reviews.llvm.org/D106093
This commit is contained in:
parent
09c9f4dc7d
commit
8ada884cbc
|
@ -1801,6 +1801,9 @@ namespace {
|
|||
}
|
||||
|
||||
// Only these types can contain the desired 'auto' type.
|
||||
Type *VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T) {
|
||||
return Visit(T->getReplacementType());
|
||||
}
|
||||
|
||||
Type *VisitElaboratedType(const ElaboratedType *T) {
|
||||
return Visit(T->getNamedType());
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
|
||||
template <typename A, decltype(new A)> // expected-error{{new expression for type 'auto' requires a constructor argument}}
|
||||
struct b;
|
||||
struct d {
|
||||
static auto c = ; // expected-error{{expected expression}}
|
||||
decltype(b<decltype(c), int>); // expected-error{{expected '(' for function-style cast or type construction}}
|
||||
// expected-note@-1{{while substituting prior template arguments into non-type template parameter [with A = auto]}}
|
||||
};
|
Loading…
Reference in New Issue