public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58781] New: Unicode strings broken in a strange way
@ 2013-10-18  8:08 mustrumr97 at gmail dot com
  2013-10-21 16:37 ` [Bug c++/58781] " 3dw4rd at verizon dot net
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: mustrumr97 at gmail dot com @ 2013-10-18  8:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58781
           Summary: Unicode strings broken in a strange way
           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

#include <cstddef>
int operator""_s(const char32_t *a, size_t b){
    return 0;
}
int f(){
    using a=decltype(U"\x1181"_s);
    using b=decltype(U"\x8111"_s);
    using c=decltype(U" \x1181"_s);
}
On the lines defining b and c:
error: converting to execution character set: Invalid or incomplete multibyte
or wide character

- The expression must be inside decltype()
- The expression must have a suffix
- The hex escape sequence must have a digit >= 8 at some specific places. The
places depend on the length of the escape sequence and if there are surrounding
characters.
- The same happens if there's a unicode character instead of an escape
sequence.


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

* [Bug c++/58781] Unicode strings broken in a strange way
  2013-10-18  8:08 [Bug c++/58781] New: Unicode strings broken in a strange way mustrumr97 at gmail dot com
@ 2013-10-21 16:37 ` 3dw4rd at verizon dot net
  2013-10-21 18:13 ` 3dw4rd at verizon dot net
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: 3dw4rd at verizon dot net @ 2013-10-21 16:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Ed Smith-Rowland <3dw4rd at verizon dot net> ---
Created attachment 31061
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31061&action=edit
Busybox showing that the passed in string to the operator is OK.

When I run the busybox I get:
[ed@localhost ~]$ /home/ed/bin/bin/g++ -std=c++11 -o test_pr58781
test_pr58781.cpp
[ed@localhost ~]$ ./test_pr58781 
1
0x400cd0
 0x1181
0x1
0x400cd8
 0x8111
0x2
0x400ce0
 0x20
 0x1181

String literals work.

I'll look at how decltype works.

The result of these decltypes should be 'int'.


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

* [Bug c++/58781] Unicode strings broken in a strange way
  2013-10-18  8:08 [Bug c++/58781] New: Unicode strings broken in a strange way mustrumr97 at gmail dot com
  2013-10-21 16:37 ` [Bug c++/58781] " 3dw4rd at verizon dot net
@ 2013-10-21 18:13 ` 3dw4rd at verizon dot net
  2013-10-21 20:25 ` 3dw4rd at verizon dot net
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: 3dw4rd at verizon dot net @ 2013-10-21 18:13 UTC (permalink / raw)
  To: gcc-bugs

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

Ed Smith-Rowland <3dw4rd at verizon dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31061|0                           |1
        is obsolete|                            |

--- Comment #2 from Ed Smith-Rowland <3dw4rd at verizon dot net> ---
Created attachment 31064
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31064&action=edit
If decltype of user-defined lieteral of a function call could res


Question: Does the decltype problem happen with user-defined numeric literals?
Answer: No.

Question: If I call the operator""_s explicitly in decltype is there a problem?
Answer: No.

Remaining questions...

Question #1: Is this a regression?  There was work for decltype(auto).

Question #2: in cp_parser_decltype_expr what path should be taken for a normal
function call?


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

* [Bug c++/58781] Unicode strings broken in a strange way
  2013-10-18  8:08 [Bug c++/58781] New: Unicode strings broken in a strange way mustrumr97 at gmail dot com
  2013-10-21 16:37 ` [Bug c++/58781] " 3dw4rd at verizon dot net
  2013-10-21 18:13 ` 3dw4rd at verizon dot net
@ 2013-10-21 20:25 ` 3dw4rd at verizon dot net
  2013-10-30 13:32 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: 3dw4rd at verizon dot net @ 2013-10-21 20:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Ed Smith-Rowland <3dw4rd at verizon dot net> ---
Q; Is this a regression?
A: No.

See http://ideone.com/8JS3Yf
This is gcc-4.8.1 (needed a space between "" and _s but still errors with this:
-----------------------------------------------------------
prog.cpp: In function ‘int f()’:
prog.cpp:7:22: error: converting to execution character set: Invalid or
incomplete multibyte or wide character
     using b=decltype(U"\x8111"_s);
                      ^
prog.cpp:8:22: error: converting to execution character set: Invalid or
incomplete multibyte or wide character
     using c=decltype(U" \x1181"_s);
                      ^
-----------------------------------------------------------
>From gcc-bugs-return-432398-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 21 20:33:30 2013
Return-Path: <gcc-bugs-return-432398-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18526 invoked by alias); 21 Oct 2013 20:33:30 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 18492 invoked by uid 48); 21 Oct 2013 20:33:25 -0000
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/57983] cmakefiles/opencv_perf_gpu.dir
Date: Mon, 21 Oct 2013 20:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.6.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: blocker
X-Bugzilla-Who: mpolacek at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cc resolution
Message-ID: <bug-57983-4-WJoJmgvbWP@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57983-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57983-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-10/txt/msg01542.txt.bz2
Content-length: 520

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW983

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
                 CC|                            |mpolacek at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Testcase not coming.


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

* [Bug c++/58781] Unicode strings broken in a strange way
  2013-10-18  8:08 [Bug c++/58781] New: Unicode strings broken in a strange way mustrumr97 at gmail dot com
                   ` (2 preceding siblings ...)
  2013-10-21 20:25 ` 3dw4rd at verizon dot net
@ 2013-10-30 13:32 ` redi at gcc dot gnu.org
  2014-06-27 21:04 ` 3dw4rd at verizon dot net
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2013-10-30 13:32 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-10-30
     Ever confirmed|0                           |1


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

* [Bug c++/58781] Unicode strings broken in a strange way
  2013-10-18  8:08 [Bug c++/58781] New: Unicode strings broken in a strange way mustrumr97 at gmail dot com
                   ` (3 preceding siblings ...)
  2013-10-30 13:32 ` redi at gcc dot gnu.org
@ 2014-06-27 21:04 ` 3dw4rd at verizon dot net
  2014-07-01  3:14 ` emsr at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: 3dw4rd at verizon dot net @ 2014-06-27 21:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58781

--- Comment #4 from Ed Smith-Rowland <3dw4rd at verizon dot net> ---
Created attachment 33021
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33021&action=edit
Patch 58781, 59867, 60249, ..

I think I got it.

Don't mess with the token stream.

PR C++/58781 - Unicode strings broken in a strange way
PR C++/59867 - Template string literal loses first symbol
PR C++/60249 - Compiler goes into semi-infinite loop with wrong usage of user
defined string literals
Plus I fixed an misleading error message for string literal operator templates
(not available in C++11).


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

* [Bug c++/58781] Unicode strings broken in a strange way
  2013-10-18  8:08 [Bug c++/58781] New: Unicode strings broken in a strange way mustrumr97 at gmail dot com
                   ` (4 preceding siblings ...)
  2014-06-27 21:04 ` 3dw4rd at verizon dot net
@ 2014-07-01  3:14 ` emsr at gcc dot gnu.org
  2014-07-01  5:31 ` emsr at gcc dot gnu.org
  2014-07-01  5:33 ` emsr at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: emsr at gcc dot gnu.org @ 2014-07-01  3:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58781

