aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index c7e7507..20fdf2d 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3063,7 +3063,8 @@ static void checkNewAttributesAfterDef(Sema &S, Decl *New, const Decl *Old) {
// error since the definition will have already been created without
// the semantic effects of the attribute having been applied.
S.Diag(NewAttribute->getLocation(),
- diag::err_sycl_entry_point_after_definition);
+ diag::err_sycl_entry_point_after_definition)
+ << NewAttribute;
S.Diag(Def->getLocation(), diag::note_previous_definition);
cast<SYCLKernelEntryPointAttr>(NewAttribute)->setInvalidAttr();
++I;
@@ -14723,9 +14724,10 @@ void Sema::CheckCompleteVariableDeclaration(VarDecl *var) {
type->isIntegralOrEnumerationType()) {
// In C++98, in-class initialization for a static data member must
// be an integer constant expression.
- SourceLocation Loc;
- if (!Init->isIntegerConstantExpr(Context, &Loc)) {
- Diag(Loc, diag::ext_in_class_initializer_non_constant)
+ // SourceLocation Loc;
+ if (!Init->isIntegerConstantExpr(Context)) {
+ Diag(Init->getExprLoc(),
+ diag::ext_in_class_initializer_non_constant)
<< Init->getSourceRange();
}
}
@@ -16258,19 +16260,19 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
FD->getAttr<SYCLKernelEntryPointAttr>();
if (FD->isDefaulted()) {
Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
- << /*defaulted function*/ 3;
+ << SKEPAttr << /*defaulted function*/ 3;
SKEPAttr->setInvalidAttr();
} else if (FD->isDeleted()) {
Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
- << /*deleted function*/ 2;
+ << SKEPAttr << /*deleted function*/ 2;
SKEPAttr->setInvalidAttr();
} else if (FSI->isCoroutine()) {
Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
- << /*coroutine*/ 7;
+ << SKEPAttr << /*coroutine*/ 7;
SKEPAttr->setInvalidAttr();
} else if (Body && isa<CXXTryStmt>(Body)) {
Diag(SKEPAttr->getLocation(), diag::err_sycl_entry_point_invalid)
- << /*function defined with a function try block*/ 8;
+ << SKEPAttr << /*function defined with a function try block*/ 8;
SKEPAttr->setInvalidAttr();
}