public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58708] New: string literal operator templates broken
@ 2013-10-12 22:22 mustrumr97 at gmail dot com
2013-10-13 19:53 ` [Bug c++/58708] " mustrumr97 at gmail dot com
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: mustrumr97 at gmail dot com @ 2013-10-12 22:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58708
Bug ID: 58708
Summary: string literal operator templates broken
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mustrumr97 at gmail dot com
The character type should be unqualified (char32_t instead of const char32_t).
Wide character types are broken.
U"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58708] string literal operator templates broken
2013-10-12 22:22 [Bug c++/58708] New: string literal operator templates broken mustrumr97 at gmail dot com
@ 2013-10-13 19:53 ` mustrumr97 at gmail dot com
2013-10-13 20:14 ` 3dw4rd at verizon dot net
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: mustrumr97 at gmail dot com @ 2013-10-13 19:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58708
--- Comment #1 from Hristo Venev <mustrumr97 at gmail dot com> ---
Obviously bugzilla doesn't like unicode.
U"\x10000\x10001\x10002"
current: <const char32_t, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02,
0x00, 0x01, 0x00>
expected: <char32_t, 0x10000, 0x10001, 0x10002>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58708] string literal operator templates broken
2013-10-12 22:22 [Bug c++/58708] New: string literal operator templates broken mustrumr97 at gmail dot com
2013-10-13 19:53 ` [Bug c++/58708] " mustrumr97 at gmail dot com
@ 2013-10-13 20:14 ` 3dw4rd at verizon dot net
2013-10-14 6:41 ` mustrumr97 at gmail dot com
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: 3dw4rd at verizon dot net @ 2013-10-13 20:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58708
--- Comment #2 from Ed Smith-Rowland <3dw4rd at verizon dot net> ---
Hristo,
Thanks for finishing your thought.
So if i have:
template<typename CharT, CharT... str>
void
operator""_foo
{
ChatT arr[]{str...};
}
U"\x10000\x10001\x10002"_foo;
I should see this right?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58708] string literal operator templates broken
2013-10-12 22:22 [Bug c++/58708] New: string literal operator templates broken mustrumr97 at gmail dot com
2013-10-13 19:53 ` [Bug c++/58708] " mustrumr97 at gmail dot com
2013-10-13 20:14 ` 3dw4rd at verizon dot net
@ 2013-10-14 6:41 ` mustrumr97 at gmail dot com
2013-10-17 6:53 ` 3dw4rd at verizon dot net
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: mustrumr97 at gmail dot com @ 2013-10-14 6:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58708
--- Comment #3 from Hristo Venev <mustrumr97 at gmail dot com> ---
#include <iostream>
template<typename CharT, CharT... str>
void operator""_foo(){
CharT arr[]{str...};
for(CharT i:arr) std::cout<<(int)i<<' ';
}
int main(){
U"\x10000\x10001\x10002"_foo;
}
Current output: "0 0 1 0 1 0 1 0 2 0 1 0 0 0 0 "
Expected output: "65536 65537 65538 "
Without the \0, char32_t's instead of bytes.
The author of the paper intended CharT to be unqualified.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58708] string literal operator templates broken
2013-10-12 22:22 [Bug c++/58708] New: string literal operator templates broken mustrumr97 at gmail dot com
` (2 preceding siblings ...)
2013-10-14 6:41 ` mustrumr97 at gmail dot com
@ 2013-10-17 6:53 ` 3dw4rd at verizon dot net
2013-10-18 7:52 ` mustrumr97 at gmail dot com
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: 3dw4rd at verizon dot net @ 2013-10-17 6:53 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58708
--- Comment #7 from Ed Smith-Rowland <3dw4rd at verizon dot net> ---
Created attachment 31024
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31024&action=edit
Busybox to play with patched g++.
I get:
ed@bad-horse:~/tr2$ ./pr58708
0 0 0 1
0 0 0 0
65536 65537 65538
1 0 0 0
0 0 0 0
97 98 99 100 101 102 103 104
0 1 0 0
0 0 0 0
97 98 99 100 101 102 103 104
0 1 0 0
0 0 0 0
16909060 84281096
0 0 1 0
0 0 0 0
258 772 1286 1800
0 0 0 1
0 0 0 0
16909060 84281096
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58708] string literal operator templates broken
2013-10-12 22:22 [Bug c++/58708] New: string literal operator templates broken mustrumr97 at gmail dot com
` (3 preceding siblings ...)
2013-10-17 6:53 ` 3dw4rd at verizon dot net
@ 2013-10-18 7:52 ` mustrumr97 at gmail dot com
2013-11-02 9:32 ` paolo.carlini at oracle dot com
2014-01-30 19:44 ` rsandifo at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: mustrumr97 at gmail dot com @ 2013-10-18 7:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58708
--- Comment #8 from Hristo Venev <mustrumr97 at gmail dot com> ---
That bug's fixed for me.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58708] string literal operator templates broken
2013-10-12 22:22 [Bug c++/58708] New: string literal operator templates broken mustrumr97 at gmail dot com
` (4 preceding siblings ...)
2013-10-18 7:52 ` mustrumr97 at gmail dot com
@ 2013-11-02 9:32 ` paolo.carlini at oracle dot com
2014-01-30 19:44 ` rsandifo at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-11-02 9:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58708
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |4.9.0
--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/58708] string literal operator templates broken
2013-10-12 22:22 [Bug c++/58708] New: string literal operator templates broken mustrumr97 at gmail dot com
` (5 preceding siblings ...)
2013-11-02 9:32 ` paolo.carlini at oracle dot com
@ 2014-01-30 19:44 ` rsandifo at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2014-01-30 19:44 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58708
--- Comment #11 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Author: rsandifo
Date: Thu Jan 30 19:44:06 2014
New Revision: 207320
URL: http://gcc.gnu.org/viewcvs?rev=207320&root=gcc&view=rev
Log:
gcc/cp/
PR c++/58708
* parser.c (make_string_pack): Use double_int::from_buffer.
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-01-30 19:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-12 22:22 [Bug c++/58708] New: string literal operator templates broken mustrumr97 at gmail dot com
2013-10-13 19:53 ` [Bug c++/58708] " mustrumr97 at gmail dot com
2013-10-13 20:14 ` 3dw4rd at verizon dot net
2013-10-14 6:41 ` mustrumr97 at gmail dot com
2013-10-17 6:53 ` 3dw4rd at verizon dot net
2013-10-18 7:52 ` mustrumr97 at gmail dot com
2013-11-02 9:32 ` paolo.carlini at oracle dot com
2014-01-30 19:44 ` rsandifo at gcc dot gnu.org
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).