This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29927] template instantiation with function type
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Nov 2006 15:31:56 -0000
- Subject: [Bug c++/29927] template instantiation with function type
- References: <bug-29927-10812@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from bangerth at dealii dot org 2006-11-22 15:31 -------
(In reply to comment #3)
> I expected that the compiler reject it.
> But Comeau compiler also accepted this code.
As does icc.
I can't see why the code would be invalid if one accepts that
T bar;
is the declaration of a function pointer 'bar'. In that case, you
simply have an invalid function pointer and calling it should yield
a segfault, just as you get.
Now, here's a different interpretation that icc actually takes: it says
that
T bar;
is the declaration for a function with name and signature
int bar();
and the code will yield a linker error when compiled.
In any case, can you clarify why exactly you think the code should be
rejected?
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29927