diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-08 08:02:07 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-08 08:02:07 +0000 |
| commit | 4051ff765087b456d6cd91f9311b8ffe3309b980 (patch) | |
| tree | 51244ff7ccc469f4f823adf1221d1e925d32d648 /clang/test/CodeGenCXX/const-init-cxx11.cpp | |
| parent | d73a53f1581266882672f0bc82aeac5831cbefae (diff) | |
| download | bcm5719-llvm-4051ff765087b456d6cd91f9311b8ffe3309b980.tar.gz bcm5719-llvm-4051ff765087b456d6cd91f9311b8ffe3309b980.zip | |
Don't forget to evaluate the subexpression in a null pointer cast. If we're
converting from std::nullptr_t, the subexpression might have side-effects.
llvm-svn: 154278
Diffstat (limited to 'clang/test/CodeGenCXX/const-init-cxx11.cpp')
| -rw-r--r-- | clang/test/CodeGenCXX/const-init-cxx11.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/const-init-cxx11.cpp b/clang/test/CodeGenCXX/const-init-cxx11.cpp index c6250c6d966..c745deebf04 100644 --- a/clang/test/CodeGenCXX/const-init-cxx11.cpp +++ b/clang/test/CodeGenCXX/const-init-cxx11.cpp @@ -414,3 +414,12 @@ namespace InitFromConst { consume(a); } } + +namespace Null { + decltype(nullptr) null(); + // CHECK: call {{.*}} @_ZN4Null4nullEv( + int *p = null(); + struct S {}; + // CHECK: call {{.*}} @_ZN4Null4nullEv( + int S::*q = null(); +} |

