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

Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richard-gccbugzilla@metafoo
                   |                            |.co.uk

--- Comment #13 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> 
---
(In reply to Andrew Pinski from comment #12)
> GCC, ICC, clang and MSVC all accept the testcase in comment #11.

I believe the testcase is valid. The instantiation of `C<double>` looks like
this:

struct C<double>
{
  enum Inner { c };

  template<Inner I, int dummy> struct Dispatcher;

  template<int dummy> struct Dispatcher<c, dummy> 
  { };

};

... and the template argument `c` here refers to the non-dependent enumeration
constant `C<double>::c`.

The rule governing whether the original template `C` is valid is
[temp.res.general]/6 (https://eel.is/c++draft/temp.res.general#6), and in
particular:

> no diagnostic shall be issued for a template for which a valid specialization 
> can be generated

Because `C` has valid specializations, it's valid.
  • [Bug c++/31584] [DR5... richard-gccbugzilla at metafoo dot co.uk via Gcc-bugs

Reply via email to