forked from OSchip/llvm-project
Fix a bogus assertion after adjusting the type of a substituted
non-type template argument for a non-type template parameter of pointer type. Fixes PR6244. llvm-svn: 95447
This commit is contained in:
parent
d91f302a05
commit
d320e03eed
|
@ -791,7 +791,9 @@ TemplateInstantiator::TransformDeclRefExpr(DeclRefExpr *E) {
|
|||
return SemaRef.ExprError();
|
||||
|
||||
RefE = (Expr *)RefExpr.get();
|
||||
assert(SemaRef.IsQualificationConversion(RefE->getType(),
|
||||
assert(SemaRef.Context.hasSameUnqualifiedType(RefE->getType(),
|
||||
NTTP->getType()) ||
|
||||
SemaRef.IsQualificationConversion(RefE->getType(),
|
||||
NTTP->getType()));
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,12 @@ namespace pointer_to_object_parameters {
|
|||
A2<array_of_Xs> *a13;
|
||||
A2<&an_X> *a13_2;
|
||||
A2<(&an_X)> *a13_3; // expected-error{{non-type template argument cannot be surrounded by parentheses}}
|
||||
|
||||
// PR6244
|
||||
struct X1 {} X1v;
|
||||
template <X1*> struct X2 { };
|
||||
template <X1* Value> struct X3 : X2<Value> { };
|
||||
struct X4 : X3<&X1v> { };
|
||||
}
|
||||
|
||||
// -- For a non-type template-parameter of type reference to object, no
|
||||
|
|
Loading…
Reference in New Issue