25 lines · cpp
1// RUN: %clang_cc1 %s -verify -fsyntax-only -triple=i686-linux-gnu -std=c++112 3// We crashed when we couldn't properly convert the first arg of __atomic_* to4// an lvalue.5void PR28623() {6 void helper(int); // expected-note{{target}}7 void helper(char); // expected-note{{target}}8 __atomic_store_n(helper, 0, 0); // expected-error{{reference to overloaded function could not be resolved}}9}10 11template<typename>12struct X {13 char arr[1];14};15 16extern X<void>* p, *q;17 18// They should be accepted.19void f() {20 __atomic_exchange(p, p, q, __ATOMIC_RELAXED);21 __atomic_load(p, p, __ATOMIC_RELAXED);22 __atomic_store(p, p, __ATOMIC_RELAXED);23 __atomic_compare_exchange(p, p, q, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);24}25