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
$

Reply via email to