<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Clang rejects _Atomic compound assignment for pointer arithmetic"
   href="https://llvm.org/bugs/show_bug.cgi?id=24761">24761</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang rejects _Atomic compound assignment for pointer arithmetic
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hstong@ca.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>