Is a constexpr array necessarily odr-used when subscripted?
问题 Given the following code: struct A { static constexpr int a[3] = {1,2,3}; }; int main () { int a = A::a[0]; int b [A::a[1]]; } is A::a necessarily odr-used in int a = A::a[0] ? Note: This question represents a less flamey/illogical/endless version of a debate in the Lounge. 回答1: First use of A::a : int a = A::a[0]; The initializer is a constant expression, but that doesn't stop A::a from being odr-used here. And, indeed, A::a is odr-used by this expression. Starting from the expression A::a[0