https://bugs.llvm.org/show_bug.cgi?id=40197
Bug ID: 40197
Summary: c11: Rejects valid program dereferencing pointer with
incomplete reference type.
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: anders.granlun...@gmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk
Test case (prog.c):
struct S *p;
void f(void);
int main()
{
f();
*p;
}
struct S { int x; };
void f()
{
static struct S s = { 0 };
p = &s;
}
Compilation command line:
clang prog.c -Wall -Wextra -std=c11 -pedantic-errors
Observed behaviour:
The following error message was outputed:
prog.c:9:5: error: incomplete type 'struct S' where a complete type is
required
*p;
^
prog.c:1:8: note: forward declaration of 'struct S'
struct S *p;
^
Expected behaviour:
No error message outputed.
I can't find anything in the standard that makes the this program invalid.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs