https://bugs.llvm.org/show_bug.cgi?id=39925
Bug ID: 39925
Summary: struct definition leaks out of function prototype
scope
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
The following C11 program (prog.c) should compile without error:
struct T;
void f(
struct S {
struct T {
int a;
} *b;
}
);
struct T {
int c;
};
int main()
{
}
When I compile it with clang prog.c -std=c11 -pedantic-errors "-w" i get the
following unexpected error:
error: redefinition of 'T'
This is wrong since the struct definition inside the function declaration has
function prototype scope and therefore should be independent of the struct
definition in the file scope.
Online compiler link:
https://wandbox.org/permlink/UpaD0znT5jkohSNP
Note that gcc does not give any errors.
--
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