public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60608] New: Template argument problem
@ 2014-03-21 11:19 volumedriverteam at cloudfounders dot com
2014-03-21 12:29 ` [Bug c++/60608] " redi at gcc dot gnu.org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: volumedriverteam at cloudfounders dot com @ 2014-03-21 11:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60608
Bug ID: 60608
Summary: Template argument problem
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: volumedriverteam at cloudfounders dot com
#include <functional>
template<typename... Args>
void
wrapper(void (*f)(Args...),
Args... args)
{
f(std::forward<Args...>(args...));
}
void
myfun(int)
{}
void
myfun2(const int)
{}
void
test()
{
int a = 0;
wrapper<int>(myfun, a);
wrapper(myfun, a);
wrapper<int>(myfun2, a);
const int b = 0;
wrapper(myfun2, b);
wrapper<const int>(myfun2, b);
}
It's not clear why the last line doesn't compile. It doesn't give any problem
on clang. The compiler seems to get the type of myfun2 wrong.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/60608] Template argument problem
2014-03-21 11:19 [Bug c++/60608] New: Template argument problem volumedriverteam at cloudfounders dot com
@ 2014-03-21 12:29 ` redi at gcc dot gnu.org
2014-07-13 20:35 ` paolo.carlini at oracle dot com
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2014-03-21 12:29 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 4748 bytes --]
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60608
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-03-21
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to volumedriverteam from comment #0)
> void
> myfun2(const int)
Top-level const is removed from function parameters, so this function is
equivalent to:
void myfun2(int);
And the instantiation wrapper<const int> is equivalent to:
template<> void wrapper<const int>(void (*)(int), int);
G++ gets confused trying to match const int to int somewhere.
f.cc: In function âvoid test()â:
f.cc:31:33: error: no matching function for call to âwrapper(void (&)(int),
const int&)â
wrapper<const int>(myfun2, b);
^
f.cc:31:33: note: candidate is:
f.cc:4:1: note: template<class ... Args> void wrapper(void (*)(Args ...), Args
...)
wrapper(void (*f)(Args...),
^
f.cc:4:1: note: template argument deduction/substitution failed:
f.cc:31:33: note: mismatched types âconst intâ and âintâ
wrapper<const int>(myfun2, b);
^
>From gcc-bugs-return-447082-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Mar 21 12:35:48 2014
Return-Path: <gcc-bugs-return-447082-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23343 invoked by alias); 21 Mar 2014 12:35:47 -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 23310 invoked by uid 48); 21 Mar 2014 12:35:43 -0000
From: "doko at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60609] New: [4.8/4.9 Regression] Error: value of 256 too large for field of 1 bytes at 68242
Date: Fri, 21 Mar 2014 12:35:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: doko at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created
Message-ID: <bug-60609-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: 2014-03/txt/msg01951.txt.bz2
Content-length: 1425
http://gcc.gnu.org/bugzilla/show_bug.cgi?id`609
Bug ID: 60609
Summary: [4.8/4.9 Regression] Error: value of 256 too large for
field of 1 bytes at 68242
Product: gcc
Version: 4.8.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: doko at gcc dot gnu.org
Created attachment 32416
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id2416&actioníit
preprocessed source
originall reported as a gas issue:
https://sourceware.org/bugzilla/show_bug.cgi?id\x16735
seen when building the ppl 1.1 bindings for SWI Prolog, using binutils from the
2.24 branch on arm-linux-gnueabihf with a compiler defaulting to thumb mode.
seen with current 4.8 branch and at least trunk 20140306.
$ g++ -c -g -O2 ppl_prolog_common.ii
/tmp/ccuRxr3p.s: Assembler messages:
/tmp/ccuRxr3p.s:126688: Error: value of 256 too large for field of 1 bytes at
68242
$ g++ -marm -c -g -O2 ppl_prolog_common.ii
<succeeds>
$ as -v -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -meabi=5 -o
ppl_prolog_common.o ppl_prolog_common.s
GNU assembler version 2.24 (arm-linux-gnueabihf) using BFD version (GNU
Binutils for Debian) 2.24
ppl_prolog_common.s: Assembler messages:
ppl_prolog_common.s:130339: Error: value of 256 too large for field of 1 bytes
at 70430
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/60608] Template argument problem
2014-03-21 11:19 [Bug c++/60608] New: Template argument problem volumedriverteam at cloudfounders dot com
2014-03-21 12:29 ` [Bug c++/60608] " redi at gcc dot gnu.org
@ 2014-07-13 20:35 ` paolo.carlini at oracle dot com
2014-07-13 21:05 ` paolo.carlini at oracle dot com
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-07-13 20:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60608
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|volumedriverteam@cloudfound |
|ers.com |
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Thus boils down to:
template<typename... Args>
void
wrapper(void (*f)(Args...), Args...);
void myfun(int);
void
test()
{
const int b = 0;
wrapper<const int>(myfun, b);
}
where a non-variadic version is fine. Figuring out where the cv-qualifier is
treated differently in the two cases should be relatively easy...
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/60608] Template argument problem
2014-03-21 11:19 [Bug c++/60608] New: Template argument problem volumedriverteam at cloudfounders dot com
2014-03-21 12:29 ` [Bug c++/60608] " redi at gcc dot gnu.org
2014-07-13 20:35 ` paolo.carlini at oracle dot com
@ 2014-07-13 21:05 ` paolo.carlini at oracle dot com
2014-07-14 10:31 ` paolo.carlini at oracle dot com
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-07-13 21:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60608
--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Slightly shorter:
template<typename... Args>
void
wrapper(void (*f)(Args...));
void myfun(int);
void
test()
{
wrapper<const int>(myfun);
}
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/60608] Template argument problem
2014-03-21 11:19 [Bug c++/60608] New: Template argument problem volumedriverteam at cloudfounders dot com
` (2 preceding siblings ...)
2014-07-13 21:05 ` paolo.carlini at oracle dot com
@ 2014-07-14 10:31 ` paolo.carlini at oracle dot com
2014-07-14 15:52 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-07-14 10:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60608
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
I'm going to save some debugging notes, mostly about non-variadic vs variadic.
First one: the tsubst in fn_type_unification:
fntype = tsubst (TREE_TYPE (fn), explicit_targs,
complain | tf_partial, NULL_TREE);
working on TREE_TYPE (fn) which has uses_template_parms true, returns a fntype
which has uses_template_parms false in the non-variadic case, still true in the
variadic case. Note that later uses_template_parms matters at the beginning of
unify_one_argument.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/60608] Template argument problem
2014-03-21 11:19 [Bug c++/60608] New: Template argument problem volumedriverteam at cloudfounders dot com
` (3 preceding siblings ...)
2014-07-14 10:31 ` paolo.carlini at oracle dot com
@ 2014-07-14 15:52 ` paolo.carlini at oracle dot com
2015-04-22 12:00 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-07-14 15:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60608
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com
Target Milestone|--- |4.10.0
--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/60608] Template argument problem
2014-03-21 11:19 [Bug c++/60608] New: Template argument problem volumedriverteam at cloudfounders dot com
` (4 preceding siblings ...)
2014-07-14 15:52 ` paolo.carlini at oracle dot com
@ 2015-04-22 12:00 ` jakub at gcc dot gnu.org
2015-07-16 9:16 ` rguenth at gcc dot gnu.org
2023-10-02 17:43 ` pinskia at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-04-22 12:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60608
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|5.0 |5.2
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 5.1 has been released.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/60608] Template argument problem
2014-03-21 11:19 [Bug c++/60608] New: Template argument problem volumedriverteam at cloudfounders dot com
` (5 preceding siblings ...)
2015-04-22 12:00 ` jakub at gcc dot gnu.org
@ 2015-07-16 9:16 ` rguenth at gcc dot gnu.org
2023-10-02 17:43 ` pinskia at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-07-16 9:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60608
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|5.2 |5.3
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 5.2 is being released, adjusting target milestone to 5.3.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/60608] Template argument problem
2014-03-21 11:19 [Bug c++/60608] New: Template argument problem volumedriverteam at cloudfounders dot com
` (6 preceding siblings ...)
2015-07-16 9:16 ` rguenth at gcc dot gnu.org
@ 2023-10-02 17:43 ` pinskia at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-02 17:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60608
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |janschultke at googlemail dot com
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 111662 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-10-02 17:43 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-21 11:19 [Bug c++/60608] New: Template argument problem volumedriverteam at cloudfounders dot com
2014-03-21 12:29 ` [Bug c++/60608] " redi at gcc dot gnu.org
2014-07-13 20:35 ` paolo.carlini at oracle dot com
2014-07-13 21:05 ` paolo.carlini at oracle dot com
2014-07-14 10:31 ` paolo.carlini at oracle dot com
2014-07-14 15:52 ` paolo.carlini at oracle dot com
2015-04-22 12:00 ` jakub at gcc dot gnu.org
2015-07-16 9:16 ` rguenth at gcc dot gnu.org
2023-10-02 17:43 ` pinskia 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).