1 // PR c++/51489 2 // DR 1313 3 // { dg-do compile { target c++11 } } 4 5 struct array 6 { arrayarray7 constexpr array() :x(0) {} beginarray8 constexpr int const* begin() const { return &x; } 9 int x; 10 }; 11 constexpr array aa; 12 constexpr auto b = aa.begin(); 13 static_assert(b-b == 0, "compiles just fine"); 14 static_assert(aa.begin()-aa.begin() == 0, "compiler thinks it's not a constant expression"); 15