[llvm-bugs] [Bug 39930] New: Clang thinks that C11 program does not declare anything but it does.

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 9 07:53:36 PST 2018


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

            Bug ID: 39930
           Summary: Clang thinks that C11 program does not declare
                    anything but it does.
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anders.granlund.0 at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Consider the following C11 program (prog.c):

  int main()
  {
    struct { enum { a } b; };
  }

This program does NOT violate rule 6.7.2 in the C11 standard since the
declaration declares a member of an enum (a).

I tried to compile it with the following command line:

  clang prog.c -std=c11 -pedantic-errors "-w"

I get the following unexpected error message:

  error: declaration does not declare anything

This is wrong. The declaration does declare the enum member  a  and according
to the C11 standard it does not need to declare anything else.

Link to online compiler:

  https://wandbox.org/permlink/faE68OsNgwxxizMs

-- 
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/20181209/8cba33f1/attachment.html>


More information about the llvm-bugs mailing list