[LLVMbugs] [Bug 8450] Unexpected error "explicit specialization of 'XXX' after instantiation"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 25 11:11:52 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=8450

Douglas Gregor <dgregor at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Douglas Gregor <dgregor at apple.com> 2010-10-25 13:11:51 CDT ---
Clang is correct here in diagnosing C++ [temp.expl.spec]p6:

  If a template, a member template or the member of a class template is
explicitly specialized then that specialization shall be declared before the
first use of that specialization that would cause an implicit instantiation to
take place, in every translation unit in which such a use occurs; no diagnostic
is required.

g++'s behavior is also acceptable according to the standard ("no diagnostic is
required). MSVC is wrong to reject the code in the WORKAROUND block, per C++
[temp.expl.spec]p13:

  An explicit specialization of a static data member of a template is a
definition if the declaration includes an initializer; otherwise, it is a
declaration.

It's probably treating the explicit specialization as a definition rather than
a declaration.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list