diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-10-30 02:02:49 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-10-30 02:02:49 +0000 |
commit | d2e69dfddbed3dccc7926cdf01e6aa32f47a0570 (patch) | |
tree | 19f42d86224a092777aab4fb1f18186668d7f54f /clang/test/CXX/drs/dr21xx.cpp | |
parent | 2f3e8b3d2e4c8679d891568ddc7b6fc73d19c4aa (diff) | |
download | bcm5719-llvm-d2e69dfddbed3dccc7926cdf01e6aa32f47a0570.tar.gz bcm5719-llvm-d2e69dfddbed3dccc7926cdf01e6aa32f47a0570.zip |
PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type
nullptr_t does not access memory.
We now reuse CK_NullToPointer to represent a conversion from a glvalue
of type nullptr_t to a prvalue of nullptr_t where necessary.
llvm-svn: 345562
Diffstat (limited to 'clang/test/CXX/drs/dr21xx.cpp')
-rw-r--r-- | clang/test/CXX/drs/dr21xx.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/CXX/drs/dr21xx.cpp b/clang/test/CXX/drs/dr21xx.cpp index 2522ff7dbde..b111529b09f 100644 --- a/clang/test/CXX/drs/dr21xx.cpp +++ b/clang/test/CXX/drs/dr21xx.cpp @@ -19,6 +19,16 @@ namespace dr2120 { // dr2120: 7 static_assert(!__is_standard_layout(E), ""); } +namespace dr2140 { // dr2140: 8 +#if __cplusplus >= 201103L + union U { int a; decltype(nullptr) b; }; + constexpr int *test(U u) { + return u.b; + } + static_assert(!test({123}), "u.b should be valid even when b is inactive"); +#endif +} + namespace dr2180 { // dr2180: yes class A { A &operator=(const A &); // expected-note 0-2{{here}} |