diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-11-18 01:28:03 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-11-18 01:28:03 +0000 |
commit | f43fb722f6bf048d548659ad326cfb1cfc14420b (patch) | |
tree | fe8c9319329151cf91f6c217c8a124fef9916c01 /lib | |
parent | 2dbdd622d02d1bfbe1e5bcf421b07b74c7a748f1 (diff) |
PR5520: Make sure to check whether the base type is complete before looking for
operator->.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 938a5d769d..634c9ceefc 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -5503,6 +5503,11 @@ Sema::BuildOverloadedArrowExpr(Scope *S, ExprArg BaseIn, SourceLocation OpLoc) { OverloadCandidateSet CandidateSet; const RecordType *BaseRecord = Base->getType()->getAs<RecordType>(); + if (RequireCompleteType(Base->getLocStart(), Base->getType(), + PDiag(diag::err_typecheck_incomplete_tag) + << Base->getSourceRange())) + return ExprError(); + LookupResult R(*this, OpName, OpLoc, LookupOrdinaryName); LookupQualifiedName(R, BaseRecord->getDecl()); R.suppressDiagnostics(); |