https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88355
--- Comment #2 from Emmanuel Le Trong <emmanuel.le-tr...@cnrs-orleans.fr> --- Ok I got this new snippet showing what is very probably the same bug, although the diagnostic message is not the same at all. (And quite frankly I don't understand it.) $ cat bug_5.cpp struct T {}; template <T> struct U {}; template <T t> void f (U<t>) {} int main () { constexpr T t; f (U<t>{}); } $ g++-9 -std=c++2a -Wall -Wextra bug_5.cpp bug_5.cpp: In function ‘int main()’: bug_5.cpp:12:18: error: no matching function for call to ‘f(U<T()>)’ 12 | f (U<t>{}); | ^ bug_5.cpp:7:10: note: candidate: ‘template<T t> void f(U<((T*)(void)0)->T::__ct_comp (((const T)t))>)’ 7 | void f (U<t>) {} | ^ bug_5.cpp:7:10: note: template argument deduction/substitution failed: bug_5.cpp:12:18: note: couldn't deduce template parameter ‘t’ 12 | f (U<t>{}); | ^ $ g++-9 --verbose Using built-in specs. COLLECT_GCC=g++-9 COLLECT_LTO_WRAPPER=/home/manu/system/opt/gcc-9/libexec/gcc/x86_64-pc-linux-gnu/9.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-9/configure --prefix=/home/manu/system/opt/gcc-9 --program-suffix=-9 : (reconfigured) ../gcc-9/configure --prefix=/home/manu/system/opt/gcc-9 --program-suffix=-9 : (reconfigured) ../gcc-9/configure --prefix=/home/manu/system/opt/gcc-9 --program-suffix=-9 --enable-languages=c,c++,fortran,lto,objc --no-create --no-recursion Thread model: posix gcc version 9.0.1 20190227 (experimental) (GCC)