This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Constructor is private within this context for gcc 3.0.3
- From: "sumesh" <sumesh_uk at hotmail dot com>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Tue, 29 Jan 2002 11:59:23 -0500
- Subject: Re: Constructor is private within this context for gcc 3.0.3
- References: <02Jan29.123859cet.115201@fullmoon.ensi.net>
Hi
Iam looking at the alias analysis done by GCC . Can any one tell me if
there is any option gcc has using which i can obtain the output of alias
analysis of a program .
Also any pointers on what kind of alias analysis does gcc use ,its
algorithm??
sumesh
----- Original Message -----
From: "Jacek Sokulski" <jacek@lefthand.com.pl>
To: <gcc-help@gcc.gnu.org>
Sent: Tuesday, January 29, 2002 6:41 AM
Subject: Constructor is private within this context for gcc 3.0.3
> I encountered a problem with private constructors in the following code:
>
> class Input
> {
>
> public:
>
> explicit
> Input() {};
> Input(const char* Id) {};
> void test(const Input& xs){}
> private:
> Input(const Input&);
> };
> int
> main()
> {
> Input input;
> input.test(input);// This is OK.
> input.test("abc"); // Here we have the problem!
> return 0;
> }
>
> Previous version (2.96) of gcc compiles it without problems but 3.0.3
> outputs the error message:
>
> test_gcc.cc: In function `int main()':
> test_gcc.cc:11: `Input::Input(const Input&)' is private
> test_gcc.cc:18: within this context
> test_gcc.cc:18: initializing argument 1 of `void Input::test(const
> Input&)'
> from result of `Input::Input(const char*)'
>
> Can anyone help me?
> Jacek
>
>