public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/62082] New: cout fails to work with auto variable initialized with curvy brackets
@ 2014-08-10 14:44 aleksej.penkov at hotmail dot com
  2014-08-10 16:57 ` [Bug libstdc++/62082] " daniel.kruegler at googlemail dot com
  2014-08-11 10:16 ` aleksej.penkov at hotmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: aleksej.penkov at hotmail dot com @ 2014-08-10 14:44 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3471 bytes --]

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

            Bug ID: 62082
           Summary: cout fails to work with auto variable initialized with
                    curvy brackets
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aleksej.penkov at hotmail dot com

This simple code (compiled with -std=c++11 -Wall):
#include <iostream>

int main()
{
    double d = 5.5;
    auto a {d};

    std::cout<<d<<' '<<a<<std::endl;
}

gives this compilation error:
2.cpp: In function ‘int main()’:
2.cpp:8:14: error: cannot bind ‘std::basic_ostream<char>’ lvalue to
‘std::basic_ostream<char>&&’
  std::cout<<d<<' '<<a<<std::endl;
              ^
In file included from /usr/local/include/c++/4.9.1/iostream:39:0,
                 from 2.cpp:1:
/usr/local/include/c++/4.9.1/ostream:602:5: note: initializing argument 1 of
‘std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT
= char; _Traits = std::char_traits<char>; _Tp = std::initializer_list<double>]’
     operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
     ^

If i replace
auto a {d};
with
auto a = d;

it works fine.
>From gcc-bugs-return-458112-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Aug 10 14:46:18 2014
Return-Path: <gcc-bugs-return-458112-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10232 invoked by alias); 10 Aug 2014 14:46:18 -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 10214 invoked by uid 48); 10 Aug 2014 14:46:13 -0000
From: "aleksej.penkov at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/62082] cout fails to work with auto variable initialized with curvy brackets
Date: Sun, 10 Aug 2014 14:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.9.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: aleksej.penkov at hotmail dot com
X-Bugzilla-Status: UNCONFIRMED
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: attachments.created
Message-ID: <bug-62082-4-MtZiKH30Sv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-62082-4@http.gcc.gnu.org/bugzilla/>
References: <bug-62082-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-08/txt/msg00609.txt.bz2
Content-length: 240

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

--- Comment #1 from Aleksej <aleksej.penkov at hotmail dot com> ---
Created attachment 33284
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id3284&actioníit
source file with issue


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

* [Bug libstdc++/62082] cout fails to work with auto variable initialized with curvy brackets
  2014-08-10 14:44 [Bug libstdc++/62082] New: cout fails to work with auto variable initialized with curvy brackets aleksej.penkov at hotmail dot com
@ 2014-08-10 16:57 ` daniel.kruegler at googlemail dot com
  2014-08-11 10:16 ` aleksej.penkov at hotmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-08-10 16:57 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3887 bytes --]

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The error is not a symptom of a library implementation error. Instead, the
reason for this compile-error is, that

auto a {d};

defines an object a of type

std::initializer_list<double> 

and there does not exist any IO inserter for such types. When you declare

auto a = d;

this defines an object a of type

double

Therefore I consider this bug report as invalid.
>From gcc-bugs-return-458120-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Aug 10 17:00:54 2014
Return-Path: <gcc-bugs-return-458120-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5864 invoked by alias); 10 Aug 2014 17:00:54 -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 5838 invoked by uid 48); 10 Aug 2014 17:00:50 -0000
From: "j at uriah dot heep.sax.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/62084] New: [avr] ICE: in convert_debug_memory_address
Date: Sun, 10 Aug 2014 17:00:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: j at uriah dot heep.sax.de
X-Bugzilla-Status: UNCONFIRMED
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_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created
Message-ID: <bug-62084-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-08/txt/msg00617.txt.bz2
Content-length: 1247

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

            Bug ID: 62084
           Summary: [avr] ICE: in convert_debug_memory_address
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: j at uriah dot heep.sax.de

Created attachment 33286
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id3286&actioníit
Preprocessed source triggering the issue

When compiling the SVN version of avr-libc, I get the following ICE:

% env LANG=C avr-gcc -gdwarf-2 -Wall -W -Wstrict-prototypes -mmcu=avr2
-mcall-prologues -Os -S strftime.i
../../../libc/time/strftime.c: In function 'pgm_copystring':
../../../libc/time/strftime.c:56:1: internal compiler error: in
convert_debug_memory_address, at cfgexpand.c:2528
 pgm_copystring(const char __memx * p, unsigned char i, char *b, unsigned char
l)
 ^
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

This can also be observed with GCC 4.8.3.

Omitting the -gdwarf-2 option makes the issue go away.


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

* [Bug libstdc++/62082] cout fails to work with auto variable initialized with curvy brackets
  2014-08-10 14:44 [Bug libstdc++/62082] New: cout fails to work with auto variable initialized with curvy brackets aleksej.penkov at hotmail dot com
  2014-08-10 16:57 ` [Bug libstdc++/62082] " daniel.kruegler at googlemail dot com
@ 2014-08-11 10:16 ` aleksej.penkov at hotmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: aleksej.penkov at hotmail dot com @ 2014-08-11 10:16 UTC (permalink / raw)
  To: gcc-bugs

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

Aleksej <aleksej.penkov at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID
           Severity|normal                      |trivial

--- Comment #3 from Aleksej <aleksej.penkov at hotmail dot com> ---
Not a bug according to the note from Daniel Krügler.
>From gcc-bugs-return-458148-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Aug 11 10:16:28 2014
Return-Path: <gcc-bugs-return-458148-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16807 invoked by alias); 11 Aug 2014 10:16:27 -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 16754 invoked by uid 48); 11 Aug 2014 10:16:20 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60228] ICE using lambda in #pragma omp declare reduction
Date: Mon, 11 Aug 2014 10:16: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.9.0
X-Bugzilla-Keywords: ice-on-valid-code, openmp
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
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-60228-4-jaDsK2oxxC@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60228-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60228-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-08/txt/msg00645.txt.bz2
Content-length: 257

https://gcc.gnu.org/bugzilla/show_bug.cgi?id`228

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I would not call this valid, because OpenMP 4.0 doesn't support C++11, thus
using C++11 constructs inside of OpenMP constructs is invalid.


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

end of thread, other threads:[~2014-08-11 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-10 14:44 [Bug libstdc++/62082] New: cout fails to work with auto variable initialized with curvy brackets aleksej.penkov at hotmail dot com
2014-08-10 16:57 ` [Bug libstdc++/62082] " daniel.kruegler at googlemail dot com
2014-08-11 10:16 ` aleksej.penkov at hotmail 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).