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

            Bug ID: 40173
           Summary: c11: Rejects well-formed program using . operator on
                    _Atomic struct in unevalueded context.
           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(void)
  {
    _Atomic struct S { int x; } s;
    sizeof (s.x);
  }

Compilation command line:

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

Observed behaviour:

  The following error message was outputed:

    prog.c:4:12: error: member reference base type '_Atomic(struct S)' is not a
      structure or union

    sizeof (s.x);        
            ~^~
    1 error generated.

Expected behaviour:

  No error message outputed.

Note:

  GCC accepts the program with no error message ourputed.

-- 
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