This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53446] Template function incorrectly rejected when convertible argument is provided for a parameter


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
$


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]