Enum identifier hiding in function prototype scope

I have access to the Plum Hall Validation Suite for C [1], which I have
been using to test a Clang/LLVM backend that I'm developing.

One of the test cases in the suite exercises the identifier scoping
rules set out in section 6.1.2.1 in C90 and 6.2.1 in C99. The tests case
is intended to be conforming code, but Clang rejects it with error
messages.

The code for the test is:

  // test.c
  int iequals(int, int, int);
  int do_nothing1(const volatile void *);
  
  enum eAABB {AA, BB};
  
  static int f(enum {BB, AA} n)
  { iequals(__LINE__, BB, 0); do_nothing1(&n); return BB; }

This is the reported error:

  >clang -S -x c -std=iso9899:1990 -o - test.c
  test.c:6:20: error: redefinition of enumerator 'BB'
  static int f(enum {BB, AA} n)
                     ^
  test.c:4:17: note: previous definition is here
  enum eAABB {AA, BB};
                  ^
  test.c:6:24: error: redefinition of enumerator 'AA'
  static int f(enum {BB, AA} n)
                         ^
  test.c:4:13: note: previous definition is here
  enum eAABB {AA, BB};
              ^
  2 errors generated.

Can any language lawyers comment on whether this is really a
non-conformance against the standards?

-Ken

[1] http://www.plumhall.com/stec.html

Yes, it's a Clang bug. We have numerous problems with definitions in prototype scope. This one is essentially captured by:

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

  - Doug

That bug deals specifically with structs. Would it be worthwhile to
generalize the title to include all identifiers, and add a note about
enums?

-Ken

Yes, please!

  - Doug