Parser support for rvalue references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67033 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index aa96db5..25565e6 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1616,7 +1616,9 @@
 ///       ptr-operator:
 ///         '*' cv-qualifier-seq[opt]
 ///         '&'
+/// [C++0x] '&&'
 /// [GNU]   '&' restrict[opt] attributes[opt]
+/// [GNU?]  '&&' restrict[opt] attributes[opt]
 ///         '::'[opt] nested-name-specifier '*' cv-qualifier-seq[opt]
 void Parser::ParseDeclaratorInternal(Declarator &D,
                                      DirectDeclParseFunction DirectDeclParser) {
@@ -1657,13 +1659,15 @@
   tok::TokenKind Kind = Tok.getKind();
   // Not a pointer, C++ reference, or block.
   if (Kind != tok::star && (Kind != tok::amp || !getLang().CPlusPlus) &&
+      (Kind != tok::ampamp || !getLang().CPlusPlus0x) &&
       (Kind != tok::caret || !getLang().Blocks)) {
     if (DirectDeclParser)
       (this->*DirectDeclParser)(D);
     return;
   }
 
-  // Otherwise, '*' -> pointer, '^' -> block, '&' -> reference.
+  // Otherwise, '*' -> pointer, '^' -> block, '&' -> lvalue reference,
+  // '&&' -> rvalue reference
   SourceLocation Loc = ConsumeToken();  // Eat the *, ^ or &.
   D.SetRangeEnd(Loc);
 
@@ -1730,7 +1734,8 @@
 
     // Remember that we parsed a reference type. It doesn't have type-quals.
     D.AddTypeInfo(DeclaratorChunk::getReference(DS.getTypeQualifiers(), Loc,
-                                                DS.TakeAttributes()),
+                                                DS.TakeAttributes(),
+                                                Kind == tok::amp),
                   SourceLocation());
   }
 }