[LLVMbugs] [Bug 13047] New: [Windows] Assert failure when mangling typedef'ed array types

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 7 07:02:53 PDT 2012


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

             Bug #: 13047
           Summary: [Windows] Assert failure when mangling typedef'ed
                    array types
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: timurrrr at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


$ cat rgb.cpp
typedef double RGB[3];
RGB color;

$ clang++ -Xclang -cxx-abi -Xclang microsoft -c rgb.cpp
Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!",
file C:\src\llvm\include\llvm/Support/Casting.h, line 198

clang revision is r157983

Assert happens in MicrosoftMangle.cpp around line 250:
  // Now mangle the type.
  // <variable-type> ::= <type> <cvr-qualifiers>
  //                 ::= <type> A # pointers, references, arrays
  // Pointers and references are odd. The type of 'int * const foo;' gets
  // mangled as 'QAHA' instead of 'PAHB', for example.
  QualType Ty = VD->getType();
  if (Ty->isPointerType() || Ty->isReferenceType()) {
    mangleType(Ty);
    Out << 'A';
  } else if (Ty->isArrayType()) {
    // Global arrays are funny, too.
    mangleType(cast<ArrayType>(Ty.getTypePtr()), true);   <<< HERE
    Out << 'A';
  } else {
    mangleType(Ty.getLocalUnqualifiedType());
    mangleQualifiers(Ty.getLocalQualifiers(), false);
  }

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