https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94644
Bug ID: 94644 Summary: Wrong is_nothrow_move_constructible result if used in a template first Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rafael at espindo dot la Target Milestone: --- Tested with c5bac7d127f288fd2f8a1f15c3f30da5903141c6. Given ----------------------------------------------- #include <type_traits> struct future_state_base { protected: ~future_state_base() noexcept; }; #ifdef foo static_assert(std::is_nothrow_move_constructible<future_state_base>::value, "future_state_base's move constructor must not throw"); #endif template <typename... T> struct future_state : public future_state_base { static_assert(std::is_nothrow_move_constructible<future_state_base>::value, "future_state_base's move constructor must not throw"); }; void f(future_state<int> x) { } ----------------------------------------------- g++ produces no error with just -c, but if I add -Dfoo both static asserts fails. With clang, and libstdc++, I get one or two errors depending on whether -Dfoo is used.