[cfe-dev] Likely the last big bug in C area

Abramo Bagnara abramo.bagnara at gmail.com
Wed Feb 17 23:33:41 PST 2010


I think we have a bug in clang that should be fixed before 2.7.

According to C99 6.2.1p4 the scope of tag declarations, when embedded in
a declarator inside a function parameter list, should be the function
block (this is not true for C++: see 3.3.1p5).

This means that:

void f(struct s *x) {
  struct s { int f; } *y = x;
}

should be legal according to C99 but not legal according to C++.

Clang currently believes that this code is not legal for both.

The bug has already been inserted in bugzilla:

http://llvm.org/bugs/show_bug.cgi?id=6298




More information about the cfe-dev mailing list