[Bug c++/83936] [feature request] Allow constexpr char* as target argument
roland at rschulz dot eu
gcc-bugzilla@gcc.gnu.org
Thu Jan 18 23:24:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83936
--- Comment #2 from Roland Schulz <roland at rschulz dot eu> ---
Do you mean for the target attribute or for all attributes in general? The
following example suggests that for the alloc_align attribute it works to have
the argument depend on a template argument.
template<int xx>
[[gnu::alloc_align(xx)]]
void *a(int align);
void test(int align)
{
a<1>(align);
a<2>(align);
}
$ g++ test_attr.cc -Wall -Wextra -c
test_attr.cc: In substitution of 'template<int xx> void* a(int) [with int xx =
2]':
test_attr.cc:8:15: required from here
test_attr.cc:3:7: warning: alloc_align parameter outside range [-Wattributes]
void *a(int align);
More information about the Gcc-bugs
mailing list