Author: rafael
Date: Thu Mar 10 22:56:58 2011
New Revision: 127460

URL: http://llvm.org/viewvc/llvm-project?rev=127460&view=rev
Log:
Fix PR9453 by not trying to print a warning about ignored qualifiers
in conversion functions.

Modified:
    cfe/trunk/lib/Sema/SemaType.cpp
    cfe/trunk/test/SemaCXX/return.cpp

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=127460&r1=127459&r2=127460&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Thu Mar 10 22:56:58 2011
@@ -1757,6 +1757,7 @@
       // 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);

Modified: cfe/trunk/test/SemaCXX/return.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/return.cpp?rev=127460&r1=127459&r2=127460&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/return.cpp (original)
+++ cfe/trunk/test/SemaCXX/return.cpp Thu Mar 10 22:56:58 2011
@@ -49,3 +49,7 @@
     const PCHAR GetName() { return 0; } // expected-warning{{'const' type 
qualifier on return type has no effect}}
   };
 }
+
+class foo  {
+  operator int * const ();
+};


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to