https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123728
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think this warning is correct here.
Since Test has external linkage but Test::ParamType is local linkage.
So its of TestMetaFactory<Test> in Test::AddToRegistry makes it possible to
have an ODR violation.
>The offending instance of the template is parametrized on a type that isn't in
>a header (and in the Compiler Explorer version is in the actual main C++
>file), and that template in turn has a typedef to the offending internal
>linkage type. But there is no way to refer to this instance of the template
>outside the C++ file.
That is NOT how ODR works in C++.
See above on why the warning is correct.
Basically it comes down to Test::AddToRegistry .