This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81394] New: wrong "useless cast" message in inheriting constructor
- From: "f dot heckenbach at fh-soft dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 11 Jul 2017 12:10:49 +0000
- Subject: [Bug c++/81394] New: wrong "useless cast" message in inheriting constructor
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81394
Bug ID: 81394
Summary: wrong "useless cast" message in inheriting constructor
Product: gcc
Version: 6.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: f.heckenbach@fh-soft.de
Target Milestone: ---
% cat t.cpp
struct a
{
template <typename T> a (T && v) { }
};
struct b: a
{
using a::a;
};
int main ()
{
b { "foo" };
}
% g++ -Wuseless-cast t.cpp
t.cpp: In constructor 'b::b(T&&) [with T = const char (&)[4]]':
t.cpp:8:12: warning: useless cast to type 'const char (&)[4]' [-Wuseless-cast]
using a::a;
^
t.cpp: In function 'int main()':
t.cpp:13:13: note: synthesized method 'b::b(T&&) [with T = const char (&)[4]]'
first required here
b { "foo" };
^