[LLVMbugs] [Bug 12527] New: initialization from an _Atomic variable causes assert

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 11 20:07:13 PDT 2012


             Bug #: 12527
           Summary: initialization from an _Atomic variable causes assert
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang asserts on this when building in C mode:

_Atomic(int*) a;
void f() { int *b = a; }

src/tools/clang/lib/Sema/Sema.cpp:251: ExprResult
clang::Sema::ImpCastExprToType(clang::Expr *, clang::QualType, clang::CastKind,
clang::ExprValueKind, const CXXCastPath *, clang::Sema::CheckedConversionKind):
Assertion `0 && "can't implicitly cast lvalue to rvalue with this cast kind"'

In C++ mode, we get a diagnostic (and no assert):

error: cannot initialize a variable of type 'int *' with an lvalue of type
'_Atomic(int *)'

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