public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause
@ 2022-02-06 17:20 oliver.rosten at googlemail dot com
2022-02-06 23:36 ` [Bug c++/104410] [11/12 Regression] " pinskia at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: oliver.rosten at googlemail dot com @ 2022-02-06 17:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104410
Bug ID: 104410
Summary: Internal error using default-initialized constexpr
bool in requires clause
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: oliver.rosten at googlemail dot com
Target Milestone: ---
#include <type_traits>
template<class T>
constexpr bool use_func_v{};
// Using this instead is fine!
//template<class T>
//constexpr bool use_func_v{false};
struct func_obj
{
template<class T>
requires use_func_v<T>
void operator()(T, T) const
{}
};
constexpr bool bar{std::is_invocable_v<func_obj, char, char>};
----> internal error, see
https://godbolt.org/z/qsbPYq67a
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/104410] [11/12 Regression] Internal error using default-initialized constexpr bool in requires clause
2022-02-06 17:20 [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause oliver.rosten at googlemail dot com
@ 2022-02-06 23:36 ` pinskia at gcc dot gnu.org
2022-02-06 23:39 ` pinskia at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-06 23:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104410
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |11.1.0, 11.2.0
Keywords| |ice-on-valid-code
Target Milestone|--- |11.3
Summary|Internal error using |[11/12 Regression] Internal
|default-initialized |error using
|constexpr bool in requires |default-initialized
|clause |constexpr bool in requires
| |clause
Known to work| |10.3.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/104410] [11/12 Regression] Internal error using default-initialized constexpr bool in requires clause
2022-02-06 17:20 [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause oliver.rosten at googlemail dot com
2022-02-06 23:36 ` [Bug c++/104410] [11/12 Regression] " pinskia at gcc dot gnu.org
@ 2022-02-06 23:39 ` pinskia at gcc dot gnu.org
2022-02-06 23:53 ` pinskia at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-06 23:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104410
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Last reconfirmed| |2022-02-06
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Self contained example (without the include):
template<class T>
constexpr bool use_func_v{};
struct func_obj
{
template<class T>
requires use_func_v<T>
void operator()(T, T) const
{}
};
template <typename t, typename ...args>
concept tt = requires {t{}(args{}...);};
constexpr bool bar{tt<func_obj, char, char>};
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/104410] [11/12 Regression] Internal error using default-initialized constexpr bool in requires clause
2022-02-06 17:20 [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause oliver.rosten at googlemail dot com
2022-02-06 23:36 ` [Bug c++/104410] [11/12 Regression] " pinskia at gcc dot gnu.org
2022-02-06 23:39 ` pinskia at gcc dot gnu.org
@ 2022-02-06 23:53 ` pinskia at gcc dot gnu.org
2022-02-07 8:56 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-02-06 23:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104410
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
here is slightly more reduced:
constexpr bool use_func_v{};
struct func_obj
{
template<class T> requires use_func_v
void operator()(T);
};
template <typename t, typename ...args>
concept tt = requires {t{}(args{}...);};
constexpr bool bar{tt<func_obj, char>};
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/104410] [11/12 Regression] Internal error using default-initialized constexpr bool in requires clause
2022-02-06 17:20 [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause oliver.rosten at googlemail dot com
` (2 preceding siblings ...)
2022-02-06 23:53 ` pinskia at gcc dot gnu.org
@ 2022-02-07 8:56 ` rguenth at gcc dot gnu.org
2022-02-07 14:31 ` ppalka at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-02-07 8:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104410
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/104410] [11/12 Regression] Internal error using default-initialized constexpr bool in requires clause
2022-02-06 17:20 [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause oliver.rosten at googlemail dot com
` (3 preceding siblings ...)
2022-02-07 8:56 ` rguenth at gcc dot gnu.org
@ 2022-02-07 14:31 ` ppalka at gcc dot gnu.org
2022-02-08 14:12 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-02-07 14:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104410
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|needs-bisection |
CC| |ppalka at gcc dot gnu.org
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Started with r11-6321. I suppose the underlying problem is that the assert in
satisfaction_value should is too strict, it should be relaxed to accept
cv-qualified bool.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/104410] [11/12 Regression] Internal error using default-initialized constexpr bool in requires clause
2022-02-06 17:20 [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause oliver.rosten at googlemail dot com
` (4 preceding siblings ...)
2022-02-07 14:31 ` ppalka at gcc dot gnu.org
@ 2022-02-08 14:12 ` cvs-commit at gcc dot gnu.org
2022-02-08 14:13 ` [Bug c++/104410] [11 " ppalka at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-08 14:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104410
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:7ff201d85fad11ba6365a5612124b75b385a97bd
commit r12-7103-g7ff201d85fad11ba6365a5612124b75b385a97bd
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue Feb 8 09:11:29 2022 -0500
c++: satisfaction value of type const bool [PR104410]
Here constant evaluation of the atomic constraint use_func_v<T>
sensibly yields an INTEGER_CST of type const bool, but the assert in
satisfaction_value expects unqualified bool. So let's just relax the
assert to accept cv-qualified bool.
PR c++/104410
gcc/cp/ChangeLog:
* constraint.cc (satisfaction_value): Relax assert to accept
cv-qualified bool.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-pr104410.C: New test.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/104410] [11 Regression] Internal error using default-initialized constexpr bool in requires clause
2022-02-06 17:20 [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause oliver.rosten at googlemail dot com
` (5 preceding siblings ...)
2022-02-08 14:12 ` cvs-commit at gcc dot gnu.org
@ 2022-02-08 14:13 ` ppalka at gcc dot gnu.org
2022-02-08 17:33 ` cvs-commit at gcc dot gnu.org
2022-02-08 17:58 ` ppalka at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-02-08 14:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104410
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[11/12 Regression] Internal |[11 Regression] Internal
|error using |error using
|default-initialized |default-initialized
|constexpr bool in requires |constexpr bool in requires
|clause |clause
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 12 so far.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/104410] [11 Regression] Internal error using default-initialized constexpr bool in requires clause
2022-02-06 17:20 [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause oliver.rosten at googlemail dot com
` (6 preceding siblings ...)
2022-02-08 14:13 ` [Bug c++/104410] [11 " ppalka at gcc dot gnu.org
@ 2022-02-08 17:33 ` cvs-commit at gcc dot gnu.org
2022-02-08 17:58 ` ppalka at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-08 17:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104410
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:411db3b4cf8655ecb5b7d666318546c73f2d156b
commit r11-9544-g411db3b4cf8655ecb5b7d666318546c73f2d156b
Author: Patrick Palka <ppalka@redhat.com>
Date: Tue Feb 8 09:11:29 2022 -0500
c++: satisfaction value of type const bool [PR104410]
Here constant evaluation of the atomic constraint use_func_v<T>
sensibly yields an INTEGER_CST of type const bool, but the assert in
satisfaction_value expects unqualified bool. So let's just relax the
assert to accept cv-qualified bool.
PR c++/104410
gcc/cp/ChangeLog:
* constraint.cc (satisfaction_value): Relax assert to accept
cv-qualified bool.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-pr104410.C: New test.
(cherry picked from commit 7ff201d85fad11ba6365a5612124b75b385a97bd)
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/104410] [11 Regression] Internal error using default-initialized constexpr bool in requires clause
2022-02-06 17:20 [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause oliver.rosten at googlemail dot com
` (7 preceding siblings ...)
2022-02-08 17:33 ` cvs-commit at gcc dot gnu.org
@ 2022-02-08 17:58 ` ppalka at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-02-08 17:58 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104410
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #7 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.3/12.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2022-02-08 17:58 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-06 17:20 [Bug c++/104410] New: Internal error using default-initialized constexpr bool in requires clause oliver.rosten at googlemail dot com
2022-02-06 23:36 ` [Bug c++/104410] [11/12 Regression] " pinskia at gcc dot gnu.org
2022-02-06 23:39 ` pinskia at gcc dot gnu.org
2022-02-06 23:53 ` pinskia at gcc dot gnu.org
2022-02-07 8:56 ` rguenth at gcc dot gnu.org
2022-02-07 14:31 ` ppalka at gcc dot gnu.org
2022-02-08 14:12 ` cvs-commit at gcc dot gnu.org
2022-02-08 14:13 ` [Bug c++/104410] [11 " ppalka at gcc dot gnu.org
2022-02-08 17:33 ` cvs-commit at gcc dot gnu.org
2022-02-08 17:58 ` 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).