From: Douglas Gregor Date: Thu, 22 Apr 2010 14:24:35 +0000 (+0000) Subject: Record nested-name-specifiers of when we create X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=050b78acf11900cb8c47563376200a1d7bd97f59;p=clang Record nested-name-specifiers of when we create elaborated-type-specifiers. Patch by Enea Zaffanella! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102065 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 9a3827e1ca..ab1fc1824f 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -280,6 +280,7 @@ static QualType ConvertDeclSpecToType(Sema &TheSema, if (TheSema.getLangOptions().CPlusPlus) { TagDecl::TagKind Tag = TagDecl::getTagKindForTypeSpec(DS.getTypeSpecType()); + Result = TheSema.getQualifiedNameType(DS.getTypeSpecScope(), Result); Result = Context.getElaboratedType(Result, Tag); } diff --git a/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp index c51c2cacc3..bb1d67f51a 100644 --- a/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp +++ b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp @@ -39,7 +39,7 @@ namespace Test0 { test<2> _1 = (foo)(a); class Test0::foo b; - test<2> _2 = (foo)(b); // expected-error {{no viable conversion from 'class Test0::foo' to 'class foo' is possible}} + test<2> _2 = (foo)(b); // expected-error {{no viable conversion from 'class Test0::foo' to 'class ::foo' is possible}} } } }