https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86730

            Bug ID: 86730
           Summary: use of deleted copy constructor (I am not using it)
           Product: gcc
           Version: 7.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asif_bahrainwala at hotmail dot com
  Target Milestone: ---

gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0

//Below code does not compile, I am not using the copy constructor, it seems to
work fine in Vs2013, CLANG (experimental P1144), tested using
https://godbolt.org/


struct A1{
  A1(int y){}
  A1(const A1 &a1)=delete;
};

int main()
{
    A1 a1_=6;
    A1 a1(5);
}

gcc main.cpp 
main.cpp: In function ‘int main()’:
main.cpp:8:12: error: use of deleted function ‘A1::A1(const A1&)’
     A1 a1_=6;
            ^
main.cpp:3:3: note: declared here
   A1(const A1 &a1)=delete;
   ^~
main.cpp:2:3: note:   after user-defined conversion: A1::A1(int)
   A1(int y){}

Reply via email to