@@ -2905,26 +2905,25 @@ class SYCLKernelNameTypeVisitor
2905
2905
IsInvalid = true ;
2906
2906
return ;
2907
2907
}
2908
- if (!DeclCtx->isTranslationUnit () && !isa<NamespaceDecl>(DeclCtx)) {
2909
- const bool KernelNameIsMissing = Tag->getName ().empty ();
2910
- if (KernelNameIsMissing) {
2911
- S.Diag (KernelInvocationFuncLoc,
2912
- diag::err_sycl_kernel_incorrectly_named)
2913
- << /* kernel name is missing */ 0 ;
2914
- IsInvalid = true ;
2915
- return ;
2916
- }
2917
- if (Tag->isCompleteDefinition ()) {
2918
- S.Diag (KernelInvocationFuncLoc,
2919
- diag::err_sycl_kernel_incorrectly_named)
2920
- << /* kernel name is not globally-visible */ 1 ;
2921
- IsInvalid = true ;
2922
- } else
2923
- S.Diag (KernelInvocationFuncLoc, diag::warn_sycl_implicit_decl);
2924
-
2925
- S.Diag (Tag->getSourceRange ().getBegin (), diag::note_previous_decl)
2926
- << Tag->getName ();
2908
+ if (!DeclCtx->isTranslationUnit () && !isa<NamespaceDecl>(DeclCtx)) {
2909
+ const bool KernelNameIsMissing = Tag->getName ().empty ();
2910
+ if (KernelNameIsMissing) {
2911
+ S.Diag (KernelInvocationFuncLoc,
2912
+ diag::err_sycl_kernel_incorrectly_named)
2913
+ << /* kernel name is missing */ 0 ;
2914
+ IsInvalid = true ;
2915
+ return ;
2927
2916
}
2917
+ if (Tag->isCompleteDefinition ()) {
2918
+ S.Diag (KernelInvocationFuncLoc,
2919
+ diag::err_sycl_kernel_incorrectly_named)
2920
+ << /* kernel name is not globally-visible */ 1 ;
2921
+ IsInvalid = true ;
2922
+ } else
2923
+ S.Diag (KernelInvocationFuncLoc, diag::warn_sycl_implicit_decl);
2924
+ S.Diag (Tag->getSourceRange ().getBegin (), diag::note_previous_decl)
2925
+ << Tag->getName ();
2926
+ }
2928
2927
}
2929
2928
}
2930
2929
0 commit comments