diff options
| author | George Burgess IV <george.burgess.iv@gmail.com> | 2016-07-21 03:28:13 +0000 |
|---|---|---|
| committer | George Burgess IV <george.burgess.iv@gmail.com> | 2016-07-21 03:28:13 +0000 |
| commit | 92b43a462e141fac169a162616f464000633cece (patch) | |
| tree | c062a54909113e4dcee4b6a59a002f7bef8fd77c /clang/test/SemaCXX/atomic-ops.cpp | |
| parent | 7efa5e4b5f61b822dfcd52b7220c209b8044ca1d (diff) | |
| download | bcm5719-llvm-92b43a462e141fac169a162616f464000633cece.tar.gz bcm5719-llvm-92b43a462e141fac169a162616f464000633cece.zip | |
[Sema] Fix PR28623.
In atomic builtins, we assumed that the LValue conversion on the first
argument would succeed. So, we would crash given code like:
```
void ovl(char);
void ovl(int);
__atomic_store_n(ovl, 0, 0);
```
This patch makes us not assume that said conversion is successful. :)
llvm-svn: 276232
Diffstat (limited to 'clang/test/SemaCXX/atomic-ops.cpp')
| -rw-r--r-- | clang/test/SemaCXX/atomic-ops.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/atomic-ops.cpp b/clang/test/SemaCXX/atomic-ops.cpp new file mode 100644 index 00000000000..213161364f5 --- /dev/null +++ b/clang/test/SemaCXX/atomic-ops.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 %s -verify -fsyntax-only -triple=i686-linux-gnu -std=c++11 + +// We crashed when we couldn't properly convert the first arg of __atomic_* to +// an lvalue. +void PR28623() { + void helper(int); // expected-note{{target}} + void helper(char); // expected-note{{target}} + __atomic_store_n(helper, 0, 0); // expected-error{{reference to overloaded function could not be resolved}} +} |

