This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ RFC/Patch] PR 34938


Hi,

maybe this old issue is already fixed. We used to ICE on:

typedef void (*fptr)() __attribute((noreturn));
template<int> void foo();
template<fptr> void bar();

fptr f = bar< foo<0> >;

but lately we simply reject it:

34938.C:5:10: error: no matches converting function ‘bar’ to type ‘fptr {aka void (*)() volatile}’
fptr f = bar< foo<0> >;
^
34938.C:3:21: note: candidate is: template<void (* <anonymous>)() volatile> void bar()
template<fptr> void bar();
^

is that Ok? clang behaves like us, EDG accepts the code. A secondary issue I noticed is that we print 'volatile' instead of the attribute, that is fixed by the patchlet below.

Thanks,
Paolo.

//////////////////////////

Attachment: patch_34938
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]