public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67117] New: [c++-concepts] Constraints ignored on variable template
@ 2015-08-04 15:25 Casey at Carter dot net
2015-08-05 18:14 ` [Bug c++/67117] " jason at gcc dot gnu.org
2015-08-05 18:15 ` jason at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: Casey at Carter dot net @ 2015-08-04 15:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67117
Bug ID: 67117
Summary: [c++-concepts] Constraints ignored on variable
template
Product: gcc
Version: c++-concepts
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: Casey at Carter dot net
Target Milestone: ---
r226546 fails to compile this TU:
template <class>
requires false
constexpr bool v = true;
template <class>
constexpr bool f() { return true; }
template <class T>
requires v<T>
constexpr bool f() { return false; }
static_assert(f<void>());
with error:
~/concept-gcc/bin/g++ -std=gnu++1z foo.cpp -c
foo.cpp:12:1: error: static assertion failed
static_assert(f<void>());
^
It seems the constraints on the variable template are not checked. Indeed this
TU:
template <class>
requires false
constexpr bool v = true;
static_assert(v<void>);
is accepted without diagnoses.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/67117] [c++-concepts] Constraints ignored on variable template
2015-08-04 15:25 [Bug c++/67117] New: [c++-concepts] Constraints ignored on variable template Casey at Carter dot net
@ 2015-08-05 18:14 ` jason at gcc dot gnu.org
2015-08-05 18:15 ` jason at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2015-08-05 18:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67117
--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Aug 5 18:13:24 2015
New Revision: 226646
URL: https://gcc.gnu.org/viewcvs?rev=226646&root=gcc&view=rev
Log:
PR c++/67117
* decl.c (grokvardecl): Set constraints here.
* pt.c (process_partial_specialization): Not here.
(finish_template_variable): Check constraints.
Added:
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/var-templ1.C
Modified:
branches/c++-concepts/ChangeLog.concepts
branches/c++-concepts/gcc/cp/decl.c
branches/c++-concepts/gcc/cp/pt.c
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/var-concept3.C
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/67117] [c++-concepts] Constraints ignored on variable template
2015-08-04 15:25 [Bug c++/67117] New: [c++-concepts] Constraints ignored on variable template Casey at Carter dot net
2015-08-05 18:14 ` [Bug c++/67117] " jason at gcc dot gnu.org
@ 2015-08-05 18:15 ` jason at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2015-08-05 18:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67117
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-05 18:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-04 15:25 [Bug c++/67117] New: [c++-concepts] Constraints ignored on variable template Casey at Carter dot net
2015-08-05 18:14 ` [Bug c++/67117] " jason at gcc dot gnu.org
2015-08-05 18:15 ` jason 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).