http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57211



             Bug #: 57211

           Summary: wrong line indicated in warning for synthesized method

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: d...@gcc.gnu.org





seen at least in 4.6, 4.7, 4.8 and trunk:



$ g++-4.8 -c -std=c++11 -Wunused-parameter  test.cpp

test.cpp:3:8: warning: unused parameter 'p' [-Wunused-parameter]

 struct A  // line pointed-to by warning

        ^

test.cpp: In function 'int main()':

test.cpp:21:11: note: synthesized method 'A& A::operator=(A&&)' first required

here 

         b = std::move(a);

           ^



$ cat test.cpp 

#include <functional>



struct A  // line pointed-to by warning

{

        struct B

        {

                B& operator=(B&&) { return *this; }

        };



        B f;



        A() = default;

        A& operator=(A&& p) = default;  // where the method is declared

};



int main()

{

        A a;

        A b;



        b = std::move(a);

}

Reply via email to