public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14213] strange behavior with private cp-cstr...
       [not found] <20040219170343.14213.pluto@pld-linux.org>
  2004-08-27  8:46 ` [Bug c++/14213] strange behavior with private cp-cstr pinskia at gcc dot gnu dot org
@ 2004-08-27  8:46 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-27  8:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-27 08:46 -------
bug 12226.

*** This bug has been marked as a duplicate of 12226 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/14213] strange behavior with private cp-cstr...
       [not found] <20040219170343.14213.pluto@pld-linux.org>
@ 2004-08-27  8:46 ` pinskia at gcc dot gnu dot org
  2004-08-27  8:46 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-27  8:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-27 08:46 -------
Reopening to mark as dup of ...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/14213] strange behavior with private cp-cstr...
  2004-02-19 17:03 [Bug c++/14213] New: " pluto at ds14 dot agh dot edu dot pl
                   ` (2 preceding siblings ...)
  2004-02-20  6:43 ` pluto at ds14 dot agh dot edu dot pl
@ 2004-02-20 10:13 ` pluto at ds14 dot agh dot edu dot pl
  3 siblings, 0 replies; 6+ messages in thread
From: pluto at ds14 dot agh dot edu dot pl @ 2004-02-20 10:13 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 747 bytes --]


------- Additional Comments From pluto at ds14 dot agh dot edu dot pl  2004-02-20 10:13 -------
(In reply to comment #3) 
> (In reply to comment #2)  
> > When writing    
> >   A a2 = a1;   
> > this has the same requirements as using the   
> >   A a2(a1);   
> > syntax. Thus, the copy constructor needs to be accessible.   
> >    
> > W.   
>   
> Where exactly in the C++ draft is it written?  
 
ok, i found it. 
========================== 
12.8 Copying class objects 
 
class X { 
   //... 
public: 
 X(int); 
 X(const&, int =1); 
}; 
X a(1);  // calls X(int); 
X b(a,0); // calls X(const X&, int); 
X c = b; // calls X(const X&, int); 
======================== 
EOT. 

-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/14213] strange behavior with private cp-cstr...
  2004-02-19 17:03 [Bug c++/14213] New: " pluto at ds14 dot agh dot edu dot pl
  2004-02-19 17:15 ` [Bug c++/14213] " pinskia at gcc dot gnu dot org
  2004-02-19 18:27 ` bangerth at dealii dot org
@ 2004-02-20  6:43 ` pluto at ds14 dot agh dot edu dot pl
  2004-02-20 10:13 ` pluto at ds14 dot agh dot edu dot pl
  3 siblings, 0 replies; 6+ messages in thread
From: pluto at ds14 dot agh dot edu dot pl @ 2004-02-20  6:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pluto at ds14 dot agh dot edu dot pl  2004-02-20 06:43 -------
(In reply to comment #2) 
> When writing   
>   A a2 = a1;  
> this has the same requirements as using the  
>   A a2(a1);  
> syntax. Thus, the copy constructor needs to be accessible.  
>   
> W.  
 
Where exactly in the C++ draft is it written? 

-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/14213] strange behavior with private cp-cstr...
  2004-02-19 17:03 [Bug c++/14213] New: " pluto at ds14 dot agh dot edu dot pl
  2004-02-19 17:15 ` [Bug c++/14213] " pinskia at gcc dot gnu dot org
@ 2004-02-19 18:27 ` bangerth at dealii dot org
  2004-02-20  6:43 ` pluto at ds14 dot agh dot edu dot pl
  2004-02-20 10:13 ` pluto at ds14 dot agh dot edu dot pl
  3 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2004-02-19 18:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-02-19 18:27 -------
When writing  
  A a2 = a1; 
this has the same requirements as using the 
  A a2(a1); 
syntax. Thus, the copy constructor needs to be accessible. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/14213] strange behavior with private cp-cstr...
  2004-02-19 17:03 [Bug c++/14213] New: " pluto at ds14 dot agh dot edu dot pl
@ 2004-02-19 17:15 ` pinskia at gcc dot gnu dot org
  2004-02-19 18:27 ` bangerth at dealii dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-19 17:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-19 17:15 -------
I think this is not a bug as initiailizers are really called only with constructors but I have not looked at 
the standard to make sure that is true.

This is so someone can just copy and paste it as your bug report has non-breaking spaces in there.
#include <iostream>
using namespace std;
class A { 
public: 
    A()  { cout << "A::A()\n";  } 
    A &operator = (const A &obj) 
    { 
        cout << "A::operator = (const A &)\n"; 
        return *this; 
    } 
private: 
//public: 
    A(const A &obj) { cout << "A::A(const A &)\n"; } 
}; 
 
int main() 
{ 
    A a1; 
    A a2 = a1;
}

-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-27  8:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20040219170343.14213.pluto@pld-linux.org>
2004-08-27  8:46 ` [Bug c++/14213] strange behavior with private cp-cstr pinskia at gcc dot gnu dot org
2004-08-27  8:46 ` pinskia at gcc dot gnu dot org
2004-02-19 17:03 [Bug c++/14213] New: " pluto at ds14 dot agh dot edu dot pl
2004-02-19 17:15 ` [Bug c++/14213] " pinskia at gcc dot gnu dot org
2004-02-19 18:27 ` bangerth at dealii dot org
2004-02-20  6:43 ` pluto at ds14 dot agh dot edu dot pl
2004-02-20 10:13 ` pluto at ds14 dot agh dot edu dot pl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).