aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-04-20 12:41:22 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-04-20 12:41:22 +0000
commite410be9f3f08684c04a611f2ab57257c2d2eb0ae (patch)
tree1f48a9ec5e6a187067dbb13d5487c43dbbe82262 /lib/Sema/SemaOverload.cpp
parent8e8e95c57c310bbc52cdc8d32df23c95afc77916 (diff)
Implement core issue 1608: class members can be found via operator lookup in a trailing return type in that class's body.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179941 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 4576a0eab2..1b22102d19 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -6018,13 +6018,15 @@ void Sema::AddMemberOperatorCandidates(OverloadedOperatorKind Op,
// constructed as follows:
QualType T1 = Args[0]->getType();
- // -- If T1 is a class type, the set of member candidates is the
- // result of the qualified lookup of T1::operator@
- // (13.3.1.1.1); otherwise, the set of member candidates is
- // empty.
+ // -- If T1 is a complete class type or a class currently being
+ // defined, the set of member candidates is the result of the
+ // qualified lookup of T1::operator@ (13.3.1.1.1); otherwise,
+ // the set of member candidates is empty.
if (const RecordType *T1Rec = T1->getAs<RecordType>()) {
- // Complete the type if it can be completed. Otherwise, we're done.
- if (RequireCompleteType(OpLoc, T1, 0))
+ // Complete the type if it can be completed.
+ RequireCompleteType(OpLoc, T1, 0);
+ // If the type is neither complete nor being defined, bail out now.
+ if (!T1Rec->getDecl()->getDefinition())
return;
LookupResult Operators(*this, OpName, OpLoc, LookupOrdinaryName);