public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53446] New: Template function incorrectly rejected when convertible argument is provided for a parameter
@ 2012-05-22 5:14 blelbach at cct dot lsu.edu
2012-05-22 5:15 ` [Bug c++/53446] " pinskia at gcc dot gnu.org
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: blelbach at cct dot lsu.edu @ 2012-05-22 5:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53446
Bug #: 53446
Summary: Template function incorrectly rejected when
convertible argument is provided for a parameter
Classification: Unclassified
Product: gcc
Version: 4.7.1
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: blelbach@cct.lsu.edu
Created attachment 27471
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27471
Failing test case
(Thanks to rjmccall on #llvm for explaining the details of why this is a bug)
In the attached code snippet, the second parameter of f<>(), B<>, is a
non-deduced context, but the first argument D<> permits the deduction of T=int.
That substitution should succeed, and then the second argument is convertible.
The candidate can't be rejected just because B<something> can't be matched with
A.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/53446] Template function incorrectly rejected when convertible argument is provided for a parameter
2012-05-22 5:14 [Bug c++/53446] New: Template function incorrectly rejected when convertible argument is provided for a parameter blelbach at cct dot lsu.edu
2012-05-22 5:15 ` [Bug c++/53446] " pinskia at gcc dot gnu.org
@ 2012-05-22 5:15 ` blelbach at cct dot lsu.edu
2012-05-22 5:17 ` blelbach at cct dot lsu.edu
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: blelbach at cct dot lsu.edu @ 2012-05-22 5:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53446
--- Comment #1 from Bryce Lelbach (wash) <blelbach at cct dot lsu.edu> 2012-05-22 05:14:12 UTC ---
Created attachment 27472
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27472
Results of compiling the test case
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/53446] Template function incorrectly rejected when convertible argument is provided for a parameter
2012-05-22 5:14 [Bug c++/53446] New: Template function incorrectly rejected when convertible argument is provided for a parameter blelbach at cct dot lsu.edu
@ 2012-05-22 5:15 ` pinskia at gcc dot gnu.org
2012-05-22 5:15 ` blelbach at cct dot lsu.edu
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-22 5:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53446
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|major |normal
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/53446] Template function incorrectly rejected when convertible argument is provided for a parameter
2012-05-22 5:14 [Bug c++/53446] New: Template function incorrectly rejected when convertible argument is provided for a parameter blelbach at cct dot lsu.edu
2012-05-22 5:15 ` [Bug c++/53446] " pinskia at gcc dot gnu.org
2012-05-22 5:15 ` blelbach at cct dot lsu.edu
@ 2012-05-22 5:17 ` blelbach at cct dot lsu.edu
2012-05-22 5:18 ` blelbach at cct dot lsu.edu
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: blelbach at cct dot lsu.edu @ 2012-05-22 5:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53446
--- Comment #2 from Bryce Lelbach (wash) <blelbach at cct dot lsu.edu> 2012-05-22 05:15:36 UTC ---
Comment on attachment 27472
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27472
Results of compiling the test case
$ g++-4.5 --version
g++-4.5 (Debian 4.5.3-12) 4.5.3
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++-4.5 incorrect_rejection_of_convertible_argument.cpp -o
incorrect_rejection_of_convertible_argument
incorrect_rejection_of_convertible_argument.cpp: In function ‘int main()’:
incorrect_rejection_of_convertible_argument.cpp:18:11: error: no matching
function for call to ‘f(D<int>&, A&)’
$
$ g++-4.6 --version
g++-4.6 (Debian 4.6.3-5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++-4.6 incorrect_rejection_of_convertible_argument.cpp -o
incorrect_rejection_of_convertible_argument
incorrect_rejection_of_convertible_argument.cpp: In function ‘int main()’:
incorrect_rejection_of_convertible_argument.cpp:18:11: error: no matching
function for call to ‘f(D<int>&, A&)’
incorrect_rejection_of_convertible_argument.cpp:18:11: note: candidate is:
incorrect_rejection_of_convertible_argument.cpp:10:6: note: template<class T>
void f(D<T>, B<typename C<T>::type>)
$
$ g++-4.7 --version
g++-4.7 (Debian 4.7.0-8) 4.7.0
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ g++-4.7 incorrect_rejection_of_convertible_argument.cpp -o
incorrect_rejection_of_convertible_argument
incorrect_rejection_of_convertible_argument.cpp: In function ‘int main()’:
incorrect_rejection_of_convertible_argument.cpp:18:11: error: no matching
function for call to ‘f(D<int>&, A&)’
incorrect_rejection_of_convertible_argument.cpp:18:11: note: candidate is:
incorrect_rejection_of_convertible_argument.cpp:10:6: note: template<class T>
void f(D<T>, B<typename C<T>::type>)
incorrect_rejection_of_convertible_argument.cpp:10:6: note: template argument
deduction/substitution failed:
incorrect_rejection_of_convertible_argument.cpp:18:11: note: ‘A’ is not
derived from ‘B<typename C<T>::type>’
$
$ clang++ --version
Debian clang version 3.1-1 (tags/RELEASE_31/rc1) (based on LLVM 3.1)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ clang++ incorrect_rejection_of_convertible_argument.cpp -o
incorrect_rejection_of_convertible_argument
$
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/53446] Template function incorrectly rejected when convertible argument is provided for a parameter
2012-05-22 5:14 [Bug c++/53446] New: Template function incorrectly rejected when convertible argument is provided for a parameter blelbach at cct dot lsu.edu
` (2 preceding siblings ...)
2012-05-22 5:17 ` blelbach at cct dot lsu.edu
@ 2012-05-22 5:18 ` blelbach at cct dot lsu.edu
2012-05-22 5:23 ` pinskia at gcc dot gnu.org
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: blelbach at cct dot lsu.edu @ 2012-05-22 5:18 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53446
--- Comment #3 from Bryce Lelbach (wash) <blelbach at cct dot lsu.edu> 2012-05-22 05:17:03 UTC ---
Created attachment 27473
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27473
Results of compiling the test case
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/53446] Template function incorrectly rejected when convertible argument is provided for a parameter
2012-05-22 5:14 [Bug c++/53446] New: Template function incorrectly rejected when convertible argument is provided for a parameter blelbach at cct dot lsu.edu
` (3 preceding siblings ...)
2012-05-22 5:18 ` blelbach at cct dot lsu.edu
@ 2012-05-22 5:23 ` pinskia at gcc dot gnu.org
2012-05-22 5:25 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-22 5:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53446
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-22 05:18:17 UTC ---
Comeau online also accepts it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/53446] Template function incorrectly rejected when convertible argument is provided for a parameter
2012-05-22 5:14 [Bug c++/53446] New: Template function incorrectly rejected when convertible argument is provided for a parameter blelbach at cct dot lsu.edu
` (4 preceding siblings ...)
2012-05-22 5:23 ` pinskia at gcc dot gnu.org
@ 2012-05-22 5:25 ` pinskia at gcc dot gnu.org
2012-05-22 14:44 ` daniel.kruegler at googlemail dot com
2012-05-22 18:36 ` blelbach at cct dot lsu.edu
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-22 5:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53446
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-22 05:23:06 UTC ---
I think this is just a dup of bug 52072.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/53446] Template function incorrectly rejected when convertible argument is provided for a parameter
2012-05-22 5:14 [Bug c++/53446] New: Template function incorrectly rejected when convertible argument is provided for a parameter blelbach at cct dot lsu.edu
` (5 preceding siblings ...)
2012-05-22 5:25 ` pinskia at gcc dot gnu.org
@ 2012-05-22 14:44 ` daniel.kruegler at googlemail dot com
2012-05-22 18:36 ` blelbach at cct dot lsu.edu
7 siblings, 0 replies; 9+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-05-22 14:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53446
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler at
| |googlemail dot com
--- Comment #6 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-05-22 13:57:07 UTC ---
(In reply to comment #5)
> I think this is just a dup of bug 52072.
I agree.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/53446] Template function incorrectly rejected when convertible argument is provided for a parameter
2012-05-22 5:14 [Bug c++/53446] New: Template function incorrectly rejected when convertible argument is provided for a parameter blelbach at cct dot lsu.edu
` (6 preceding siblings ...)
2012-05-22 14:44 ` daniel.kruegler at googlemail dot com
@ 2012-05-22 18:36 ` blelbach at cct dot lsu.edu
7 siblings, 0 replies; 9+ messages in thread
From: blelbach at cct dot lsu.edu @ 2012-05-22 18:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53446
Bryce Lelbach (wash) <blelbach at cct dot lsu.edu> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
--- Comment #7 from Bryce Lelbach (wash) <blelbach at cct dot lsu.edu> 2012-05-22 18:36:11 UTC ---
Yes, this is a duplicate of 52072.
*** This bug has been marked as a duplicate of bug 52072 ***
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-05-22 18:36 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-22 5:14 [Bug c++/53446] New: Template function incorrectly rejected when convertible argument is provided for a parameter blelbach at cct dot lsu.edu
2012-05-22 5:15 ` [Bug c++/53446] " pinskia at gcc dot gnu.org
2012-05-22 5:15 ` blelbach at cct dot lsu.edu
2012-05-22 5:17 ` blelbach at cct dot lsu.edu
2012-05-22 5:18 ` blelbach at cct dot lsu.edu
2012-05-22 5:23 ` pinskia at gcc dot gnu.org
2012-05-22 5:25 ` pinskia at gcc dot gnu.org
2012-05-22 14:44 ` daniel.kruegler at googlemail dot com
2012-05-22 18:36 ` blelbach at cct dot lsu.edu
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).