public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/41426] User defined conversion on return ignores array types
[not found] <bug-41426-4@http.gcc.gnu.org/bugzilla/>
@ 2011-07-14 16:05 ` ville.voutilainen at gmail dot com
0 siblings, 0 replies; only message in thread
From: ville.voutilainen at gmail dot com @ 2011-07-14 16:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41426
Ville Voutilainen <ville.voutilainen at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ville.voutilainen at gmail
| |dot com
--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> 2011-07-14 16:04:11 UTC ---
gcc 4.7 (trunk) still behaves this way. An example snippet
was provided for me:
struct v
{
template<unsigned N>
v( const char(&)[N] ){}
};
v foo( )
{
return "Hello WOrld"; // #1
}
int main ( )
{
v x("hello world"); // #2
}
in that snippet, #1 is rejected with
error: could not convert ‘(const char*)"Hello WOrld"’ from ‘const char*’ to ‘v’
Explicit construction of v in foo() works.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-07-14 16:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-41426-4@http.gcc.gnu.org/bugzilla/>
2011-07-14 16:05 ` [Bug c++/41426] User defined conversion on return ignores array types ville.voutilainen at gmail dot com
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).