--- Comment #5 from emsr at gcc dot gnu.org ---
Author: emsr
Date: Tue Jul  1 03:13:17 2014
New Revision: 212186

URL: https://gcc.gnu.org/viewcvs?rev=212186&root=gcc&view=rev
Log:
cp/

2014-06-28  Edward Smith-Rowland  <3dw4rd@verizon.net>

    PR c++/58781
    PR c++/60249
    PR c++/59867
    * parser.c (cp_parser_userdef_string_literal()): Take a tree
    not a cp_token*. (cp_parser_string_literal(): Don't hack
    the token stream!


testsuite/

2014-06-28  Edward Smith-Rowland  <3dw4rd@verizon.net>

    PR c++/58781
    PR c++/60249
    PR c++/59867
    * testsuite/g++.dg/cpp0x/pr58781.C: New.
    * testsuite/g++.dg/cpp0x/pr60249.C: New.
    * testsuite/g++.dg/cpp1y/pr59867.C: New.



Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr58781.C
    trunk/gcc/testsuite/g++.dg/cpp0x/pr60249.C
    trunk/gcc/testsuite/g++.dg/cpp1y/pr59867.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/58781] Unicode strings broken in a strange way
  2013-10-18  8:08 [Bug c++/58781] New: Unicode strings broken in a strange way mustrumr97 at gmail dot com
                   ` (5 preceding siblings ...)
  2014-07-01  3:14 ` emsr at gcc dot gnu.org
@ 2014-07-01  5:31 ` emsr at gcc dot gnu.org
  2014-07-01  5:33 ` emsr at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: emsr at gcc dot gnu.org @ 2014-07-01  5:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58781

--- Comment #6 from emsr at gcc dot gnu.org ---
Author: emsr
Date: Tue Jul  1 05:30:34 2014
New Revision: 212188

URL: https://gcc.gnu.org/viewcvs?rev=212188&root=gcc&view=rev
Log:
cp/

2014-06-28  Edward Smith-Rowland  <3dw4rd@verizon.net>

    PR c++/58781
    PR c++/60249
    PR c++/59867
    * parser.c (cp_parser_userdef_string_literal()): Take a tree
    not a cp_token*. (cp_parser_string_literal(): Don't hack
    the token stream!

testsuite/

2014-06-28  Edward Smith-Rowland  <3dw4rd@verizon.net>

    PR c++/58781
    PR c++/60249
    PR c++/59867
    * testsuite/g++.dg/cpp0x/pr58781.C: New.
    * testsuite/g++.dg/cpp0x/pr60249.C: New.
    * testsuite/g++.dg/cpp1y/pr59867.C: New.


Added:
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/pr58781.C
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/pr60249.C
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp1y/pr59867.C
Modified:
    branches/gcc-4_9-branch/gcc/cp/ChangeLog
    branches/gcc-4_9-branch/gcc/cp/parser.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


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

* [Bug c++/58781] Unicode strings broken in a strange way
  2013-10-18  8:08 [Bug c++/58781] New: Unicode strings broken in a strange way mustrumr97 at gmail dot com
                   ` (6 preceding siblings ...)
  2014-07-01  5:31 ` emsr at gcc dot gnu.org
@ 2014-07-01  5:33 ` emsr at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: emsr at gcc dot gnu.org @ 2014-07-01  5:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58781

emsr at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |emsr at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #7 from emsr at gcc dot gnu.org ---
Fixed.


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

end of thread, other threads:[~2014-07-01  5:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-18  8:08 [Bug c++/58781] New: Unicode strings broken in a strange way mustrumr97 at gmail dot com
2013-10-21 16:37 ` [Bug c++/58781] " 3dw4rd at verizon dot net
2013-10-21 18:13 ` 3dw4rd at verizon dot net
2013-10-21 20:25 ` 3dw4rd at verizon dot net
2013-10-30 13:32 ` redi at gcc dot gnu.org
2014-06-27 21:04 ` 3dw4rd at verizon dot net
2014-07-01  3:14 ` emsr at gcc dot gnu.org
2014-07-01  5:31 ` emsr at gcc dot gnu.org
2014-07-01  5:33 ` emsr 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).