https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86703

Nicolas Lesser <blitzrakete at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |blitzrakete at gmail dot com

--- Comment #1 from Nicolas Lesser <blitzrakete at gmail dot com> ---
Here's another reduce example.:

struct X {};
template <auto> using Auto = X;

template <typename T> constexpr Auto<(T(), 0)> match() { return {}; }
X x = match<int>();

Without ", 0" the example compiles. Error message:

main.cpp:5:18: error: no matching function for call to ‘match<int>()’
 X x = match<int>();
                  ^
main.cpp:4:48: note: candidate: ‘template<class T> constexpr Auto<(T(), 0)>
match()’
 template <typename T> constexpr Auto<(T(), 0)> match() { return {}; }
                                                ^~~~~
main.cpp:4:48: note:   template argument deduction/substitution failed:
main.cpp: In substitution of ‘template<auto <anonymous> > using Auto = X [with
auto <anonymous> = ((void)0, 0)]’:
main.cpp:4:48:   required by substitution of ‘template<class T> constexpr
Auto<(T(), 0)> match() [with T = int]’
main.cpp:5:18:   required from here
main.cpp:4:48: error: integral expression ‘((void)0, 0)’ is not constant
main.cpp:4:48: error:   trying to instantiate ‘template<auto <anonymous> >
using Auto = X’

Reply via email to