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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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

Reply via email to