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
diff --git a/clang/test/CXX/expr/expr.const/p2-0x.cpp b/clang/test/CXX/expr/expr.const/p2-0x.cpp
index 43d683a..2d4f4fb 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 @@
// 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 @@
struct S {
constexpr S *operator&() { return nullptr; }
};
- constexpr S *q = &s;
+ constexpr S *q = &s; // ok
static_assert(!q, "");
}