[cfe-commits] r92367 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Anders Carlsson andersca at mac.com
Thu Dec 31 10:54:35 PST 2009


Author: andersca
Date: Thu Dec 31 12:54:35 2009
New Revision: 92367

URL: http://llvm.org/viewvc/llvm-project?rev=92367&view=rev
Log:
It's OK for a return type to be incomplete if it's being defined.

Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=92367&r1=92366&r2=92367&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Dec 31 12:54:35 2009
@@ -5532,10 +5532,13 @@
   //   If the return type of D::f differs from the return type of B::f, the 
   //   class type in the return type of D::f shall be complete at the point of
   //   declaration of D::f or shall be the class type D.
-  if (RequireCompleteType(New->getLocation(), NewClassTy, 
-                          PDiag(diag::err_covariant_return_incomplete)
-                            << New->getDeclName()))
+  if (const RecordType *RT = NewClassTy->getAs<RecordType>()) {
+    if (!RT->isBeingDefined() &&
+        RequireCompleteType(New->getLocation(), NewClassTy, 
+                            PDiag(diag::err_covariant_return_incomplete)
+                              << New->getDeclName()))
     return true;
+  }
 
   if (!Context.hasSameUnqualifiedType(NewClassTy, OldClassTy)) {
     // Check if the new class derives from the old class.





More information about the cfe-commits mailing list