diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-20 12:41:22 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-20 12:41:22 +0000 |
commit | 0feaf0c7e3e1349907f38edf9e7635500bf85cc3 (patch) | |
tree | f92b73081a9e1969992ab244b3cbe9a92e98a2f3 /clang/lib/Sema/SemaOverload.cpp | |
parent | 16aba1702434c56c78e1ea7fe55be81d88e0f443 (diff) | |
download | bcm5719-llvm-0feaf0c7e3e1349907f38edf9e7635500bf85cc3.tar.gz bcm5719-llvm-0feaf0c7e3e1349907f38edf9e7635500bf85cc3.zip |
Implement core issue 1608: class members can be found via operator lookup in a trailing return type in that class's body.
llvm-svn: 179941
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 4576a0eab2c..1b22102d195 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/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); |