This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
The following code produces the assembler message: "Error: symbol `_ZN1XIXadL_Z1fvEEEC1Ev' is already defined". If the declaration of f in main is omitted, everything is fine. typedef void (*Func) (); template <Func f> struct X { X () {} }; void f () {} X<f> x; int main () { void f (); X<f> x; }
Confirm as a bug. It's still present in the mainline.
What is happening here is that multiple decls for f is getting in the way. Either we have to look at the DECL_UID or change the C++ front-end to only have one decl for f.