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

             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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    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"'
failed.

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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to