Hi. This has appeared within the last four weeks or so. It seems that not all operators are affected as e.g. alignof(...) works just fine in the same context. Maybe this has something do with the sizeof(...) internals rather than non-type template parameters / arguments? $ cat ntta__sizeof.cpp template < auto a0 > void f0() { } void f0_call() { f0< sizeof(int) >(); } $ g++.exe -Wall -Wextra -std=c++17 -fconcepts -c ntta__sizeof.cpp ntta__sizeof.cpp: In function 'void f0_call()': ntta__sizeof.cpp:3:36: error: no matching function for call to 'f0<sizeof (int)>()' 3 | void f0_call() { f0< sizeof(int) >(); } | ^ ntta__sizeof.cpp:2:6: note: candidate: 'template<auto a0> void f0()' 2 | void f0() { } | ^~ ntta__sizeof.cpp:2:6: note: template argument deduction/substitution failed: ntta__sizeof.cpp: In substitution of 'template<auto a0> void f0() [with auto a0 = sizeof (int)]': ntta__sizeof.cpp:3:36: required from here ntta__sizeof.cpp:3:36: error: integral expression 'sizeof (int)' is not constant 3 | void f0_call() { f0< sizeof(int) >(); } | ^ ntta__sizeof.cpp:3:36: error: trying to instantiate 'template<auto a0> void f0()'
Author: jason Date: Fri Apr 5 02:50:52 2019 New Revision: 270160 URL: https://gcc.gnu.org/viewcvs?rev=270160&root=gcc&view=rev Log: PR c++/89966 - error with non-type auto tparm. My patch for PR 86932 broke this testcase by passing tf_partial to coerce_template_template_parms, which prevented do_auto_deduction from actually replacing the auto. * pt.c (do_auto_deduction): Clear tf_partial. Added: trunk/gcc/testsuite/g++.dg/cpp1z/nontype-auto15.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c
Fixed.