public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59867] New: Template string literal loses first symbol
@ 2014-01-17 22:42 i-hate-registration at mailinator dot com
  2014-01-18  7:31 ` [Bug c++/59867] " jakub at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: i-hate-registration at mailinator dot com @ 2014-01-17 22:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59867
           Summary: Template string literal loses first symbol
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: i-hate-registration at mailinator dot com

Created attachment 31880
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31880&action=edit
Template string literal works somehow strange in this example

Hi everyone,

When using a template string literal overload (template <class T, T... xs>) ,
for "123"_s, I get xs = {'2', '3'} instead of xs = {'1', '2', '3'}.

There's as minimal example as I could make in the attachment. When it's
compiled in its current way, it shows the following error:

> g++ -std=c++1y example.cpp -o example
example.cpp: In instantiation of ‘constexpr meta_array<T, xs ...>
operator""_s() [with T = char; T ...xs = {'2', '3'}]’:
example.cpp:40:44:   required from here
example.cpp:34:2: error: static assertion failed: What's wrong with you?
  static_assert(sizeof...(xs) == 3, "What's wrong with you?");
  ^

When I replace equality with inequality in static_assert:

> g++ -std=c++1y example.cpp -o example
example.cpp: In instantiation of ‘constexpr meta_array<T, xs ...>
operator""_s() [with T = char; T ...xs = {'1', '2', '3'}]’:
example.cpp:40:44:   required from here
example.cpp:35:2: error: static assertion failed: What's wrong with you?
  static_assert(sizeof...(xs) != 3, "What's wrong with you?");
  ^

As ""_s is used only once in the code and, I believe, there's no implicit way
it's called recursively, it looks like there's some kind of bug.

P.S. Thank you for the great work!
>From gcc-bugs-return-440792-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jan 17 22:43:38 2014
Return-Path: <gcc-bugs-return-440792-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 8928 invoked by alias); 17 Jan 2014 22:43:38 -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 8894 invoked by uid 55); 17 Jan 2014 22:43:35 -0000
From: "ian at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/59866] gccgo gc work buffer is misaligned
Date: Fri, 17 Jan 2014 22:43:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: go
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: critical
X-Bugzilla-Who: ian at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ian at airs dot com
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59866-4-9cYwz2XuxF@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59866-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59866-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: 2014-01/txt/msg01934.txt.bz2
Content-length: 384

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

--- Comment #2 from ian at gcc dot gnu.org <ian at gcc dot gnu.org> ---
Author: ian
Date: Fri Jan 17 22:43:03 2014
New Revision: 206738

URL: http://gcc.gnu.org/viewcvs?rev 6738&root=gcc&view=rev
Log:
    PR go/59866
runtime: Force work variable in mgc0 to be aligned on 8-byte boundary.

Modified:
    trunk/libgo/runtime/mgc0.c


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

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

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-17 22:42 [Bug c++/59867] New: Template string literal loses first symbol i-hate-registration at mailinator dot com
2014-01-18  7:31 ` [Bug c++/59867] " jakub at gcc dot gnu.org
2014-01-18  9:31 ` paolo.carlini at oracle dot com
2014-01-18  9:38 ` paolo.carlini at oracle dot com
2014-01-18  9:52 ` jakub at gcc dot gnu.org
2014-01-18 10:07 ` paolo.carlini at oracle dot com
2014-01-18 17:54 ` i-hate-registration at mailinator dot com
2014-01-19 17:06 ` 3dw4rd at verizon dot net
2014-01-21 20:00 ` 3dw4rd at verizon dot net
2014-06-27 21:03 ` 3dw4rd at verizon dot net
2014-06-27 21:03 ` 3dw4rd at verizon dot net
2014-07-01  3:13 ` 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).