https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118408

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
There's also a potential problem for this type which is also not tagged and not
in the tagged namespace:

  template<typename _TraitsT>
    class _Compiler
    {
      ...
    private:
      typedef _Scanner<_CharT>               _ScannerT;
      typedef typename _TraitsT::string_type _StringT;

In practice it's OK because it gets instantiated as
_Compiler<std::regex_traits<C>> or _Compiler<std::__cxx11::regex_traits<C>> and
so we get distinct definitions.

But for a program-defined traits type it would be possible to instantiate
_Compiler<user::Traits> in two different translation units that use different
string ABIs. The program has already caused an ODR violation in that case
though, because user::Traits already results in ODR violations if instantiated
for both ABIs.

Reply via email to