[LLVMbugs] [Bug 7388] New: Error using _Bool as a template argument

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 15 16:38:25 PDT 2010


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

           Summary: Error using _Bool as a template argument
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: John.Thompson.JTSoftware at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=5043)
 --> (http://llvm.org/bugs/attachment.cgi?id=5043)
The repo code

It seems that _Bool is a predefined type in Clang, yet the following (reduced)
code fails to compile:

#ifndef __clang__
typedef bool _Bool;
#endif
template<class _Iter>  struct iterator_traits  {
};
template<> struct iterator_traits<_Bool>  {
};

Output from "clang -cc1 traits_red1.cpp":

traits_red1.cpp:6:35: error: expected expression
template<> struct iterator_traits<_Bool>  {
                                  ^
traits_red1.cpp:6:1: error: extraneous 'template<>' in declaration of struct
(null)
template<> struct iterator_traits<_Bool>  {
^
traits_red1.cpp:6:12: error: anonymous unions at namespace or global scope must
be declared 'static'
template<> struct iterator_traits<_Bool>  {
           ^
traits_red1.cpp:6:12: error: anonymous structs and classes must be class
members
4 errors generated.

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