public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates
@ 2015-01-14 21:22 janus at gcc dot gnu.org
2015-01-14 21:52 ` [Bug c++/64603] " ville.voutilainen at gmail dot com
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-14 21:22 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
Bug ID: 64603
Summary: [5 Regression] bogus error "no matching function for
call to ..." with templates
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: janus at gcc dot gnu.org
Created attachment 34452
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34452&action=edit
source file
The attached source file compiles fine with g++ 4.9.1, 4.8.3 and 4.7.4.
However, it is rejected with current trunk builds:
$ g++-5.0 logging.cc -std=c++11
logging.cc: In function ‘void create_all_loggers()’:
logging.cc:33:62: error: no matching function for call to
‘create_all_loggers_impl()’
create_all_loggers_impl<std::tuple_size<AreaTuple>::value>();
^
logging.cc:26:52: note: candidate: template<long unsigned int index, int
<anonymous> > typename std::enable_if<(index == 0)>::type
create_all_loggers_impl()
inline typename std::enable_if<(index == 0)>::type create_all_loggers_impl()
{}
^
logging.cc:26:52: note: template argument deduction/substitution failed:
logging.cc: In substitution of ‘template<long unsigned int index, int
<anonymous> > typename std::enable_if<(index == 0)>::type
create_all_loggers_impl() [with long unsigned int index = 1ul; int <anonymous>
= <missing>]’:
logging.cc:33:62: required from here
logging.cc:26:52: error: no type named ‘type’ in ‘struct std::enable_if<false,
void>’
logging.cc:30:52: note: candidate: template<long unsigned int index, int
longest_name> typename std::enable_if<(index != 0)>::type
create_all_loggers_impl()
inline typename std::enable_if<(index != 0)>::type create_all_loggers_impl()
{}
^
logging.cc:30:52: note: template argument deduction/substitution failed:
logging.cc:29:61: in constexpr expansion of ‘find_longest_logger_name<1ul>()’
logging.cc:29:62: error: ‘(((int)(((unsigned int)5ul) + 4294967295u)) > 0)’ is
not a constant expression
int longest_name = find_longest_logger_name<index>()>
^
logging.cc:29:62: note: in template argument for type ‘int’
>From gcc-bugs-return-473250-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 14 21:35:26 2015
Return-Path: <gcc-bugs-return-473250-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14369 invoked by alias); 14 Jan 2015 21:35:24 -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 14313 invoked by uid 48); 14 Jan 2015 21:35:16 -0000
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/64356] Some constexpr expressions not recognized as constexpr
Date: Wed, 14 Jan 2015 21:35: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: 5.0
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jason at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: jason at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution target_milestone
Message-ID: <bug-64356-4-lviBiuJO6U@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64356-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64356-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-01/txt/msg01244.txt.bz2
Content-length: 475
https://gcc.gnu.org/bugzilla/show_bug.cgi?idd356
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |5.0
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64603] [5 Regression] bogus error "no matching function for call to ..." with templates
2015-01-14 21:22 [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates janus at gcc dot gnu.org
@ 2015-01-14 21:52 ` ville.voutilainen at gmail dot com
2015-01-15 8:31 ` janus at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ville.voutilainen at gmail dot com @ 2015-01-14 21:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
Ville Voutilainen <ville.voutilainen at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-01-14
CC| |ville.voutilainen at gmail dot com
Known to work| |4.7.3, 4.8.2, 4.9.1
Ever confirmed|0 |1
Known to fail| |5.0
--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Clang also accepts the code.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64603] [5 Regression] bogus error "no matching function for call to ..." with templates
2015-01-14 21:22 [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates janus at gcc dot gnu.org
2015-01-14 21:52 ` [Bug c++/64603] " ville.voutilainen at gmail dot com
@ 2015-01-15 8:31 ` janus at gcc dot gnu.org
2015-01-15 9:29 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-15 8:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |5.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64603] [5 Regression] bogus error "no matching function for call to ..." with templates
2015-01-14 21:22 [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates janus at gcc dot gnu.org
2015-01-14 21:52 ` [Bug c++/64603] " ville.voutilainen at gmail dot com
2015-01-15 8:31 ` janus at gcc dot gnu.org
@ 2015-01-15 9:29 ` rguenth at gcc dot gnu.org
2015-01-15 20:00 ` janus at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-15 9:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64603] [5 Regression] bogus error "no matching function for call to ..." with templates
2015-01-14 21:22 [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates janus at gcc dot gnu.org
` (2 preceding siblings ...)
2015-01-15 9:29 ` rguenth at gcc dot gnu.org
@ 2015-01-15 20:00 ` janus at gcc dot gnu.org
2015-01-19 14:52 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-15 20:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
--- Comment #2 from janus at gcc dot gnu.org ---
Further reduced test case:
template <int i> constexpr int find_longest_name()
{
return sizeof("Main") - 1;
}
template <int i, int l = find_longest_name<i>()> void create_all_loggers()
{}
int main()
{
create_all_loggers<1>();
}
$ g++-5.0 logging.cc -std=c++11
logging.cc: In function ‘int main()’:
logging.cc:11:25: error: no matching function for call to
‘create_all_loggers()’
create_all_loggers<1>();
^
logging.cc:6:55: note: candidate: template<int i, int l> void
create_all_loggers()
template <int i, int l = find_longest_name<i>()> void create_all_loggers()
^
logging.cc:6:55: note: template argument deduction/substitution failed:
logging.cc:6: confused by earlier errors, bailing out
>From gcc-bugs-return-473406-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 15 20:01:32 2015
Return-Path: <gcc-bugs-return-473406-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19555 invoked by alias); 15 Jan 2015 20:01:32 -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 19523 invoked by uid 48); 15 Jan 2015 20:01:28 -0000
From: "hubicka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/64612] [5 Regression] profiledbootstrap failures
Date: Thu, 15 Jan 2015 20:01:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: hubicka at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P1
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-64612-4-zs0XYrwKj8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64612-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64612-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-01/txt/msg01400.txt.bz2
Content-length: 144
https://gcc.gnu.org/bugzilla/show_bug.cgi?idd612
--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Seems like dup of PR64583
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64603] [5 Regression] bogus error "no matching function for call to ..." with templates
2015-01-14 21:22 [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates janus at gcc dot gnu.org
` (3 preceding siblings ...)
2015-01-15 20:00 ` janus at gcc dot gnu.org
@ 2015-01-19 14:52 ` jakub at gcc dot gnu.org
2015-01-19 15:43 ` janus at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-01-19 14:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r217664.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64603] [5 Regression] bogus error "no matching function for call to ..." with templates
2015-01-14 21:22 [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates janus at gcc dot gnu.org
` (4 preceding siblings ...)
2015-01-19 14:52 ` jakub at gcc dot gnu.org
@ 2015-01-19 15:43 ` janus at gcc dot gnu.org
2015-01-21 21:26 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: janus at gcc dot gnu.org @ 2015-01-19 15:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
--- Comment #4 from janus at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #3)
> Started with r217664.
Confirmed. Reverting that guy fixes the problem:
Index: gcc/cp/constexpr.c
===================================================================
--- gcc/cp/constexpr.c (Revision 219840)
+++ gcc/cp/constexpr.c (Arbeitskopie)
@@ -1049,7 +1049,7 @@ adjust_temp_type (tree type, tree temp)
/* True if we want to use the new handling of constexpr calls based on
DECL_SAVED_TREE. */
-#define use_new_call true
+#define use_new_call (cxx_dialect >= cxx14)
/* Subroutine of cxx_eval_call_expression.
We are processing a call expression (either CALL_EXPR or
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64603] [5 Regression] bogus error "no matching function for call to ..." with templates
2015-01-14 21:22 [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates janus at gcc dot gnu.org
` (5 preceding siblings ...)
2015-01-19 15:43 ` janus at gcc dot gnu.org
@ 2015-01-21 21:26 ` jason at gcc dot gnu.org
2015-01-21 21:57 ` jason at gcc dot gnu.org
2015-01-23 16:40 ` jason at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2015-01-21 21:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |jason at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64603] [5 Regression] bogus error "no matching function for call to ..." with templates
2015-01-14 21:22 [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates janus at gcc dot gnu.org
` (6 preceding siblings ...)
2015-01-21 21:26 ` jason at gcc dot gnu.org
@ 2015-01-21 21:57 ` jason at gcc dot gnu.org
2015-01-23 16:40 ` jason at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2015-01-21 21:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Jan 21 21:56:34 2015
New Revision: 219973
URL: https://gcc.gnu.org/viewcvs?rev=219973&root=gcc&view=rev
Log:
PR c++/64603
* constexpr.c (cxx_eval_constant_expression): Only shortcut
constant CONSTRUCTORs.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-sizeof1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/constexpr.c
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/64603] [5 Regression] bogus error "no matching function for call to ..." with templates
2015-01-14 21:22 [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates janus at gcc dot gnu.org
` (7 preceding siblings ...)
2015-01-21 21:57 ` jason at gcc dot gnu.org
@ 2015-01-23 16:40 ` jason at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2015-01-23 16:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64603
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2015-01-23 16:40 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-14 21:22 [Bug c++/64603] New: [5 Regression] bogus error "no matching function for call to ..." with templates janus at gcc dot gnu.org
2015-01-14 21:52 ` [Bug c++/64603] " ville.voutilainen at gmail dot com
2015-01-15 8:31 ` janus at gcc dot gnu.org
2015-01-15 9:29 ` rguenth at gcc dot gnu.org
2015-01-15 20:00 ` janus at gcc dot gnu.org
2015-01-19 14:52 ` jakub at gcc dot gnu.org
2015-01-19 15:43 ` janus at gcc dot gnu.org
2015-01-21 21:26 ` jason at gcc dot gnu.org
2015-01-21 21:57 ` jason at gcc dot gnu.org
2015-01-23 16:40 ` 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).