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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to