language: C++ 4.7.2 (gcc-4.7.2)
date: 831 days 3 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
 
using namespace std;
 
class A
{
public:
     A(){}
private:
     A(const A&) {}
};
 
//source of error : pass by value
void f(A) {}
 
int main() {
        A a;
        f(a);
        return 0;
}
prog.cpp: In function ‘int main()’:
prog.cpp:10: error: ‘A::A(const A&)’ is private
prog.cpp:18: error: within this context
prog.cpp:18: error:   initializing argument 1 of ‘void f(A)’