public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97051] New: Evaluating is_constant_evaluated in requires clause fails
@ 2020-09-15  1:22 david at doublewise dot net
  2020-09-15  1:46 ` [Bug c++/97051] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: david at doublewise dot net @ 2020-09-15  1:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97051
           Summary: Evaluating is_constant_evaluated in requires clause
                    fails
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: david at doublewise dot net
  Target Milestone: ---

The following program



#include <type_traits>

template<typename>
        requires((std::is_constant_evaluated(), true))
constexpr int a = 0;

constexpr int b = a<int>;



when compiled with `g++ -std=c++20` fails with



<source>:9:19: error: use of invalid variable template 'a<int>'

    9 | constexpr int b = a<int>;

      |                   ^~~~~~

<source>:9:19: note: constraints not satisfied

Compiler returned: 1




See it live: https://godbolt.org/z/fc5cWE

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

end of thread, other threads:[~2021-05-20 14:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15  1:22 [Bug c++/97051] New: Evaluating is_constant_evaluated in requires clause fails david at doublewise dot net
2020-09-15  1:46 ` [Bug c++/97051] " mpolacek at gcc dot gnu.org
2020-09-15  1:48 ` mpolacek at gcc dot gnu.org
2020-09-17 14:13 ` ppalka at gcc dot gnu.org
2020-09-19 15:18 ` cvs-commit at gcc dot gnu.org
2021-04-21 15:59 ` cvs-commit at gcc dot gnu.org
2021-04-21 16:00 ` ppalka at gcc dot gnu.org
2021-05-20 14:22 ` 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).