Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #11272
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Odd error I can't seem to recreate |
| Date | 2011-11-05 12:00 +1300 |
| Message-ID | <9hj94bF62fU6@mid.individual.net> (permalink) |
| References | <bbe45080-3e8d-4e2f-aefc-7ac0906a6872@s7g2000yqa.googlegroups.com> <e65d1df3-c094-463b-b46d-3d20e1000cbd@o5g2000yqa.googlegroups.com> |
On 11/ 5/11 09:15 AM, Noah Roberts wrote: > On Nov 4, 11:52 am, Noah Roberts<roberts.n...@gmail.com> wrote: > >> Under what conditions in which the first could work might the second >> not when the parameter is const ref? I can't think of any. > > Here's a further revision of the problem code: > <snip> > > The result of compilation and run without -DHUH: > > $ g++ wtf.cpp > $ ./a.out > derived::f() > > The result with -DHUH: > $ g++ -DHUH wtf.cpp > wtf.cpp: In function âint main()â: > wtf.cpp:14: error: âderived::derived(const derived&)â is private > wtf.cpp:47: error: within this context > > So it appears that the problem is with the temporary being created, > and that I don't understand. As far as I knew, const reference > allowed you to use the initially created temporary directly. Where's > the standard text that explains why it's doing this? Compiler bug? It compiles fine with gcc 4.5.1. -- Ian Collins
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Odd error I can't seem to recreate Noah Roberts <roberts.noah@gmail.com> - 2011-11-04 11:52 -0700
Re: Odd error I can't seem to recreate Victor Bazarov <v.bazarov@comcast.invalid> - 2011-11-04 15:49 -0400
Re: Odd error I can't seem to recreate Noah Roberts <roberts.noah@gmail.com> - 2011-11-04 12:58 -0700
Re: Odd error I can't seem to recreate Richard Damon <news.x.richarddamon@xoxy.net> - 2011-11-04 16:15 -0400
Re: Odd error I can't seem to recreate "Gennaro Prota" <gennaro.prota@gmail.com> - 2011-11-04 21:03 +0100
Re: Odd error I can't seem to recreate Noah Roberts <roberts.noah@gmail.com> - 2011-11-04 13:07 -0700
Re: Odd error I can't seem to recreate Victor Bazarov <v.bazarov@comcast.invalid> - 2011-11-04 16:43 -0400
Re: Odd error I can't seem to recreate Noah Roberts <roberts.noah@gmail.com> - 2011-11-04 13:56 -0700
Re: Odd error I can't seem to recreate "Gennaro Prota" <name.surname@gmail.com> - 2011-11-04 22:16 +0100
Re: Odd error I can't seem to recreate "Gennaro Prota" <gennaro.prota@gmail.com> - 2011-11-04 21:16 +0100
Re: Odd error I can't seem to recreate Noah Roberts <roberts.noah@gmail.com> - 2011-11-04 13:15 -0700
Re: Odd error I can't seem to recreate Ian Collins <ian-news@hotmail.com> - 2011-11-05 12:00 +1300
Re: Odd error I can't seem to recreate "Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com> - 2011-11-05 18:48 +0100
Re: Odd error I can't seem to recreate "Gennaro Prota" <name.surname@gmail.com> - 2011-11-05 22:35 +0100
csiph-web