[LLVMbugs] [Bug 11484] New: "can't implicitly cast lvalue to rvalue with this cast kind" assertion reached while compiling libc++

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 5 15:24:26 PST 2011


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

             Bug #: 11484
           Summary: "can't implicitly cast lvalue to rvalue with this cast
                    kind" assertion reached while compiling libc++
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: devlists at shadowlab.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 7674
  --> http://llvm.org/bugs/attachment.cgi?id=7674
Test case

While trying to compile libc++ (after revision r145698 of libcxx), clang
trigger an assertion when using Mac OS 10.6 SDK.

I managed to reduce the issue to the 2 lines attached test case.

$ clang++ -std=c++11 crash.ii
Assertion failed: (0 && "can't implicitly cast lvalue to rvalue with this cast
kind"), function ImpCastExprToType, file
/Users/jddupas/Projects/OpenSource/llvm/tools/clang/lib/Sema/Sema.cpp, line
248.
…


You can also reproduce the original problem by compiling a file that include
<system_error> using 10.6 SDK (you need to have a trunk clang with trunk libcxx
headers)

$ echo "#include <system_error>" > crash.cpp
$ clang++ -std=c++11 -U__STRICT_ANSI__ -stdlib=libc++ -isysroot
/Developer/SDKs/MacOSX10.6.sdk/ -c crash.cpp
Assertion failed: (0 && "can't implicitly cast lvalue to rvalue with this cast
kind"), function ImpCastExprToType, file
/Users/jddupas/Projects/OpenSource/llvm/tools/clang/lib/Sema/Sema.cpp, line
248.
…
3  clang             0x00000001030b5bf6
clang::DeclContext::lookup(clang::DeclarationName) + 630
4  clang             0x0000000103aca566 abort + 22
5  clang             0x0000000103aca525 __assert_rtn + 53
6  clang             0x0000000102b6a5ff
clang::Sema::ImpCastExprToType(clang::Expr*, clang::QualType, clang::CastKind,
clang::ExprValueKind, llvm::SmallVector<clang::CXXBaseSpecifier*, 4u> const*,
clang::Sema::CheckedConversionKind) + 95
7  clang             0x0000000102c04bbd
clang::Sema::CheckEnumConstant(clang::EnumDecl*, clang::EnumConstantDecl*,
clang::SourceLocation, clang::IdentifierInfo*, clang::Expr*) + 1037
8  clang             0x0000000102c05b76
clang::Sema::ActOnEnumConstant(clang::Scope*, clang::Decl*, clang::Decl*,
clang::SourceLocation, clang::IdentifierInfo*, clang::AttributeList*,
clang::SourceLocation, clang::Expr*) + 726
9  clang             0x0000000102b097d9
clang::Parser::ParseEnumBody(clang::SourceLocation, clang::Decl*) + 729
10 clang             0x0000000102b06d03
clang::Parser::ParseEnumSpecifier(clang::SourceLocation, clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier) + 2675
11 clang             0x0000000102b035ac
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 5788
…

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