https://bugs.llvm.org/show_bug.cgi?id=38353

            Bug ID: 38353
           Summary: clang fails to diagnose mismatch of enum types in
                    prototype/function
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: zhong...@pku.org.cn
                CC: llvm-bugs@lists.llvm.org

Compile the following code, clang compiles it without error: it
should generate a diagnostic.

enum e1 {a, b};
enum e2 {c, d};

void f(enum e1);

void f(x)
  enum e2 x;
{
  return;
}

Instead, gcc rejects the above code:

gcc code0.c 
code0.c: In function 'f':
code0.c:7:10: error: argument 'x' doesn't match prototype
  enum e2 x;
          ^
code0.c:4:6: error: prototype declaration
 void f(enum e1);
      ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to