summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-31 18:54:35 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-31 18:54:35 +0000
commit0c9dd8476f8dd7a79e622530eb7861f2e8674d45 (patch)
treeced35cf01fbc42283acdae7e49ea93278efa4dc0 /clang/lib/Sema
parent38abecbad0fd51b4e2fa83fdbdd96b68f40683ba (diff)
downloadbcm5719-llvm-0c9dd8476f8dd7a79e622530eb7861f2e8674d45.tar.gz
bcm5719-llvm-0c9dd8476f8dd7a79e622530eb7861f2e8674d45.zip
It's OK for a return type to be incomplete if it's being defined.
llvm-svn: 92367
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index d6aa240df4c..204d7764682 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -5532,10 +5532,13 @@ bool Sema::CheckOverridingFunctionReturnType(const CXXMethodDecl *New,
// 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.
OpenPOWER on IntegriCloud