aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-04-25 15:05:41 +0000
committerDouglas Gregor <dgregor@apple.com>2011-04-25 15:05:41 +0000
commitec385cf3c73434e42d03c321b05100ca64e0c90d (patch)
treef09bdb9288d900feaba11e5056cce87fd8908f14 /lib/Sema/SemaDecl.cpp
parent81542fd91bd5e7e65ebae3eaad117bdaeaf7d737 (diff)
When Sema::ClassifyName() finds an invalid ivar reference, return an
invalid expression rather than the far-more-generic "error". Fixes a mild regression in error recovery uncovered by the GCC testsuite. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 05a077b38f..d07bd4b72d 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -411,11 +411,7 @@ Sema::NameClassification Sema::ClassifyName(Scope *S,
// unqualified lookup mechanism.
if (!SS.isSet() && CurMethod && !isResultTypeOrTemplate(Result, NextToken)) {
ExprResult E = LookupInObjCMethod(Result, S, Name, true);
-
- if (E.isInvalid())
- return NameClassification::Error();
-
- if (E.get())
+ if (E.get() || E.isInvalid())
return E;
// Synthesize ivars lazily.
@@ -430,12 +426,8 @@ Sema::NameClassification Sema::ClassifyName(Scope *S,
// FIXME: This is strange. Shouldn't we just take the ivar returned
// from SynthesizeProvisionalIvar and continue with that?
- E = LookupInObjCMethod(Result, S, Name, true);
-
- if (E.isInvalid())
- return NameClassification::Error();
-
- if (E.get())
+ E = LookupInObjCMethod(Result, S, Name, true);
+ if (E.get() || E.isInvalid())
return E;
}
}