https://bugs.llvm.org/show_bug.cgi?id=45726
Bug ID: 45726
Summary: _Generic selection failed to compile with enum
Product: clang
Version: 10.0
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C
Assignee: unassignedclangb...@nondot.org
Reporter: rajendra...@gmail.com
CC: blitzrak...@gmail.com, dgre...@apple.com,
erik.pilking...@gmail.com, llvm-bugs@lists.llvm.org,
richard-l...@metafoo.co.uk
Created attachment 23419
--> https://bugs.llvm.org/attachment.cgi?id=23419&action=edit
C program with _Generic selection failed to compile with enum
$ clang --version
clang version 10.0.0
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang -o /tmp/test /tmp/test.c
/tmp/test.c:41:35: error: unknown type name 'CheckBegin'
printf("Check %d: %s\n", start, checkEnum(start)? "Yes" : "No");
^
/tmp/test.c:29:34: note: expanded from macro 'checkEnum'
enum Begin : CheckBegin, \
^
/tmp/test.c:41:35: error: expected ':'
/tmp/test.c:29:44: note: expanded from macro 'checkEnum'
enum Begin : CheckBegin, \
^
/tmp/test.c:42:34: error: unknown type name 'CheckBegin'
printf("Check %d: %s\n", stop, checkEnum(stop)? "Yes" : "No");
^
/tmp/test.c:29:34: note: expanded from macro 'checkEnum'
enum Begin : CheckBegin, \
^
/tmp/test.c:42:34: error: expected ':'
/tmp/test.c:29:44: note: expanded from macro 'checkEnum'
enum Begin : CheckBegin, \
^
/tmp/test.c:43:32: error: unknown type name 'CheckBegin'
printf("Check %d: %s\n", na, checkEnum(na)? "Yes" : "No");
^
/tmp/test.c:29:34: note: expanded from macro 'checkEnum'
enum Begin : CheckBegin, \
^
/tmp/test.c:43:32: error: expected ':'
/tmp/test.c:29:44: note: expanded from macro 'checkEnum'
enum Begin : CheckBegin, \
^
6 errors generated.
No errors with clang-7
$ clang --version
Juniper clang version 7.0.1
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang -o /tmp/test /tmp/test.c
<no-compilation-errors>
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs