Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side.
No Sema functionality change, just the signatures of the Action/Sema methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58913 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp
index f90469a..752d552 100644
--- a/lib/Parse/ParseDeclCXX.cpp
+++ b/lib/Parse/ParseDeclCXX.cpp
@@ -138,7 +138,7 @@
 ///         identifier
 ///         template-id   [TODO]
 /// 
-Parser::TypeTy *Parser::ParseClassName() {
+Parser::TypeTy *Parser::ParseClassName(const CXXScopeSpec *SS) {
   // Parse the class-name.
   // FIXME: Alternatively, parse a simple-template-id.
   if (Tok.isNot(tok::identifier)) {
@@ -147,7 +147,7 @@
   }
 
   // We have an identifier; check whether it is actually a type.
-  TypeTy *Type = Actions.isTypeName(*Tok.getIdentifierInfo(), CurScope);
+  TypeTy *Type = Actions.isTypeName(*Tok.getIdentifierInfo(), CurScope, SS);
   if (!Type) {
     Diag(Tok.getLocation(), diag::err_expected_class_name);
     return 0;
@@ -216,7 +216,13 @@
   if (Tok.is(tok::kw___attribute))
     Attr = ParseAttributes();
 
-  // FIXME: Parse the (optional) nested-name-specifier.
+  // Parse the (optional) nested-name-specifier.
+  CXXScopeSpec SS;
+  if (isTokenCXXScopeSpecifier()) {
+    ParseCXXScopeSpecifier(SS);
+    if (Tok.isNot(tok::identifier))
+      Diag(Tok, diag::err_expected_ident);
+  }
 
   // Parse the (optional) class name.
   // FIXME: Alternatively, parse a simple-template-id.
@@ -250,7 +256,7 @@
   }
 
   // Parse the tag portion of this.
-  DeclTy *TagDecl = Actions.ActOnTag(CurScope, TagType, TK, StartLoc, Name, 
+  DeclTy *TagDecl = Actions.ActOnTag(CurScope, TagType, TK, StartLoc, SS, Name, 
                                      NameLoc, Attr);
 
   // Parse the optional base clause (C++ only).
@@ -354,13 +360,16 @@
     IsVirtual = true;
   }
 
-  // FIXME: Parse optional '::' and optional nested-name-specifier.
+  // Parse optional '::' and optional nested-name-specifier.
+  CXXScopeSpec SS;
+  if (isTokenCXXScopeSpecifier())
+    ParseCXXScopeSpecifier(SS);
 
   // The location of the base class itself.
   SourceLocation BaseLoc = Tok.getLocation();
 
   // Parse the class-name.
-  TypeTy *BaseType = ParseClassName();
+  TypeTy *BaseType = ParseClassName(&SS);
   if (!BaseType)
     return true;