summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-08-27 23:12:46 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-08-27 23:12:46 +0000
commit6766794c0b91f2fc28555a175052a731908722a6 (patch)
treef02fb7613d19f1b386b39d8428a640239ebcdc51 /clang/lib/Parse/ParseDecl.cpp
parent5bfe034ecc51dda1af94f3861a3e545d93522ab4 (diff)
downloadbcm5719-llvm-6766794c0b91f2fc28555a175052a731908722a6.tar.gz
bcm5719-llvm-6766794c0b91f2fc28555a175052a731908722a6.zip
Parser support for inline namespaces
llvm-svn: 112320
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index c73b6085ead..1f81202f014 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -323,6 +323,17 @@ Parser::DeclGroupPtrTy Parser::ParseDeclaration(unsigned Context,
<< Attr.Range;
SingleDecl = ParseDeclarationStartingWithTemplate(Context, DeclEnd);
break;
+ case tok::kw_inline:
+ // Could be the start of an inline namespace.
+ if (getLang().CPlusPlus0x && NextToken().is(tok::kw_namespace)) {
+ if (Attr.HasAttr)
+ Diag(Attr.Range.getBegin(), diag::err_attributes_not_allowed)
+ << Attr.Range;
+ SourceLocation InlineLoc = ConsumeToken();
+ SingleDecl = ParseNamespace(Context, DeclEnd, InlineLoc);
+ break;
+ }
+ return ParseSimpleDeclaration(Context, DeclEnd, Attr.AttrList, true);
case tok::kw_namespace:
if (Attr.HasAttr)
Diag(Attr.Range.getBegin(), diag::err_attributes_not_allowed)
OpenPOWER on IntegriCloud