From 6e24726524c2b51b31bb4b622aa678a46b024f42 Mon Sep 17 00:00:00 2001 From: John McCall Date: Sat, 10 Oct 2009 05:48:19 +0000 Subject: 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 --- lib/Sema/SemaType.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/Sema/SemaType.cpp') 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(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!"); -- cgit v1.2.3-18-g5258