---------- Forwarded message ---------- From: zhang qingshan <steven.zhang54373@xxxxxxxxx> Date: Thu, Dec 16, 2010 at 10:12 AM Subject: Re: GCC behave different for cv-qualifier function. To: Jonathan Wakely <jwakely.gcc@xxxxxxxxx> On Thu, Dec 16, 2010 at 12:13 AM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote: > On 15 December 2010 10:46, zhang qingshan wrote: >> >> T--> void(), const T-->void() const T& -->void (&)(), >> however, the linker complain that, >> test.cpp:(.text+0x1c): undefined reference to `void fun<void()()>(void >> ( const&)())' >> >> It seems that, gcc still resolve it as void (const &)(), not void(&)(). >> >> I do agree with you that, they are equivalent. But from the view of >> the std rules, there shouldn't be a const here(it should be ignored >> when it applies to the function). > > Yes, it would be clearer if the linker error didn't include the const, > feel free to file a bug report requesting a diagnostic enhancement > (but please don't refer to 8.3.2! :-) > Thanks. I am clear now. It has nothing to do with cv-qualifier reference, but to do with cv-qualifier function, which should be ignore.