https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92580
Bug ID: 92580 Summary: "if constexpr" not discarding branch Product: gcc Version: 9.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: paultargosz86 at googlemail dot com Target Milestone: --- "if constexpr" uses std::is_same to check type. depending on the type its using different if-branches, that can have or have not member variables. The "discarded Branch" tries to use nonexistent membervariables and fails therefore. https://godbolt.org/z/jw_BAy differentiation: Bug 85689 is static_assert that is not proposed in "if constexpr" e.g. wg21.link/p0292