[clang] Ignore DependentSizeArray in -Warray-parameter
Acknowledge we don't know how to handle those yet.
This commit is contained in:
parent
04419a5f55
commit
66fa2847a7
|
@ -3241,9 +3241,15 @@ static bool EquivalentArrayTypes(QualType Old, QualType New,
|
|||
}
|
||||
|
||||
// Only compare size, ignore Size modifiers and CVR.
|
||||
if (Old->isConstantArrayType() && New->isConstantArrayType())
|
||||
if (Old->isConstantArrayType() && New->isConstantArrayType()) {
|
||||
return Ctx.getAsConstantArrayType(Old)->getSize() ==
|
||||
Ctx.getAsConstantArrayType(New)->getSize();
|
||||
}
|
||||
|
||||
// Don't try to compare dependent sized array
|
||||
if (Old->isDependentSizedArrayType() && New->isDependentSizedArrayType()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return Old == New;
|
||||
}
|
||||
|
|
|
@ -16,3 +16,10 @@ void func<10>(int (&Val)[10]) {
|
|||
static constexpr int Extent = 10;
|
||||
void funk(int i[10]);
|
||||
void funk(int i[Extent]); // no-warning
|
||||
|
||||
template<int K>
|
||||
struct T {
|
||||
static void F(int a[8 * K]);
|
||||
};
|
||||
template<int K>
|
||||
void T<K>::F(int a[8 * K]) {} // no-warning
|
||||
|
|
Loading…
Reference in New Issue