[LLVMbugs] [Bug 9140] New: Assertion failure in clang++ in gnu++0x mode

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 4 14:45:58 PST 2011


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

           Summary: Assertion failure in clang++ in gnu++0x mode
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jbytheway+llvm at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=6102)
 --> (http://llvm.org/bugs/attachment.cgi?id=6102)
Output from compiling, including assertion failure and backtrace

The following (invalid) code triggers an assertion failure in clang++.

The assertion is "SemaCXXCast.cpp:612: TryCastResult
TryStaticCast(clang::Sema&, clang::Expr*&, clang::QualType, bool, const
clang::SourceRange&, unsigned int&, clang::CastKind&, clang::CXXCastPath&):
Assertion `SrcType->getAs<EnumType>()->getDecl()->isScoped()' failed."; full
output in the attachment.

The source code has been reduced with multidelta, so looks a bit odd.

$ clang++ --version
clang version 2.9 (trunk 124897)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ cat assertion.cpp
template < typename _Tp > class allocator:public __gnu_cxx::new_allocator < _Tp
>
{
}

class c_storage_order {
  template < typename T, std::size_t NumDims, typename Allocator =
      std::allocator < T > >class multi_array;
  template < typename T,
      std::size_t NumDims >
      class multi_array_ref:public const_multi_array_ref < T, NumDims, T * > {
  } template < typename T, std::size_t NumDims,
      typename Allocator > class multi_array:public multi_array_ref < T,
      NumDims > {
    typedef multi_array_ref < T, NumDims > super_type;
    explicit multi_array():super_type((T *) initial_base_, c_storage_order(),
                                      0, 0) {
    }
    enum {
      initial_base_ = 0
    };
  };
  class BoardState {
    struct Board:utility::DataClass < Board, boost::multi_array < BoardState,
        2 >, states > {
      Board() {
$ clang++ --std=gnu++0x -o /dev/null assertion.cpp > compile-output 2>&1

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