Consider example:
template <char>
struct foo { };
int main() {
foo<""[0]?""[1]:'\0'>{};
}
The code compiles in both [gcc] and [clang], but should it really? I know the expression ""[1] doesn't need to be evaluated as it was short-circuited. But standard isn't very clear if the expression can actually qualify as a core constant expression. Relevant [expr.const]/2 and especially part:
If e satisfies the constraints of a core constant expression, but evaluation of e would evaluate an operation that has undefined behavior as specified in [library] through [thread] of this document, it is unspecified whether e is a core constant expression.
raises my doubts...