public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "Casey at Carter dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67038] New: [c++-concepts] Viable function template despite unsatisfied constraints
Date: Mon, 27 Jul 2015 23:03:00 -0000	[thread overview]
Message-ID: <bug-67038-4@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2015-07-27 23:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 23:03 Casey at Carter dot net [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-67038-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).