Douglas Gregor | bbcb7ea | 2011-09-09 16:51:10 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Douglas Gregor | bbcb7ea | 2011-09-09 16:51:10 +0000 | [diff] [blame] | 3 | |
| 4 | // PR8345 |
| 5 | template<typename T> T f(T* value) { |
| 6 | return __sync_add_and_fetch(value, 1); |
| 7 | } |
| 8 | int g(long long* x) { return f(x); } |
| 9 | int g(int* x) { return f(x); } |
Douglas Gregor | 5b0c519 | 2011-11-08 19:45:38 +0000 | [diff] [blame] | 10 | |
| 11 | namespace PR11320 { |
| 12 | template<typename T> |
| 13 | void g(unsigned *x) { |
| 14 | __sync_bool_compare_and_swap(x, 1, 4); |
| 15 | } |
| 16 | void h() { g<int>(0); } |
| 17 | } |