https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70001
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 37924 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=37924&action=edit gcc6-pr70001.patch So do you mean something like this? The *-2.C testcase is what I believe you've been talking about and indeed Patrick's patch broke that. I'm still wondering if there could be dependency on this even without relocation, but e.g. for: constexpr __UINTPTR_TYPE__ foo (void *p) { return (__UINTPTR_TYPE__) p; } struct X { __UINTPTR_TYPE__ a; constexpr X () : a (foo (this)) { } }; constexpr signed char bar (void *p) { return (signed char) (__UINTPTR_TYPE__) p; } struct Y { signed char a; constexpr Y () : a (bar (this)) { } }; constexpr int N = 1 << 4; struct A { X elems[N]; } F; struct B { Y elems[N]; } G; with (unpatched) g++ F contains relocations and G contains all zeros. clang++ 3.8 rejects both constexpr functions as having reinterpret cast, so maybe that just isn't valid (shall g++ reject that too)?