]> granicus.if.org Git - clang/commitdiff
Create UnresolvedUsingDecls.
authorAnders Carlsson <andersca@mac.com>
Fri, 28 Aug 2009 05:49:21 +0000 (05:49 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 28 Aug 2009 05:49:21 +0000 (05:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80346 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclCXX.cpp

index 6876c2c9a872ce5274d586f7b17df10663b2aa76..b2c54036869f73d18867982f867db04807441a5b 100644 (file)
@@ -98,8 +98,6 @@ def err_using_requires_qualname : Error<
   "using declaration requires a qualified name">;
 def err_using_typename_non_type : Error<
   "'typename' keyword used on a non-type">;
-def err_using_dependent_unsupported : Error<
-  "dependent using declaration not supported yet">;
 def err_using_decl_nested_name_specifier_is_not_a_base_class : Error<
   "using declaration refers into %0, which is not a base class of %1">;
 def err_using_decl_can_not_refer_to_class_member : Error<
index 51f8fa56977fabef242e69567667701b10e4788a..602caf2825735909f2e19f6a7df49a79573edff1 100644 (file)
@@ -2127,13 +2127,9 @@ NamedDecl *Sema::BuildUsingDeclaration(SourceLocation UsingLoc,
   assert(!SS.isInvalid() && "Invalid CXXScopeSpec.");
   assert(IdentLoc.isValid() && "Invalid TargetName location.");
 
-  // FIXME: Implement this properly!
-  if (isUnknownSpecialization(SS)) {
-    Diag(IdentLoc, diag::err_using_dependent_unsupported);
-    delete AttrList;
-    return 0;
-  }
-
+  // FIXME: We ignore attributes for now.
+  delete AttrList;
+  
   if (SS.isEmpty()) {
     Diag(IdentLoc, diag::err_using_requires_qualname);
     return 0;
@@ -2142,6 +2138,12 @@ NamedDecl *Sema::BuildUsingDeclaration(SourceLocation UsingLoc,
   NestedNameSpecifier *NNS = 
     static_cast<NestedNameSpecifier *>(SS.getScopeRep());
 
+  if (isUnknownSpecialization(SS)) {
+    return UnresolvedUsingDecl::Create(Context, CurContext, UsingLoc,
+                                       SS.getRange(), NNS,
+                                       IdentLoc, Name, IsTypeName);
+  }
+  
   DeclContext *LookupContext = 0;
   
   if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(CurContext)) {
@@ -2202,9 +2204,6 @@ NamedDecl *Sema::BuildUsingDeclaration(SourceLocation UsingLoc,
     return 0;
   }
   
-  // FIXME: We ignore attributes for now.
-  delete AttrList;
-
   return UsingDecl::Create(Context, CurContext, IdentLoc, SS.getRange(),
                            ND->getLocation(), UsingLoc, ND, NNS, IsTypeName);
 }