[LLVMbugs] [Bug 9474] New: clang++ crashes with -fshort-enums

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Mar 13 01:31:07 PST 2011


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

           Summary: clang++ crashes with -fshort-enums
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu


I have tried to reduce the problem as much as I could:

$ cat clangbug.cc                    
enum E { VALUE_1 };

template <typename T>
static void
foo()
{
    (void)sizeof(T);
}

template <typename T>
struct A {};

template <E Enum>
struct B : A<B<Enum> > {};

static void
bar()
{
    foo<B<VALUE_1> >();
}
$ g++ -fshort-enums -g clangbug.cc -c
$ clang++ -fshort-enums -g clangbug.cc -c
Assertion failed: (I.getBitWidth() == Info.Ctx.getIntWidth(E->getType()) &&
"Invalid evaluation result."), function Success, file ExprConstant.cpp, line
944.
( Many lines of backtrace )

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