This is the mail archive of the gcc-bugs@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] | |
Hello, Description of a problem: when you use reference to "const X *const" (for example reference to "const string *const" -- const pointer to const string) BUT you reference it to "just" object, without "const" (e.g. "string") the temporary object should be created. This is not a problem so far. The problem is that if reference is within class the temporary object IS created but within a function IS NOT created. See attached code -- I tried to make it as simple as it is possible. The result is that reference and pointer taken from class differs while from function don't. Even it were some rumours on Polish newsgroups about proper behaviour of reference (and need of creating temporary object), one thing is obvious -- the behaviour in both cases should be the same. Now tech info you asked for: a-c) see attachment d.1) gcc -v -save-temps -lstd++ ccref.cpp d.2) ./a.out e) none f) see attachment Attachment consists of files you asked for -- the "output" is output generated by GCC with option "-v". If it isn't a problem please mail me back -- I would like to know if I send this bug-report in proper way. Bye PS. In GCC 2.95.2 in both cases temporary object WAS NOT created (if it helps...). (See attached file: gcc.output.bz2)(See attached file: ccref.ii.bz2)(See attached file: ccref.s.bz2)(See attached file: ccref.cpp.bz2)
Attachment:
gcc.output.bz2
Description: Binary data
Attachment:
ccref.ii.bz2
Description: Binary data
Attachment:
ccref.s.bz2
Description: Binary data
Attachment:
ccref.cpp.bz2
Description: Binary data
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |