Index: lib/Parse/ParseDeclCXX.cpp
===================================================================
--- lib/Parse/ParseDeclCXX.cpp	(revision 162762)
+++ lib/Parse/ParseDeclCXX.cpp	(working copy)
@@ -68,10 +68,12 @@
   std::vector<SourceLocation> ExtraNamespaceLoc;
 
   Token attrTok;
+  bool IdentConsumed = false;
 
   if (Tok.is(tok::identifier)) {
     Ident = Tok.getIdentifierInfo();
     IdentLoc = ConsumeToken();  // eat the identifier.
+    IdentConsumed = true;
     while (Tok.is(tok::coloncolon) && NextToken().is(tok::identifier)) {
       ExtraNamespaceLoc.push_back(ConsumeToken());
       ExtraIdent.push_back(Tok.getIdentifierInfo());
@@ -87,6 +89,12 @@
   }
 
   if (Tok.is(tok::equal)) {
+    if (!IdentConsumed) {
+      Diag(Tok, diag::err_expected_ident);
+      // Skip to end of the definition and eat the ';'.
+      SkipUntil(tok::semi);
+      return 0;
+    }
     if (!attrs.empty())
       Diag(attrTok, diag::err_unexpected_namespace_attributes_alias);
     if (InlineLoc.isValid())
