public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67038] New: [c++-concepts] Viable function template despite unsatisfied constraints
@ 2015-07-27 23:03 Casey at Carter dot net
  2015-07-30  3:29 ` [Bug c++/67038] " jason at gcc dot gnu.org
  2015-07-30  3:29 ` jason at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: Casey at Carter dot net @ 2015-07-27 23:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67038
           Summary: [c++-concepts] Viable function template despite
                    unsatisfied constraints
           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: ---

Created attachment 36077
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36077&action=edit
Preprocessed test case

r226205 fails to compile this correct program:

#include <stl2/iterator.hpp>

template <stl2::WeakOutputIterator<int> I>
  requires !stl2::WeakInputIterator<I>()
constexpr bool dispatch() { return false; }

template <stl2::WeakInputIterator I>
constexpr bool dispatch() { return true; }

template <stl2::WeakOutputIterator<int> I>
constexpr bool is_weak_out() { return true; }

template <stl2::WeakInputIterator I>
constexpr bool is_weak_in() { return true; }

int main() {
  static_assert(is_weak_out<int*>());
  static_assert(is_weak_in<int*>());
  static_assert(dispatch<int*>());
}

with error:

~/concept-gcc/bin/g++ -std=gnu++1z -I ~/cmcstl2/include -I
~/cmcstl2/meta/include foo.cpp -c
foo.cpp: In function ‘int main()’:
foo.cpp:19:32: error: call of overloaded ‘dispatch()’ is ambiguous
   static_assert(dispatch<int*>());
                                ^
foo.cpp:5:16: note: candidate: constexpr bool dispatch() [with I = int*]
 constexpr bool dispatch() { return false; }
                ^
foo.cpp:8:16: note: candidate: constexpr bool dispatch() [with I = int*]
 constexpr bool dispatch() { return true; }
                ^

The compiler apparently considers both overloads of dispatch to be viable
despite that the first overload's constraint !stl2::WeakInputIterator<I>() is
clearly not satisfied when I is int*.
>From gcc-bugs-return-493517-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Jul 27 23:45:21 2015
Return-Path: <gcc-bugs-return-493517-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 57184 invoked by alias); 27 Jul 2015 23:45:20 -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 56850 invoked by uid 55); 27 Jul 2015 23:45:15 -0000
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/66846] parloops does not always mark loops for fixup if needed
Date: Mon, 27 Jul 2015 23:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords: patch
X-Bugzilla-Severity: normal
X-Bugzilla-Who: vries at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-66846-4-nD8lYltHVO@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66846-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66846-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-07/txt/msg02407.txt.bz2
Content-length: 1407

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

--- Comment #4 from vries at gcc dot gnu.org ---
Author: vries
Date: Mon Jul 27 23:44:43 2015
New Revision: 226279

URL: https://gcc.gnu.org/viewcvs?rev"6279&root=gcc&view=rev
Log:
Don't cancel loop tree in parloops

2015-07-28  Tom de Vries  <tom@codesourcery.com>

        PR tree-optimization/66846
        * omp-low.c (expand_omp_taskreg) [ENABLE_CHECKING]: Call
        verify_loop_structure for child_cfun if !LOOPS_NEED_FIXUP.
        (expand_omp_target) [ENABLE_CHECKING]: Same.
        (execute_expand_omp): Reinstate LOOPS_HAVE_SIMPLE_LATCHES if in ssa.
        [ENABLE_CHECKING]: Call verify_loop_structure for cfun if
        !LOOPS_NEED_FIXUP.
        (expand_omp_for_static_nochunk): Handle case that omp_for already has
        its own loop struct.
        * tree-parloops.c (create_parallel_loop): Add comment about breaking
        LOOPS_HAVE_SIMPLE_LATCHES.  Record new exit.
        (gen_parallel_loop): Remove call to cancel_loop_tree.
        (parallelize_loops): Skip loops that are inner loops of parallelized
        loops.
        (pass_parallelize_loops::execute): Clear LOOPS_HAVE_SIMPLE_LATCHES on
        loop state.
        [ENABLE_CHECKING]: Call verify_loop_structure.

Modified:
    branches/gomp-4_0-branch/gcc/ChangeLog.gomp
    branches/gomp-4_0-branch/gcc/omp-low.c
    branches/gomp-4_0-branch/gcc/tree-parloops.c


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

* [Bug c++/67038] [c++-concepts] Viable function template despite unsatisfied constraints
  2015-07-27 23:03 [Bug c++/67038] New: [c++-concepts] Viable function template despite unsatisfied constraints Casey at Carter dot net
@ 2015-07-30  3:29 ` jason at gcc dot gnu.org
  2015-07-30  3:29 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2015-07-30  3:29 UTC (permalink / raw)
  To: gcc-bugs

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

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.


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

* [Bug c++/67038] [c++-concepts] Viable function template despite unsatisfied constraints
  2015-07-27 23:03 [Bug c++/67038] New: [c++-concepts] Viable function template despite unsatisfied constraints Casey at Carter dot net
  2015-07-30  3:29 ` [Bug c++/67038] " jason at gcc dot gnu.org
@ 2015-07-30  3:29 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2015-07-30  3:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Jul 30 03:29:00 2015
New Revision: 226380

URL: https://gcc.gnu.org/viewcvs?rev=226380&root=gcc&view=rev
Log:
        PR c++/67038
        * constraint.cc (satisfy_constraint): Use dummy args if null.

Added:
    branches/c++-concepts/gcc/testsuite/g++.dg/concepts/req18.C
Modified:
    branches/c++-concepts/ChangeLog.concepts
    branches/c++-concepts/gcc/cp/constraint.cc


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

end of thread, other threads:[~2015-07-30  3:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-27 23:03 [Bug c++/67038] New: [c++-concepts] Viable function template despite unsatisfied constraints Casey at Carter dot net
2015-07-30  3:29 ` [Bug c++/67038] " jason at gcc dot gnu.org
2015-07-30  3:29 ` 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).