https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84325
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> --- If I tweak the testcase like this: struct seconds { int i_{0}; constexpr seconds (int) {} }; template <char... _Digits> constexpr seconds operator""_s() { return seconds(0); } constexpr seconds operator""_s(long double i) { return seconds(0); } template<class TYPE> struct Param { constexpr static inline seconds time_to_wait{10_s}; }; struct Empty {}; Param<Empty> p; then it's accepted by clang++ and ICEs the same. And if I apply this then it's accepted by G++, too: --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -3091,7 +3091,7 @@ replace_placeholders_r (tree* t, int* walk_subtrees, void* data_) replace_placeholders_t *d = static_cast<replace_placeholders_t*>(data_); tree obj = d->obj; - if (TREE_CONSTANT (*t)) + if (!TYPE_P (*t) && TREE_CONSTANT (*t)) { *walk_subtrees = false; return NULL_TREE;