diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-10 07:41:06 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-10 07:41:06 +0000 |
commit | 0cd4ab194bed0038463e39cb15a9e5c80f8a7e8f (patch) | |
tree | 37e5e78edd2d6d6b91d0f35dc33a8f2066aefde4 /clang/test/CXX/expr/expr.const | |
parent | 09fc1bb605794d0615e90b07b142fabd576eb3fc (diff) | |
download | bcm5719-llvm-0cd4ab194bed0038463e39cb15a9e5c80f8a7e8f.tar.gz bcm5719-llvm-0cd4ab194bed0038463e39cb15a9e5c80f8a7e8f.zip |
Update to new resolution for DR1458. When taking the address of an object of
incomplete class type which has an overloaded operator&, it's now just
unspecified whether the overloaded operator or the builtin is used.
llvm-svn: 150234
Diffstat (limited to 'clang/test/CXX/expr/expr.const')
-rw-r--r-- | clang/test/CXX/expr/expr.const/p2-0x.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/test/CXX/expr/expr.const/p2-0x.cpp b/clang/test/CXX/expr/expr.const/p2-0x.cpp index 43d683aeca4..2d4f4fb62e6 100644 --- a/clang/test/CXX/expr/expr.const/p2-0x.cpp +++ b/clang/test/CXX/expr/expr.const/p2-0x.cpp @@ -111,9 +111,10 @@ namespace RecursionLimits { // DR1458: taking the address of an object of incomplete class type namespace IncompleteClassTypeAddr { - struct S; // expected-note {{forward}} + struct S; extern S s; - constexpr S *p = &s; // expected-error {{constant expression}} expected-note {{cannot take address of object of incomplete class type 'IncompleteClassTypeAddr::S' in a constant expression}} + constexpr S *p = &s; // ok + static_assert(p, ""); extern S sArr[]; constexpr S (*p2)[] = &sArr; // ok @@ -121,7 +122,7 @@ namespace IncompleteClassTypeAddr { struct S { constexpr S *operator&() { return nullptr; } }; - constexpr S *q = &s; + constexpr S *q = &s; // ok static_assert(!q, ""); } |