Fix PR9453 by not trying to print a warning about ignored qualifiers

in conversion functions.

llvm-svn: 127460
This commit is contained in:
Rafael Espindola 2011-03-11 04:56:58 +00:00
parent cc27b3acc4
commit 6b7e3bc992
2 changed files with 5 additions and 0 deletions

View File

@ -1757,6 +1757,7 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
// cv-qualifiers on return types are pointless except when the type is a
// class type in C++.
if (isa<PointerType>(T) && T.getLocalCVRQualifiers() &&
(D.getName().getKind() != UnqualifiedId::IK_ConversionFunctionId) &&
(!getLangOptions().CPlusPlus || !T->isDependentType())) {
assert(chunkIndex + 1 < e && "No DeclaratorChunk for the return type?");
DeclaratorChunk ReturnTypeChunk = D.getTypeObject(chunkIndex + 1);

View File

@ -49,3 +49,7 @@ namespace PR9328 {
const PCHAR GetName() { return 0; } // expected-warning{{'const' type qualifier on return type has no effect}}
};
}
class foo {
operator int * const ();
};