public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66937] New: Do not compare constraints for unconstrained template template parameters
@ 2015-07-19 16:17 rbock at eudoxos dot de
  2015-08-07  4:45 ` [Bug c++/66937] " jason at gcc dot gnu.org
  2015-08-07  4:47 ` rbock at eudoxos dot de
  0 siblings, 2 replies; 3+ messages in thread
From: rbock at eudoxos dot de @ 2015-07-19 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66937
           Summary: Do not compare constraints for unconstrained template
                    template parameters
           Product: gcc
           Version: c++-concepts
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rbock at eudoxos dot de
                CC: andrew.n.sutton at gmail dot com
  Target Milestone: ---

Created attachment 36014
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36014&action=edit
copy tuple args implementation and test code that currently fails to compile

I have a template that takes a std::tuple (source) and copies its arguments
into another template (sink), see attached code.

template<typename Tuple, template<typename...> class Sink>
using copy_tuple_args = ...

The copy_tuple_args template is supposed to be generic, not caring about the
nature of the copied arguments or the sink. This works fine as long as the sink
is not constrained, e.g. if the sink is another tuple. But if the sink has
constraints,

template<Column... C>
struct column_list;

then both N4377 and the current gcc concepts implementation (revision 225987)
do not allow copying, because the argument (column_list) is more constrained
than the unconstrained parameter (Sink).

This seems to be a rather unfortunate rule. I believe that copy_tuple_args is a
reasonable use case (which works just fine with C++11). It will stop working as
soon as concepts start to get used.

In private communication Andrew Sutton agreed that this is an issue. I am going
to file a defect report for the Concepts TS. Andrew intends to discuss this in
Kona.

Andrew's proposed solution is to not compare constraints for unconstrained
template template parameters. This will certainly fix the problem for me :-)

Best,

Roland


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

* [Bug c++/66937] Do not compare constraints for unconstrained template template parameters
  2015-07-19 16:17 [Bug c++/66937] New: Do not compare constraints for unconstrained template template parameters rbock at eudoxos dot de
@ 2015-08-07  4:45 ` jason at gcc dot gnu.org
  2015-08-07  4:47 ` rbock at eudoxos dot de
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2015-08-07  4:45 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         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> ---
Applied the proposed solution for now.


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

* [Bug c++/66937] Do not compare constraints for unconstrained template template parameters
  2015-07-19 16:17 [Bug c++/66937] New: Do not compare constraints for unconstrained template template parameters rbock at eudoxos dot de
  2015-08-07  4:45 ` [Bug c++/66937] " jason at gcc dot gnu.org
@ 2015-08-07  4:47 ` rbock at eudoxos dot de
  1 sibling, 0 replies; 3+ messages in thread
From: rbock at eudoxos dot de @ 2015-08-07  4:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Roland B <rbock at eudoxos dot de> ---
(In reply to Jason Merrill from comment #1)
> Author: jason
> Date: Thu Aug  6 17:42:25 2015
> New Revision: 226687
> 
> URL: https://gcc.gnu.org/viewcvs?rev=226687&root=gcc&view=rev
> Log:
> 	PR c++/66937
> 	* pt.c (is_compatible_template_arg): A template template parameter
> 	with unconstrained parameters can match an argument with
> 	constrained parameters.
> 
> Added:
>    
> branches/c++-concepts/gcc/testsuite/g++.dg/concepts/template-template-parm1.C

Thanks for the commit. Works fine for me!

In the test file (template-template-parm1.C) I guess you should edit the
comment in the last line a bit.

```
// This fails, but should not
```

Not true anymore, since it compiles just fine :-)

Thanks again,

Roland
>From gcc-bugs-return-494335-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Aug 07 04:47:37 2015
Return-Path: <gcc-bugs-return-494335-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 66138 invoked by alias); 7 Aug 2015 04:47:36 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 66096 invoked by uid 48); 7 Aug 2015 04:47:32 -0000
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67138] [concepts] bogus "not more constrained" error for more constrained partial specialization
Date: Fri, 07 Aug 2015 04:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: c++-concepts
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jason at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: jason at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution assigned_to
Message-ID: <bug-67138-4-Q1RM5ctsAJ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67138-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67138-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-08/txt/msg00477.txt.bz2
Content-length: 514

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg138

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 #1 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed by r226711.


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

end of thread, other threads:[~2015-08-07  4:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-19 16:17 [Bug c++/66937] New: Do not compare constraints for unconstrained template template parameters rbock at eudoxos dot de
2015-08-07  4:45 ` [Bug c++/66937] " jason at gcc dot gnu.org
2015-08-07  4:47 ` rbock at eudoxos dot de

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).