[LLVMbugs] [Bug 24297] New: Clang accepts program with ill-formed enum syntax.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 29 05:37:12 PDT 2015


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

            Bug ID: 24297
           Summary: Clang accepts program with ill-formed enum syntax.
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anders.granlund.0 at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Consider the following program (prog.cc):

  enum struct E a;
  enum class F b;
  enum G : int c;
  enum struct H : int d;
  enum class I : int e;
  int main() {}

Compile the program with the following command line:

  clang++ prog.cc -std=c++14 -pedantic-errors

No error messages are given. This was not expected since the program is
ill-formed. 

For comparison GCC does not accept the program.

Note that if this was intended as a compiler extension, it doesn't even work
well as such. Try for example to make c, d or e pointers.

-- 
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/20150729/9516ef9a/attachment.html>


More information about the llvm-bugs mailing list