public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98486] New: Variable template specialization doesn't account for primary's constraints
@ 2020-12-31 6:57 johelegp at gmail dot com
2021-07-22 14:08 ` [Bug c++/98486] " redi at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: johelegp at gmail dot com @ 2020-12-31 6:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98486
Bug ID: 98486
Summary: Variable template specialization doesn't account for
primary's constraints
Product: gcc
Version: 11.0
URL: https://godbolt.org/z/jon9ea
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: johelegp at gmail dot com
Target Milestone: ---
See https://godbolt.org/z/jon9ea.
```C++
template<class>concept C=false;
template<C>int v;
struct X{};
template<>X v<X>;
```
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/98486] Variable template specialization doesn't account for primary's constraints
2020-12-31 6:57 [Bug c++/98486] New: Variable template specialization doesn't account for primary's constraints johelegp at gmail dot com
@ 2021-07-22 14:08 ` redi at gcc dot gnu.org
2021-09-15 18:20 ` ppalka at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2021-07-22 14:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98486
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2021-07-22
Ever confirmed|0 |1
Blocks| |67491
Status|UNCONFIRMED |NEW
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
[Bug 67491] [meta-bug] concepts issues
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/98486] Variable template specialization doesn't account for primary's constraints
2020-12-31 6:57 [Bug c++/98486] New: Variable template specialization doesn't account for primary's constraints johelegp at gmail dot com
2021-07-22 14:08 ` [Bug c++/98486] " redi at gcc dot gnu.org
@ 2021-09-15 18:20 ` ppalka at gcc dot gnu.org
2021-09-16 19:04 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-09-15 18:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98486
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.3
CC| |ppalka at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/98486] Variable template specialization doesn't account for primary's constraints
2020-12-31 6:57 [Bug c++/98486] New: Variable template specialization doesn't account for primary's constraints johelegp at gmail dot com
2021-07-22 14:08 ` [Bug c++/98486] " redi at gcc dot gnu.org
2021-09-15 18:20 ` ppalka at gcc dot gnu.org
@ 2021-09-16 19:04 ` cvs-commit at gcc dot gnu.org
2021-10-06 14:15 ` cvs-commit at gcc dot gnu.org
2021-10-06 14:18 ` ppalka at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-16 19:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98486
--- Comment #1 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:2e2e65a46d2674bed53afd211493876ee2b79453
commit r12-3585-g2e2e65a46d2674bed53afd211493876ee2b79453
Author: Patrick Palka <ppalka@redhat.com>
Date: Thu Sep 16 15:03:55 2021 -0400
c++: constrained variable template issues [PR98486]
This fixes some issues with constrained variable templates:
- Constraints aren't checked when explicitly specializing a variable
template.
- Constraints aren't attached to a static data member template at
parse time.
- Constraints don't get propagated when (partially) instantiating a
static data member template, so we need to make sure to look up
constraints using the most general template during satisfaction.
PR c++/98486
gcc/cp/ChangeLog:
* constraint.cc (get_normalized_constraints_from_decl): Always
look up constraints using the most general template.
* decl.c (grokdeclarator): Set constraints on a static data
member template.
* pt.c (determine_specialization): Check constraints on a
variable template.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-var-templ1.C: New test.
* g++.dg/cpp2a/concepts-var-templ1a.C: New test.
* g++.dg/cpp2a/concepts-var-templ1b.C: New test.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/98486] Variable template specialization doesn't account for primary's constraints
2020-12-31 6:57 [Bug c++/98486] New: Variable template specialization doesn't account for primary's constraints johelegp at gmail dot com
` (2 preceding siblings ...)
2021-09-16 19:04 ` cvs-commit at gcc dot gnu.org
@ 2021-10-06 14:15 ` cvs-commit at gcc dot gnu.org
2021-10-06 14:18 ` ppalka at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-06 14:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98486
--- Comment #2 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:729cf2ea979f396e706625b1669087d5920b8c2a
commit r11-9081-g729cf2ea979f396e706625b1669087d5920b8c2a
Author: Patrick Palka <ppalka@redhat.com>
Date: Thu Sep 16 15:03:55 2021 -0400
c++: constrained variable template issues [PR98486]
This fixes some issues with constrained variable templates:
- Constraints aren't checked when explicitly specializing a variable
template.
- Constraints aren't attached to a static data member template at
parse time.
- Constraints don't get propagated when (partially) instantiating a
static data member template, so we need to make sure to look up
constraints using the most general template during satisfaction.
PR c++/98486
gcc/cp/ChangeLog:
* constraint.cc (get_normalized_constraints_from_decl): Always
look up constraints using the most general template.
* decl.c (grokdeclarator): Set constraints on a static data
member template.
* pt.c (determine_specialization): Check constraints on a
variable template.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-var-templ1.C: New test.
* g++.dg/cpp2a/concepts-var-templ1a.C: New test.
* g++.dg/cpp2a/concepts-var-templ1b.C: New test.
(cherry picked from commit 2e2e65a46d2674bed53afd211493876ee2b79453)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/98486] Variable template specialization doesn't account for primary's constraints
2020-12-31 6:57 [Bug c++/98486] New: Variable template specialization doesn't account for primary's constraints johelegp at gmail dot com
` (3 preceding siblings ...)
2021-10-06 14:15 ` cvs-commit at gcc dot gnu.org
@ 2021-10-06 14:18 ` ppalka at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-10-06 14:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98486
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.3 and 12.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-10-06 14:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-31 6:57 [Bug c++/98486] New: Variable template specialization doesn't account for primary's constraints johelegp at gmail dot com
2021-07-22 14:08 ` [Bug c++/98486] " redi at gcc dot gnu.org
2021-09-15 18:20 ` ppalka at gcc dot gnu.org
2021-09-16 19:04 ` cvs-commit at gcc dot gnu.org
2021-10-06 14:15 ` cvs-commit at gcc dot gnu.org
2021-10-06 14:18 ` 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).