All challenges
Multiple ChoiceHard 45s

if constexpr discarded branch syntax

In a template, inside if constexpr(false) { x.member_that_does_not_exist(); } where false is value-dependent, is this ill-formed?
Options
  1. 1Yes, both branches of every if constexpr are always instantiated and type-checked regardless of the value
  2. 2No—the discarded statement is not instantiated when value-dependent and false, but it must still be syntactically valid
  3. 3Yes, unless the discarded branch is additionally wrapped in a preprocessor #if guard that removes it
  4. 4No—the discarded branch is completely ignored, including its syntax and any invalid member names inside it

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle