https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108550
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We get the bogus error because we failed to deduce the auto in
constexpr auto is_pointer_v = is_pointer<Tp>::value;
to bool.
We call do_auto_deduction and type_unification_real correctly deduces targs to
<bool>, but the tsubst at the end of do_auto_deduction doesn't use the bool to
replace arg, which is
(gdb) pt
<template_type_parm 0x7fffea3c6150 auto readonly type_0 type_6 VOID
align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7fffea3c6150
index 0 level 2 orig_level 2>
but levels = TMPL_ARGS_DEPTH (args); is 1, so the
if (level <= levels
block isn't performed, so we don't fetch the bool from args.
It looks like another case where 'auto' has a level that we don't handle
correctly. I think the level for placeholders is created + 1 than the normal
one (at least it used to be), so orig_level 2 is probably correct, but level
should probably have been reduced to 1.
I need to poke more...