https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86491
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2021-11-10 Ever confirmed|0 |1 Blocks|101603 | --- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Jason Vas Dias from comment #6) > Thanks Andrew! > > But, please explain, why does using a static reference cause > anonymous namespace issues ? So I think the diagnostic should say internal linkage rather than anonymous namespace but only for the static case rather than the anonymous spaces. Reduced testcase: # 1 "t1.H" template < int *_C_OBJ_> struct NT{}; # 2 "tM.C" static int d; struct D : NT<&d> {}; ---- CUT ---- The filenames of the two lines need to be different. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101603 [Bug 101603] [meta-bug] pointer to member functions issues