public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/88162] GCC does not accept non-type template parameters of class type
       [not found] <bug-88162-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-23  2:13 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: pinskia at gcc dot gnu.org @ 2021-08-23  2:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
ICC also rejects this at both -std=c++17 and -std=c++20:
<source>(15): error: a nontype template parameter may not have class type
  template<template<auto> class T> using nttp_t = typename decltype(
f(T<zero>()) )::type;
                                                                         ^

<source>(15): error: no instance of function template "f" matches the argument
list
            argument types are: (int_constant<<error-constant>>)
  template<template<auto> class T> using nttp_t = typename decltype(
f(T<zero>()) )::type;
                                                                     ^
<source>(6): note: this candidate was rejected because at least one template
argument could not be deduced
  template<auto X, template<auto> class T> id<decltype(X)> f( T<X> )
                                                           ^
          detected during instantiation of type "nttp_t<int_constant>" at line
22

<source>(15): error: no instance of function template "f" matches the argument
list
            argument types are: (char_constant<<error-constant>>)
  template<template<auto> class T> using nttp_t = typename decltype(
f(T<zero>()) )::type;
                                                                     ^
<source>(6): note: this candidate was rejected because at least one template
argument could not be deduced
  template<auto X, template<auto> class T> id<decltype(X)> f( T<X> )
                                                           ^
          detected during instantiation of type "nttp_t<char_constant>" at line
22

<source>(15): error: no instance of function template "f" matches the argument
list
            argument types are: (long_constant<<error-constant>>)
  template<template<auto> class T> using nttp_t = typename decltype(
f(T<zero>()) )::type;
                                                                     ^
<source>(6): note: this candidate was rejected because at least one template
argument could not be deduced
  template<auto X, template<auto> class T> id<decltype(X)> f( T<X> )
                                                           ^
          detected during instantiation of type "nttp_t<long_constant>" at line
22

<source>(15): error: no instance of function template "f" matches the argument
list
            argument types are: (voidp_constant<<error-constant>>)
  template<template<auto> class T> using nttp_t = typename decltype(
f(T<zero>()) )::type;
                                                                     ^
<source>(6): note: this candidate was rejected because at least one template
argument could not be deduced
  template<auto X, template<auto> class T> id<decltype(X)> f( T<X> )
                                                           ^
          detected during instantiation of type "nttp_t<voidp_constant>" at
line 22

compilation aborted for <source> (code 2)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-23  2:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-88162-4@http.gcc.gnu.org/bugzilla/>
2021-08-23  2:13 ` [Bug c++/88162] GCC does not accept non-type template parameters of class type pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).