[LLVMbugs] [Bug 15739] New: explicit specialization of 'instance' after instantiation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Apr 13 02:53:11 PDT 2013


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

            Bug ID: 15739
           Summary: explicit specialization of 'instance' after
                    instantiation
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dimhen at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

clang version 3.3 (trunk 179456)
$ /home/dimhen/build/csa/Release+Asserts/bin/clang++ -fsyntax-only
specialization.ii
specialization.ii:26:57: error: explicit specialization of 'instance' after
instantiation
         0 > ChoiceValueTraitsT < DVCS_DigestInfo, 0 >::instance =
                                                        ^
specialization.ii:22:39: note: implicit instantiation first required here
               A::t_messageImprint >::instance;
                                      ^
specialization.ii:27:14: error: cannot refer to class template
'ChoiceValueTraitsT' without a template argument list
             ChoiceValueTraitsT ();
             ^
specialization.ii:12:30: note: template is declared here
template < class, int >class ChoiceValueTraitsT:public B
                             ^
2 errors generated.
$ cat specialization.ii
struct DVCS_DigestInfo;
class A
{
public:
    enum Type
    { t_messageImprint };
}
;
class B
{
};
template < class, int >class ChoiceValueTraitsT:public B
{
public:
    static const ChoiceValueTraitsT instance;
};
class C
{
    const B *findTraits ()
    {
        return &ChoiceValueTraitsT < DVCS_DigestInfo,
               A::t_messageImprint >::instance;
    }
};
template <> const ChoiceValueTraitsT < DVCS_DigestInfo,
         0 > ChoiceValueTraitsT < DVCS_DigestInfo, 0 >::instance =
             ChoiceValueTraitsT ();

g++ (3.4.6, 4.7.2 and 4.9) compiles this code

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130413/8914c801/attachment.html>


More information about the llvm-bugs mailing list