public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/64831] New: Preprocessing # operator with C++11 user-defined literal produces bad output
@ 2015-01-28 11:34 holger.grund@ix-n.net
  2015-01-28 12:25 ` [Bug preprocessor/64831] " redi at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: holger.grund@ix-n.net @ 2015-01-28 11:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64831
           Summary: Preprocessing # operator with C++11 user-defined
                    literal produces bad output
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: holger.grund@ix-n.net

$ cat t.cpp
#define S1(a) S2(a)
#define S2(a) #a

void foo()
{
  S1("bla"_udl);
}

$ c++ t.cpp -E -P
void foo()
{
  "\"bla\"_udl";
}

$ c++ t.cpp -E -P -std=c++11
void foo()
{
  ""bla"_udl";
}

Feeding the resulting output from c++11 mode into the compiler gives an error:
$ c++ t.cpp -E -P  | c++ -c -xc++ -std=c++11 -
$ c++ t.cpp -E -P -std=c++11 | c++ -c -xc++ -std=c++11 -
<stdin>: In function ‘void foo()’:
<stdin>:3:8: error: unable to find string literal operator ‘operator""bla’

This breaks https://github.com/icecc/icecream for remote compilation.
>From gcc-bugs-return-475218-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 28 11:35:15 2015
Return-Path: <gcc-bugs-return-475218-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 29852 invoked by alias); 28 Jan 2015 11:35:15 -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 29741 invoked by uid 48); 28 Jan 2015 11:35:11 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/64829] [ARM] ICE at -O3 in vect_get_vec_def_for_stmt_copy
Date: Wed, 28 Jan 2015 11:35:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
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:
Message-ID: <bug-64829-4-wERR1V2QjO@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64829-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64829-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: 2015-01/txt/msg03212.txt.bz2
Content-length: 1768

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd829

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Doesn't reproduce with a cross from x86_64-linux on trunk.

> ./xgcc -B. t.c -O3 -v -Wall
Reading specs from ./specs
COLLECT_GCC=./xgcc
COLLECT_LTO_WRAPPER=./lto-wrapper
Target: arm-none-linux-gnueabihf
Configured with: /space/rguenther/src/svn/trunk2/configure
--target=arm-none-linux-gnueabihf --with-mode=arm --with-cpu=cortex-a9
--with-fpu=neon
...
t.c: In function ?fail?:
t.c:55:19: warning: ?val2? may be used uninitialized in this function
[-Wmaybe-uninitialized]
   result += (val2 - val1) * interpFrac2;
                   ^
t.c:55:19: warning: ?val1? may be used uninitialized in this function
[-Wmaybe-uninitialized]
t.c:55:27: warning: ?interpFrac2? may be used uninitialized in this function
[-Wmaybe-uninitialized]
   result += (val2 - val1) * interpFrac2;
                           ^
t.c:56:19: warning: ?val3? may be used uninitialized in this function
[-Wmaybe-uninitialized]
   result += (val3 - val2) * interpFrac3;
                   ^
t.c:56:27: warning: ?interpFrac3? may be used uninitialized in this function
[-Wmaybe-uninitialized]
   result += (val3 - val2) * interpFrac3;
                           ^
t.c:54:27: warning: ?interpFrac1? may be used uninitialized in this function
[-Wmaybe-uninitialized]
   result += (val1 - val0) * interpFrac1;
                           ^
COLLECT_GCC_OPTIONS='-B' '.' '-O3' '-v' '-Wall' '-mcpu=cortex-a9' '-mfpu=neon'
'-marm' '-mtls-dialect=gnu'
 ./as -v -mcpu=cortex-a9 -mfpu=neon -meabi=5 -o /tmp/cciyGoik.o /tmp/cc4vjgVC.s
./as: line 106: exec: -v: invalid option
exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]


are you sure it isn't already fixed?


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

* [Bug preprocessor/64831] Preprocessing # operator with C++11 user-defined literal produces bad output
  2015-01-28 11:34 [Bug preprocessor/64831] New: Preprocessing # operator with C++11 user-defined literal produces bad output holger.grund@ix-n.net
@ 2015-01-28 12:25 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2015-01-28 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |5.0

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Already fixed on trunk:

$ ~/gcc/5/bin/g++ -std=c++11 -E -P udl.cc
void foo()
{
  "\"bla\"_udl";
}


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

end of thread, other threads:[~2015-01-28 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-28 11:34 [Bug preprocessor/64831] New: Preprocessing # operator with C++11 user-defined literal produces bad output holger.grund@ix-n.net
2015-01-28 12:25 ` [Bug preprocessor/64831] " redi 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).