This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Constructor is private within this context for gcc 3.0.3


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
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]