This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54574] G++ accepts parameters with wrong types in parent constructor
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 20 Aug 2017 18:28:44 +0000
- Subject: [Bug c++/54574] G++ accepts parameters with wrong types in parent constructor
- Auto-submitted: auto-generated
- References: <bug-54574-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54574
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |egallager at gcc dot gnu.org
Resolution|--- |WORKSFORME
--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
gcc8 errors as you expected it to:
$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic 54574.cc
54574.cc: In instantiation of ‘A<T>::A(int*) [with T = int]’:
54574.cc:16:13: required from here
54574.cc:11:13: error: no matching function for call to ‘C::C(int*&)’
: C (Items) { // C is called with wrong parameter type, expects int**
^
54574.cc:4:3: note: candidate: ‘C::C(int**)’
C (int* Items[]);
^
54574.cc:4:3: note: no known conversion for argument 1 from ‘int*’ to ‘int**’
54574.cc:1:7: note: candidate: ‘constexpr C::C(const C&)’
class C
^
54574.cc:1:7: note: no known conversion for argument 1 from ‘int*’ to ‘const
C&’
54574.cc:1:7: note: candidate: ‘constexpr C::C(C&&)’
54574.cc:1:7: note: no known conversion for argument 1 from ‘int*’ to ‘C&&’
$