[LLVMbugs] [Bug 7111] New: Diagnostic for typename used in a complete specialization?

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 10 21:12:51 PDT 2010


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

           Summary: Diagnostic for typename used in a complete
                    specialization?
           Product: clang
           Version: 2.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: me22.ca at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


I don't understand 14.6/5 well enough to know who's right, here:

    $ clang++ clang.cc -fsyntax-only
    $ g++-4.4.3 clang.cc -fsyntax-only
    clang.cc:11: error: using ‘typename’ outside of template
    $ g++-4.3.4 clang.cc -fsyntax-only
    clang.cc:11: error: using ‘typename’ outside of template

The code:

    template <unsigned>
    struct uint_t { typedef unsigned long least; };

    template <int Bits>
    struct all_ones {
        typedef typename uint_t<Bits>::least type;
        static type const value = (type(all_ones<Bits-1>::value) << 1) | 1;
    };
    template <>
    struct all_ones<0> {
        typedef typename uint_t<0>::least type;
        static type const value = 0;
    };

-- 
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