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.heckenb...@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" };
             ^

Reply via email to