public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66092] [c++-concepts] Concept can't check variadic template arguments
[not found] <bug-66092-4@http.gcc.gnu.org/bugzilla/>
@ 2015-05-13 20:22 ` yingpo.liao at gmail dot com
2015-05-19 12:23 ` andrew.n.sutton at gmail dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: yingpo.liao at gmail dot com @ 2015-05-13 20:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66092
--- Comment #1 from Ying-Po Liao <yingpo.liao at gmail dot com> ---
Here's another implementation, which results in the same consequence.
template <typename T, typename U, typename... Args>
struct Checker
{
constexpr static decltype(auto) check( std::true_type )
{ return std::integral_constant<bool, __is_same_as(T, U)>(); }
constexpr static decltype(auto) check( std::false_type )
{ return std::integral_constant<bool, __is_same_as(T, U)
&& Checker<U, Args...>::value>(); }
constexpr static bool value = decltype(
check( std::integral_constant<bool, (sizeof...(Args)==0)>() )
)::value;
};
template <typename T, typename U, typename... Args>
concept bool Same()
{
return Checker<T, U, Args...>::value;
}
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/66092] [c++-concepts] Concept can't check variadic template arguments
[not found] <bug-66092-4@http.gcc.gnu.org/bugzilla/>
2015-05-13 20:22 ` [Bug c++/66092] [c++-concepts] Concept can't check variadic template arguments yingpo.liao at gmail dot com
@ 2015-05-19 12:23 ` andrew.n.sutton at gmail dot com
2015-07-10 7:26 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: andrew.n.sutton at gmail dot com @ 2015-05-19 12:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66092
Andrew Sutton <andrew.n.sutton at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |andrew.n.sutton at gmail dot com
--- Comment #2 from Andrew Sutton <andrew.n.sutton at gmail dot com> ---
I think that this should be ill-formed.
template <typename T, typename U, typename... Args>
concept bool Same()
{
return decltype(check<T, U, Args...>())::value;
}
template <typename... Args>
requires Same<Args...>()
void foo( Args... args ) {}
Template constraint processing requires that flatten (inline) the check for
Same<Args...>(), but I don't see how we can substitute a dependent argument
pack into three distinct template parameters (T, U, and ...Args).
The wording prohibiting this is missing in the TS.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/66092] [c++-concepts] Concept can't check variadic template arguments
[not found] <bug-66092-4@http.gcc.gnu.org/bugzilla/>
2015-05-13 20:22 ` [Bug c++/66092] [c++-concepts] Concept can't check variadic template arguments yingpo.liao at gmail dot com
2015-05-19 12:23 ` andrew.n.sutton at gmail dot com
@ 2015-07-10 7:26 ` jason at gcc dot gnu.org
2015-07-14 4:11 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2015-07-10 7:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66092
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Jul 10 07:25:49 2015
New Revision: 225649
URL: https://gcc.gnu.org/viewcvs?rev=225649&root=gcc&view=rev
Log:
PR c++/66092
* gcc/cp/cp-tree.h (concept_template_p): New.
* gcc/cp/pt.c (coerce_template_parms): Concepts are also affected
by DR 1430.
* gcc/cp/constraint.cc (lift_template_id): Use location_of.
* gcc/cp/parser.c (cp_parser_template_id): SET_EXPR_LOCATION.
Added:
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/dr1430.C
Modified:
branches/c++-concepts/ChangeLog.concepts
branches/c++-concepts/gcc/cp/constraint.cc
branches/c++-concepts/gcc/cp/cp-tree.h
branches/c++-concepts/gcc/cp/parser.c
branches/c++-concepts/gcc/cp/pt.c
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/var-concept3.C
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/66092] [c++-concepts] Concept can't check variadic template arguments
[not found] <bug-66092-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2015-07-10 7:26 ` jason at gcc dot gnu.org
@ 2015-07-14 4:11 ` jason at gcc dot gnu.org
2015-07-17 17:43 ` jason at gcc dot gnu.org
2015-08-04 13:36 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2015-07-14 4:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66092
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Jul 14 04:11:11 2015
New Revision: 225758
URL: https://gcc.gnu.org/viewcvs?rev=225758&root=gcc&view=rev
Log:
PR c++/66092
PR c++/66834
* gcc/cp/pt.c (coerce_template_parms): Revert earlier change.
Removed:
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/dr1430.C
Modified:
branches/c++-concepts/ChangeLog.concepts
branches/c++-concepts/gcc/cp/pt.c
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/66092] [c++-concepts] Concept can't check variadic template arguments
[not found] <bug-66092-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2015-07-14 4:11 ` jason at gcc dot gnu.org
@ 2015-07-17 17:43 ` jason at gcc dot gnu.org
2015-08-04 13:36 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2015-07-17 17:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66092
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Jul 17 17:43:09 2015
New Revision: 225959
URL: https://gcc.gnu.org/viewcvs?rev=225959&root=gcc&view=rev
Log:
PR c++/66092
PR c++/66834
* gcc/cp/pt.c (coerce_template_parms): Re-apply earlier change.
Added:
branches/c++-concepts/gcc/testsuite/g++.dg/concepts/dr1430.C
Modified:
branches/c++-concepts/ChangeLog.concepts
branches/c++-concepts/gcc/cp/pt.c
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/66092] [c++-concepts] Concept can't check variadic template arguments
[not found] <bug-66092-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2015-07-17 17:43 ` jason at gcc dot gnu.org
@ 2015-08-04 13:36 ` jason at gcc dot gnu.org
5 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2015-08-04 13:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66092
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
Crash was fixed.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-08-04 13:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-66092-4@http.gcc.gnu.org/bugzilla/>
2015-05-13 20:22 ` [Bug c++/66092] [c++-concepts] Concept can't check variadic template arguments yingpo.liao at gmail dot com
2015-05-19 12:23 ` andrew.n.sutton at gmail dot com
2015-07-10 7:26 ` jason at gcc dot gnu.org
2015-07-14 4:11 ` jason at gcc dot gnu.org
2015-07-17 17:43 ` jason at gcc dot gnu.org
2015-08-04 13:36 ` 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).