[LLVMbugs] [Bug 15069] New: -Wassign-enum assertion with __attribute__((packed)) enum

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jan 25 09:42:12 PST 2013


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

             Bug #: 15069
           Summary: -Wassign-enum assertion with __attribute__((packed))
                    enum
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ptaylor at broadcom.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Reproduced with a recent trunk version (173180):


$ cat test.c
typedef enum __attribute__((packed))
{
  a = 0,
  b = 0xFFFF
} T;

void f()
{
  T x;
  x += 1;
}

$ clang test.c -Wassign-enum
clang: /srv/users/ptaylor/clang/svn/llvm/include/llvm/ADT/APSInt.h:123: bool
llvm::APSInt::operator<(const llvm::APSInt&) const: Assertion `IsUnsigned ==
RHS.IsUnsigned && "Signedness mismatch!"' failed.
...
5  libc.so.6       0x00007f97e62b59f1 __assert_fail + 241
6  clang           0x0000000000ca6cdb
clang::Sema::DiagnoseAssignmentEnum(clang::QualType, clang::QualType,
clang::Expr*) + 1531
7  clang           0x0000000000b88223
clang::Sema::DiagnoseAssignmentResult(clang::Sema::AssignConvertType,
clang::SourceLocation, clang::QualType, clang::QualType, clang::Expr*,
clang::Sema::AssignmentAction, bool*) + 1747
8  clang           0x0000000000b9e0ec
clang::Sema::CheckAssignmentOperands(clang::Expr*,
clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation,
clang::QualType) + 220
9  clang           0x0000000000ba9385
clang::Sema::CreateBuiltinBinOp(clang::SourceLocation,
clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) + 1685
...

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