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: unassignedclangb...@nondot.org Reporter: hst...@ca.ibm.com CC: llvm-bugs@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.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs