[llvm-bugs] [Bug 40249] New: c11: Rejects valid program having cast operator with _Atomic int type

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 7 14:05:03 PST 2019


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

            Bug ID: 40249
           Summary: c11: Rejects valid program having cast operator with
                    _Atomic int type
           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

Test case (prog.c):

  int main()
  {
    (_Atomic int)0;
  }

Compilation command line:

  clang prog.c -Wall -Wextra -std=c11 -pedantic-errors 

Observed beaviour:

  The following error message was outputed:

     error: used type '_Atomic(int)' where arithmetic or pointer type is
            required

Expected behaviour:

  No error message outputed.

  The program is well-formed.

  _Atomic  qualification of the scalar type  int  is allowed here.

  See 6.5.4/2:

  "Unless  the  type  name  specifies  a  void  type,  the  type  name  shall
   specify  atomic,  qualified,  or unqualified scalar type, and the operand
   shall have scalar type."

Note:

  GCC accepts the program without outputing any error message.

-- 
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/20190107/e0e986c5/attachment.html>


More information about the llvm-bugs mailing list