[LLVMbugs] [Bug 10982] New: clang weird diagnostic for wrong enums!

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 21 17:12:29 PDT 2011


           Summary: clang weird diagnostic for wrong enums!
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: bruno.cardoso at gmail.com
                CC: llvmbugs at cs.uiuc.edu

Given the following code:

#include <stdio.h>

enum {
  3DNowShift = 0,
  XXX = 1

int main() {
  printf("%d\n", XXX);
  return 0;

Instead of clang reporting that a enum can't start with a number or something
like that, it points "{}" matching error:

$ clang /tmp/bug.c -c
/tmp/bug.c:4:3: error: expected '}'
  3DNowShift = 0,
/tmp/bug.c:3:6: note: to match this '{'
enum {
/tmp/bug.c:9:18: error: use of undeclared identifier 'XXX'
  printf("%d\n", XXX);
2 errors generated.

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