http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12577
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WONTFIX --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-20 01:29:24 UTC --- t.cc:26:45: error: redefinition of ‘void (bar::* const foo<bar, int>::setter)(int)’ t.cc:17:46: error: ‘void (bar::* const foo<bar, int>::setter)(int)’ previously declared here t.cc:37:52: error: expected unqualified-id before ‘*’ token t.cc:37:54: error: expected primary-expression before ‘const’ t.cc:37:72: error: ‘JustAPointer<bar>()->bar::getfoobar()’ cannot be used as a function t.cc:37:74: error: expected primary-expression before ‘void’ t.cc:38:7: error: expected unqualified-id before ‘=’ token t.cc:42:52: error: expected unqualified-id before ‘*’ token t.cc:42:54: error: expected primary-expression before ‘const’ t.cc:42:68: error: expected primary-expression before ‘__typeof__’ t.cc:42:121: error: ‘JustAPointer<bar>()->bar::getfoobar()’ cannot be used as a function t.cc:42:123: error: expected primary-expression before ‘void’ t.cc:43:5: error: expected unqualified-id before ‘=’ token --- CUT --- If I use decltype instead of typeof we get: t.cc:27:45: error: redefinition of ‘void (bar::* const foo<bar, int>::setter)(int)’ t.cc:18:46: error: ‘void (bar::* const foo<bar, int>::setter)(int)’ previously declared here t.cc:43:127: error: conflicting declaration ‘int (bar::* const foo<bar, int>::setter)()’ t.cc:18:46: error: ‘foo<bar, int>::setter’ has a previous declaration as ‘void (bar::* const foo<bar, int>::setter)(int)’ Which looks correct so I am going to close as won't fix as decltype is the more correct choice now.