[llvm-bugs] [Bug 24761] New: Clang rejects _Atomic compound assignment for pointer arithmetic

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 9 06:15:25 PDT 2015


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

            Bug ID: 24761
           Summary: Clang rejects _Atomic compound assignment for pointer
                    arithmetic
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hstong at ca.ibm.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

In C11 subclause 6.5.16.2 paragraph 1, an atomic pointer to a complete object
type is a valid LHS operand for operator += when the RHS has integer type.

Clang (trunk r247105) rejects.

### SOURCE (<stdin>):
void foo(int *_Atomic p) {
   p += 1;
}


### COMPILER INVOCATION:
clang -cc1 -x c -std=c11     


### ACTUAL OUTPUT:
<stdin>:2:6: error: invalid operands to binary expression ('_Atomic(int *)' and
'int')
   p += 1;
   ~ ^  ~
1 error generated.


### EXPECTED OUTPUT:
Clean compile.


### COMPILER VERSION INFO (clang -v):
clang version 3.8.0 (trunk)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
InstalledDir: /main_trunk/ubuntu14_leppc/daily/latest/bin
Found candidate GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.3
Selected GCC installation: /usr/lib/gcc/ppc64le-redhat-linux/4.8.3
Candidate multilib: .;@m64
Selected multilib: .;@m64

-- 
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/20150909/80e6afd4/attachment.html>


More information about the llvm-bugs mailing list