diff options
author | Abramo Bagnara <abramo.bagnara@gmail.com> | 2011-03-08 16:41:52 +0000 |
---|---|---|
committer | Abramo Bagnara <abramo.bagnara@gmail.com> | 2011-03-08 16:41:52 +0000 |
commit | a2026c96d3935e7909e049ad9096762844544ed6 (patch) | |
tree | a5143046961e31715a2f956559e58fb5978a0780 /lib/Sema/SemaDeclCXX.cpp | |
parent | 2c10c8072cabeb22651462e435e8b81f3221b6a5 (diff) |
Fixed source range for StaticAssertDecl and LinkageSpecDecl. Fixed source range for declarations using postfix types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127251 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index bdfdb17704..a2528a6140 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -6588,7 +6588,7 @@ Decl *Sema::ActOnStartLinkageSpecification(Scope *S, SourceLocation ExternLoc, // FIXME: Add all the various semantics of linkage specifications LinkageSpecDecl *D = LinkageSpecDecl::Create(Context, CurContext, - LangLoc, Language); + ExternLoc, LangLoc, Language); CurContext->addDecl(D); PushDeclContext(S, D); return D; @@ -6788,21 +6788,23 @@ Decl *Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D) { return ExDecl; } -Decl *Sema::ActOnStaticAssertDeclaration(SourceLocation AssertLoc, +Decl *Sema::ActOnStaticAssertDeclaration(SourceLocation StaticAssertLoc, Expr *AssertExpr, - Expr *AssertMessageExpr_) { + Expr *AssertMessageExpr_, + SourceLocation RParenLoc) { StringLiteral *AssertMessage = cast<StringLiteral>(AssertMessageExpr_); if (!AssertExpr->isTypeDependent() && !AssertExpr->isValueDependent()) { llvm::APSInt Value(32); if (!AssertExpr->isIntegerConstantExpr(Value, Context)) { - Diag(AssertLoc, diag::err_static_assert_expression_is_not_constant) << + Diag(StaticAssertLoc, + diag::err_static_assert_expression_is_not_constant) << AssertExpr->getSourceRange(); return 0; } if (Value == 0) { - Diag(AssertLoc, diag::err_static_assert_failed) + Diag(StaticAssertLoc, diag::err_static_assert_failed) << AssertMessage->getString() << AssertExpr->getSourceRange(); } } @@ -6810,8 +6812,8 @@ Decl *Sema::ActOnStaticAssertDeclaration(SourceLocation AssertLoc, if (DiagnoseUnexpandedParameterPack(AssertExpr, UPPC_StaticAssertExpression)) return 0; - Decl *Decl = StaticAssertDecl::Create(Context, CurContext, AssertLoc, - AssertExpr, AssertMessage); + Decl *Decl = StaticAssertDecl::Create(Context, CurContext, StaticAssertLoc, + AssertExpr, AssertMessage, RParenLoc); CurContext->addDecl(Decl); return Decl; |