http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42018

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.10.01 11:52:43
     Ever Confirmed|0                           |1
      Known to fail|                            |4.1.2, 4.3.4, 4.4.3, 4.5.1,
                   |                            |4.6.0

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-01 
11:52:43 UTC ---
Oops, I've just realised I pasted the wrong code in comment 2, I meant to say
that this fails:

template<typename>
void foo(void);

namespace {
  template<>
  void foo<int>(void) { return; }
}

template<>
void foo<int>(void);

int main(int, char **) { foo<int>(); }

i.e. if the invalid specialization comes before the valid specialization, it's
rejected.

But in the original example, where the invalid specialization comes later, it's
incorrectly accepted. The same error should be given in both cases: the
specialization in the anon namespace does not match any primary template
declaration.

Reply via email to