diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2010-04-07 23:29:58 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2010-04-07 23:29:58 +0000 |
commit | edc287751a4b05e3b4d8ff2b38fa30c5b59a548b (patch) | |
tree | 6944cd02cf8be5aa01f3c3159fb6f096eb5831ce /lib/Sema/SemaType.cpp | |
parent | 1e3c6f4ab525beb31390f6b2f1154bd5c63bfb3f (diff) |
Fix some redundant errors by changing CXXScopeSpec::isSet calls into
isNotEmpty calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index cbd12d4380..4358640029 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -1253,8 +1253,11 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, } // The scope spec must refer to a class, or be dependent. QualType ClsType; - if (isDependentScopeSpecifier(DeclType.Mem.Scope()) - || dyn_cast_or_null<CXXRecordDecl>( + if (DeclType.Mem.Scope().isInvalid()) { + // Avoid emitting extra errors if we already errored on the scope. + D.setInvalidType(true); + } else if (isDependentScopeSpecifier(DeclType.Mem.Scope()) + || dyn_cast_or_null<CXXRecordDecl>( computeDeclContext(DeclType.Mem.Scope()))) { NestedNameSpecifier *NNS = (NestedNameSpecifier *)DeclType.Mem.Scope().getScopeRep(); |