public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66841] New: [concepts] bogus error "invalid reference to function concept" when function concept is overloaded
@ 2015-07-11 18:17 eric.niebler at gmail dot com
2015-07-12 20:40 ` [Bug c++/66841] " andrew.n.sutton at gmail dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: eric.niebler at gmail dot com @ 2015-07-11 18:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66841
Bug ID: 66841
Summary: [concepts] bogus error "invalid reference to function
concept" when function concept is overloaded
Product: gcc
Version: c++-concepts
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: eric.niebler at gmail dot com
Target Milestone: ---
This is related to the discussion in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66834. Because of the kind
mismatch error described in 66834, the straightforward implementation of
Constructible doesn't work, and the concept must be overloaded. But once it's
overloaded, uses of it cause of "invalid reference to function concept" error.
template <class T, class U>
concept bool Same =
__is_same_as(T, U);
template <class T, class U>
concept bool ExplicitlyConvertible() { return
Same<T, U> ||
requires(T&& t) {
static_cast<U>((T&&)t);
};
}
template <class T>
concept bool Constructible() { return
requires {
T{ };
};
}
template <class T, class U>
concept bool Constructible() { return
ExplicitlyConvertible<U, T>() ||
requires (U&& u) {
T{ (U&&)u };
};
}
template <class T, class U, class V, class...Args>
concept bool Constructible() { return
requires (U&& u, V&& v, Args&&...args) {
T{ (U&&)u, (V&&)v, (Args&&)args... };
};
}
template <class, class...>
constexpr bool core_constructible() { return false; }
template <class T, class...Args>
requires Constructible<T, Args...>() // ERROR HERE
constexpr bool core_constructible() { return false; }
Yields:
../cmcstl2/scratch/constructible.cpp:40:23: error: invalid reference to
function concept ‘template<class T, class U, class V, class ... Args> constexpr
bool Constructible()’
requires Constructible<T, Args...>()
^
>From gcc-bugs-return-492046-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jul 11 18:18:27 2015
Return-Path: <gcc-bugs-return-492046-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 6616 invoked by alias); 11 Jul 2015 18:18:26 -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 6478 invoked by uid 55); 11 Jul 2015 18:18:13 -0000
From: "paolo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58734] [C++11] Template template parameter pack instantiation problem
Date: Sat, 11 Jul 2015 18:18: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: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo at gcc dot gnu.org
X-Bugzilla-Status: NEW
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-58734-4-bzBAUasNjH@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58734-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58734-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/msg00936.txt.bz2
Content-length: 489
https://gcc.gnu.org/bugzilla/show_bug.cgi?idX734
--- Comment #4 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Sat Jul 11 18:17:41 2015
New Revision: 225713
URL: https://gcc.gnu.org/viewcvs?rev"5713&root=gcc&view=rev
Log:
2015-07-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58734
* g++.dg/cpp0x/variadic-ttp2.C: New.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/variadic-ttp2.C
Modified:
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-04 13:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-11 18:17 [Bug c++/66841] New: [concepts] bogus error "invalid reference to function concept" when function concept is overloaded eric.niebler at gmail dot com
2015-07-12 20:40 ` [Bug c++/66841] " andrew.n.sutton at gmail dot com
2015-07-12 20:44 ` eric.niebler at gmail dot com
2015-08-04 13:37 ` 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).