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

Reply via email to