For array pointee type, get its cvr qualifier from
its element type. Fixes pr5432. llvm-svn: 86587
This commit is contained in:
parent
b2eae89108
commit
facfdd4d93
|
@ -2982,6 +2982,8 @@ BuiltinCandidateTypeSet::AddPointerWithMoreQualifiedTypeVariants(QualType Ty,
|
|||
|
||||
QualType PointeeTy = PointerTy->getPointeeType();
|
||||
unsigned BaseCVR = PointeeTy.getCVRQualifiers();
|
||||
if (const ConstantArrayType *Array = PointeeTy->getAs<ConstantArrayType>())
|
||||
BaseCVR = Array->getElementType().getCVRQualifiers();
|
||||
bool hasVolatile = VisibleQuals.hasVolatile();
|
||||
bool hasRestrict = VisibleQuals.hasRestrict();
|
||||
|
||||
|
|
|
@ -175,3 +175,13 @@ void test_dr425(A a) {
|
|||
(void)(1.0f * a); // expected-error{{ambiguous}} \
|
||||
// expected-note 81{{candidate}}
|
||||
}
|
||||
|
||||
// pr5432
|
||||
enum e {X};
|
||||
|
||||
const int a[][2] = {{1}};
|
||||
|
||||
int test_pr5432() {
|
||||
return a[X][X];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue