This is the mail archive of the gcc-bugs@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]

[Bug c++/29927] template instantiation with function type



------- 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


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