aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-09-09 16:51:10 +0000
committerDouglas Gregor <dgregor@apple.com>2011-09-09 16:51:10 +0000
commitbbcb7ea8a062a8f1d5cb504e4518a5d4fbab873a (patch)
tree8ce1dc6a5b845b22a92e4e529f3343013b8a6458 /test
parent99107ebc0a5aea953b736e12757e0919d5249d43 (diff)
When type-checking a call to an overloaded, builtin atomic operation,
construct a new DeclRefExpr rather than re-using the existing DeclRefExpr. Patch by Likai Liu, fixes PR8345. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/SemaTemplate/atomics.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaTemplate/atomics.cpp b/test/SemaTemplate/atomics.cpp
new file mode 100644
index 0000000000..7165bbe591
--- /dev/null
+++ b/test/SemaTemplate/atomics.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// PR8345
+template<typename T> T f(T* value) {
+ return __sync_add_and_fetch(value, 1);
+}
+int g(long long* x) { return f(x); }
+int g(int* x) { return f(x); }