[LLVMbugs] [Bug 6298] New: Wrong parsing of record decls in parameters' lists
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Sun Feb 14 08:15:26 PST 2010
http://llvm.org/bugs/show_bug.cgi?id=6298
Summary: Wrong parsing of record decls in parameters' lists
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Semantic Analyzer
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: bagnara at cs.unipr.it
CC: llvmbugs at cs.uiuc.edu
The following testcase shows that clang erroneously "believes" that the scope
of record declarations in parameters' lists extends beyond the block scope and
not inside the block, as the standard mandates.
$ cat bug.c
struct s { int x; };
void f(struct s { int y; }* v) {
}
void g(struct t { int x; } *v) {
struct t { int y; };
}
$ clang bug.c
bug.c:4:15: error: redefinition of 's'
void f(struct s { int y; }* v) {
^
bug.c:2:8: note: previous definition is here
struct s { int x; };
^
bug.c:7:15: warning: declaration of 'struct t' will not be visible outside of
this function
void g(struct t { int x; } *v) {
^
3 diagnostics generated.
$ gcc -c -w bug.c
bug.c: In function 'g':
bug.c:8: error: redefinition of 'struct t'
$
--
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