[LLVMbugs] [Bug 19810] New: Bogus parsing derivation of enum-base from type-specifier-seq
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue May 20 19:32:45 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=19810
Bug ID: 19810
Summary: Bogus parsing derivation of enum-base from
type-specifier-seq
Product: clang
Version: 3.4
Hardware: Other
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangbugs at nondot.org
Reporter: hstong at ca.ibm.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Source code which parses with C++03 fails when using Clang's implementation of
C++11.
>From the grammar in N3290, it seems an enum-base may only appear before '{' or
';'.
It looks like the Clang parser picked a production which failed and did not
backtrack.
ICC (which does understand enum-base) does not have this problem.
### SOURCE:> cat enumBaseVersusConditional.cc
enum E { E1 };
void foo() {
false ? new enum E : int();
}
Return: 0x00:0
### COMPILER INVOCATION AND OUTPUT:> clang++ -std=c++11
enumBaseVersusConditional.cc -c
enumBaseVersusConditional.cc:3:25: error: non-integral type 'int ()' is an
invalid underlying type
false ? new enum E : int();
^
enumBaseVersusConditional.cc:3:30: error: expected ':'
false ? new enum E : int();
^
:
enumBaseVersusConditional.cc:3:10: note: to match this '?'
false ? new enum E : int();
^
enumBaseVersusConditional.cc:3:30: error: expected expression
false ? new enum E : int();
^
3 errors generated.
Return: 0x01:1
### EXPECTED OUTPUT:> clang++ -std=c++03 enumBaseVersusConditional.cc -c
Return: 0x00:0
### VERSION INFO:> clang++ -v
clang version 3.4
Target: powerpc64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/ppc64-redhat-linux/4.4.4
Found candidate GCC installation: /usr/lib/gcc/ppc64-redhat-linux/4.4.6
Selected GCC installation: /usr/lib/gcc/ppc64-redhat-linux/4.4.6
Return: 0x00:0
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140521/e4b00bd6/attachment.html>
More information about the llvm-bugs
mailing list