diff options
author | John McCall <rjmccall@apple.com> | 2009-10-10 05:48:19 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-10-10 05:48:19 +0000 |
commit | 6e24726524c2b51b31bb4b622aa678a46b024f42 (patch) | |
tree | 18635fadba59cf37262ebf36c8ad806ad0eb8bd2 /lib/Sema/SemaType.cpp | |
parent | eed3e699b581ad9e17f8147f26b882d20d65a317 (diff) |
Qualified lookup through using declarations. Diagnose a new type of ambiguity.
Split the various ambiguous result enumerators into their own enum. Tests
for most of C++ [namespace.qual].
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 6767712085..6a5db5f2ad 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -194,7 +194,13 @@ QualType Sema::ConvertDeclSpecToType(const DeclSpec &DS, case DeclSpec::TST_union: case DeclSpec::TST_struct: { Decl *D = static_cast<Decl *>(DS.getTypeRep()); - assert(D && "Didn't get a decl for a class/enum/union/struct?"); + if (!D) { + // This can happen in C++ with ambiguous lookups. + Result = Context.IntTy; + isInvalid = true; + break; + } + assert(DS.getTypeSpecWidth() == 0 && DS.getTypeSpecComplex() == 0 && DS.getTypeSpecSign() == 0 && "Can't handle qualifiers on typedef names yet!"); |