-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Labels
clang:bytecodeIssues for the clang bytecode constexpr interpreterIssues for the clang bytecode constexpr interpreter
Description
Reproducer:
https://godbolt.org/z/7j8YTGGM9
template <typename T> constexpr inline T *addressof(T &x) noexcept {
return __builtin_addressof(x);
}
struct T {
static T tt;
constexpr T() : p(addressof(tt)) {}
constexpr T *operator&() const { return p; }
T *p;
};
constexpr T t;
T T::tt;
static_assert(&t == __builtin_addressof(T::tt), "");
static_assert(&t == addressof(T::tt), "");When the above program is compiled with option -fexperimental-new-constant-interpreter enabled, it fails. When the option is disabled, it succeeds as expected.
Metadata
Metadata
Assignees
Labels
clang:bytecodeIssues for the clang bytecode constexpr interpreterIssues for the clang bytecode constexpr interpreter