Skip to content

Commit 8c403e4

Browse files
committed
--- Merging r127460 into '.':
U test/SemaCXX/return.cpp U lib/Sema/SemaType.cpp llvm-svn: 127606
1 parent 1d45faa commit 8c403e4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

clang/lib/Sema/SemaType.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,6 +1729,7 @@ TypeSourceInfo *Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
17291729
// cv-qualifiers on return types are pointless except when the type is a
17301730
// class type in C++.
17311731
if (isa<PointerType>(T) && T.getLocalCVRQualifiers() &&
1732+
(D.getName().getKind() != UnqualifiedId::IK_ConversionFunctionId) &&
17321733
(!getLangOptions().CPlusPlus || !T->isDependentType())) {
17331734
assert(chunkIndex + 1 < e && "No DeclaratorChunk for the return type?");
17341735
DeclaratorChunk ReturnTypeChunk = D.getTypeObject(chunkIndex + 1);

clang/test/SemaCXX/return.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ namespace PR9328 {
4949
const PCHAR GetName() { return 0; } // expected-warning{{'const' type qualifier on return type has no effect}}
5050
};
5151
}
52+
53+
class foo {
54+
operator int * const ();
55+
};

0 commit comments

Comments
 (0)