Skip to content

Commit b30dd84

Browse files
committed
Remove the fix for attributes in non-type template parameters.
The C++ standard is not clear whether attributes are permitted in the declarations of non-type template parameters. Previous commits added code to recognize and instantiate attributes in these contexts, but concerns were raised that more changes might be needed. This change removes the previously added support pending clarification from WG21. See also P3324 (Attributes for namespace aliases, template parameters, and lambda captures).
1 parent 977f4fa commit b30dd84

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,8 +1550,6 @@ NamedDecl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D,
15501550
IdResolver.AddDecl(Param);
15511551
}
15521552

1553-
ProcessDeclAttributes(S, Param, D);
1554-
15551553
// C++0x [temp.param]p9:
15561554
// A default template-argument may be specified for any kind of
15571555
// template-parameter that is not a template parameter pack.

clang/test/SemaSYCL/sycl-kernel-entry-point-attr-appertainment.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,11 @@ int bad16();
226226
void bad17(void (fp [[clang::sycl_kernel_entry_point(BADKN<17>)]])());
227227

228228
// Function template parameters.
229-
// expected-error@+1 {{'sycl_kernel_entry_point' attribute only applies to functions}}
229+
// FIXME: Clang currently ignores attributes that appear in template parameters
230+
// FIXME: and the C++ standard is unclear regarding whether such attributes are
231+
// FIXME: permitted. P3324 (Attributes for namespace aliases, template
232+
// FIXME: parameters, and lambda captures) seeks to clarify the situation.
233+
// FIXME-expected-error@+1 {{'sycl_kernel_entry_point' attribute only applies to functions}}
230234
template<void (fp [[clang::sycl_kernel_entry_point(BADKN<18>)]])()>
231235
void bad18();
232236

0 commit comments

Comments
 (0)