[LLVMbugs] [Bug 20178] New: clang-cl doesn't forward declare a struct when it first sees it in the list of arguments in C mode

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 1 08:34:20 PDT 2014


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

            Bug ID: 20178
           Summary: clang-cl doesn't forward declare a struct when it
                    first sees it in the list of arguments in C mode
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ehsan at mozilla.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

$ cat test.c
void f(struct foo*);
struct foo { int x; };
void f(struct foo* f) {}

$ cl -c test.c

$ clang-cl -c test.c
test.c(1,15) :  warning: declaration of 'struct foo' will not be visible
outside of this function [-Wvisibility]
void f(struct foo*);
              ^
test.c(3,6) :  error: conflicting types for 'f'
void f(struct foo* f) {}
     ^
test.c(1,6) :  note: previous declaration is here
void f(struct foo*);
     ^
1 warning and 1 error generated.

clang-cl accepts this program in C++ mode.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140701/adba1d1f/attachment.html>


More information about the llvm-bugs mailing list