[LLVMbugs] [Bug 7801] New: Unallowed cast from incomplete type to void*

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 3 13:19:59 PDT 2010


           Summary: Unallowed cast from incomplete type to void*
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: abramobagnara at tin.it
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

It seems that clang when compiling this tiny source in C++ mode refuses
to cast void*(*)[] to void*.

The code is compiled without errors in gcc, intel compiler and comeau.

$ cat bug.c
extern void* x[];
void* dummy[] = { &x };
$ gcc -x c -c bug.c
$ gcc -x c++ -c bug.c
$ clang -x c -c bug.c
$ clang -x c++ -c bug.c
bug.c:2:19: error: cannot initialize an array element of type 'void *'
with an
      rvalue of type 'void *(*)[]'
void* dummy[] = { &x };
1 error generated.

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