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

             Bug #: 12712
           Summary: "error: no matching conversion for static_cast" for
                    valid casts
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


I just ran into a problem while compiling the C++ proxy classes from jace
(http://code.google.com/p/jace/).

There is a chain of static casts which compiles under gcc but fails with clang.


The distilled part which reporduces the problem is:

-------- begin -----

typedef unsigned char    jboolean;

typedef union jvalue {
    jboolean z;
} jvalue;

class JValue
{
public:
    operator jvalue() { return mValue; }
    operator jvalue() const { return mValue; }

private:
    jvalue mValue;
};

class JBoolean: public JValue
{
public:
    operator jboolean() const { return static_cast<jvalue>(*this).z; }
};

-------- end ------

Clang out of the Xcode 4.3.2 fails to build this snippet:

Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix

This gcc compiles it fine:
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658)
(LLVM build 2336.1.00)

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