[llvm-bugs] [Bug 40171] New: c11: Rejects well-formed program qualifying incomplete object type with _Atomic qualifier.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Dec 28 02:58:16 PST 2018


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

            Bug ID: 40171
           Summary: c11: Rejects well-formed program qualifying incomplete
                    object type with _Atomic qualifier.
           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 struct S *p;
  }

Compilation command line:

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

Observed behaviour:

  The following error message was outputed:

    prog.c:3:5: error: _Atomic cannot be applied to incomplete type 'struct S' 
        _Atomic struct S *p;
        ^
    prog.c:3:20: note: forward declaration of 'struct S'
        _Atomic struct S *p;
                       ^
    1 error generated.

Expected behaviour:

  No error messages outputed.

  I cannot find anything in the standard forbidding qualifying incomplete
object
  types with the _Atomic qualifier. 

Note:

  GCC accepts the program without outputing any error messages.

-- 
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/20181228/94846fa1/attachment.html>


More information about the llvm-bugs mailing list