public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99909] New: The value of 'std::is_integral_v<auto>' is not usable in a constant expression
@ 2021-04-04 18:30 hewillk at gmail dot com
  2021-04-06 18:59 ` [Bug c++/99909] " jason at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: hewillk at gmail dot com @ 2021-04-04 18:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99909
           Summary: The value of 'std::is_integral_v<auto>' is not usable
                    in a constant expression
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/jWr39rrsT

#include <concepts>

template <std::integral auto> 
struct S {};

template <template <std::integral auto> class>
constexpr auto f() {}

int main() {
  f<S>();
}

gcc rejects this code with:

In file included from <source>:1:
/opt/compiler-explorer/gcc-trunk-20210404/include/c++/11.0.1/concepts:102:13:  
required for the satisfaction of 'integral<auto [requires
std::integral<<placeholder>, >]>' [with auto [requires
std::integral<<placeholder>, >] = auto [requires std::integral<<placeholder>,
>]]
/opt/compiler-explorer/gcc-trunk-20210404/include/c++/11.0.1/concepts:102:24:
error: the value of 'std::is_integral_v<auto [requires
std::integral<<placeholder>, >]>' is not usable in a constant expression
  102 |     concept integral = is_integral_v<_Tp>;
      |                        ^~~~~~~~~~~~~~~~~~
In file included from
/opt/compiler-explorer/gcc-trunk-20210404/include/c++/11.0.1/concepts:44,
                 from <source>:1:
/opt/compiler-explorer/gcc-trunk-20210404/include/c++/11.0.1/type_traits: In
function 'int main()':
/opt/compiler-explorer/gcc-trunk-20210404/include/c++/11.0.1/type_traits:3026:25:
note: 'std::is_integral_v<auto [requires std::integral<<placeholder>, >]>' used
in its own initializer
 3026 |   inline constexpr bool is_integral_v = is_integral<_Tp>::value;
      |                         ^~~~~~~~~~~~~

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-28 21:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-04 18:30 [Bug c++/99909] New: The value of 'std::is_integral_v<auto>' is not usable in a constant expression hewillk at gmail dot com
2021-04-06 18:59 ` [Bug c++/99909] " jason at gcc dot gnu.org
2021-06-29 14:23 ` giecrilj at stegny dot 2a.pl
2021-06-29 15:17 ` hewillk at gmail dot com
2021-09-27 19:38 ` ppalka at gcc dot gnu.org
2021-09-28 21:26 ` cvs-commit at gcc dot gnu.org
2021-09-28 21:27 ` ppalka 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).