diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-03-15 22:02:01 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-03-15 22:02:01 +0000 |
commit | 05532f2a88161eb6d9b796614f1b82dca541ff22 (patch) | |
tree | 15b2ca5644b8821b6d7f3d43484d300643e36894 /lib/Parse/ParseDecl.cpp | |
parent | 76b1c842c3932d3f83b3abf999dd9622e3e5fb12 (diff) |
Parser support for rvalue references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67033 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index aa96db540a..25565e6576 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -1616,7 +1616,9 @@ void Parser::ParseDeclarator(Declarator &D) { /// 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 @@ void Parser::ParseDeclaratorInternal(Declarator &D, 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 @@ void Parser::ParseDeclaratorInternal(Declarator &D, // 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()); } } |