public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40689] New: [C++0x]: error with initializer list in N2672
@ 2009-07-08 20:29 bernhard dot merkle at googlemail dot com
2009-07-08 20:30 ` [Bug c++/40689] " bernhard dot merkle at googlemail dot com
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: bernhard dot merkle at googlemail dot com @ 2009-07-08 20:29 UTC (permalink / raw)
To: gcc-bugs
Hi,
I think there is a bug in g++ 4.4 concerning the implementation of initializer
list. N2672
The following program does not compiles, but it should be accepted by g++.
// /opt/gcc-4.4/bin/g++ --std=c++0x -Wall
int main()
{
class X
{
public:
X(): data {1,2,3,4,5} {}
private:
const short data[5];
};
const float * pData = new const float[4] { 1.5, 2.5, 3.5, 4.5 };
return 0;
}
$ /opt/gcc-4.4/bin/g++ -v
Using built-in specs.
Target: i686-pc-cygwin
Configured with: ./configure --prefix=/opt/gcc-4.4
Thread model: single
gcc version 4.4.0 (GCC)
$ /opt/gcc-4.4/bin/g++ --std=c++0x -Wall g++4.4BugN2672.cpp
g++4.4BugN2672.cpp: In constructor 'main()::X::X()':
g++4.4BugN2672.cpp:8: error: conversion from '<brace-enclosed initializer
list>' to non-scalar type 'const short int [5]
' requested
g++4.4BugN2672.cpp: In function 'int main()':
g++4.4BugN2672.cpp:12: error: ISO C++ forbids initialization in array new
g++4.4BugN2672.cpp:12: warning: unused variable 'pData'
--
Summary: [C++0x]: error with initializer list in N2672
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bernhard dot merkle at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40689
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/40689] [C++0x]: error with initializer list in N2672
2009-07-08 20:29 [Bug c++/40689] New: [C++0x]: error with initializer list in N2672 bernhard dot merkle at googlemail dot com
@ 2009-07-08 20:30 ` bernhard dot merkle at googlemail dot com
2009-07-08 20:38 ` rguenth at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bernhard dot merkle at googlemail dot com @ 2009-07-08 20:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from bernhard dot merkle at googlemail dot com 2009-07-08 20:29 -------
Created an attachment (id=18164)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18164&action=view)
program which should compile
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40689
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/40689] [C++0x]: error with initializer list in N2672
2009-07-08 20:29 [Bug c++/40689] New: [C++0x]: error with initializer list in N2672 bernhard dot merkle at googlemail dot com
2009-07-08 20:30 ` [Bug c++/40689] " bernhard dot merkle at googlemail dot com
@ 2009-07-08 20:38 ` rguenth at gcc dot gnu dot org
2009-07-08 20:56 ` bernhard dot merkle at googlemail dot com
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-07-08 20:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2009-07-08 20:38 -------
Before filing more bugs please verify the bugs exist on a recent version
of the development trunk for GCC 4.5. C++0x is considered incomplete
technology preview only.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40689
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/40689] [C++0x]: error with initializer list in N2672
2009-07-08 20:29 [Bug c++/40689] New: [C++0x]: error with initializer list in N2672 bernhard dot merkle at googlemail dot com
2009-07-08 20:30 ` [Bug c++/40689] " bernhard dot merkle at googlemail dot com
2009-07-08 20:38 ` rguenth at gcc dot gnu dot org
@ 2009-07-08 20:56 ` bernhard dot merkle at googlemail dot com
2009-07-08 21:05 ` rguenth at gcc dot gnu dot org
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bernhard dot merkle at googlemail dot com @ 2009-07-08 20:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from bernhard dot merkle at googlemail dot com 2009-07-08 20:56 -------
makes sense, thanks for the hint.
is there doc to which Nxxxx papers the 4.5 trunk relates ?
e.g. like http://gcc.gnu.org/projects/cxx0x.html
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40689
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/40689] [C++0x]: error with initializer list in N2672
2009-07-08 20:29 [Bug c++/40689] New: [C++0x]: error with initializer list in N2672 bernhard dot merkle at googlemail dot com
` (2 preceding siblings ...)
2009-07-08 20:56 ` bernhard dot merkle at googlemail dot com
@ 2009-07-08 21:05 ` rguenth at gcc dot gnu dot org
2009-07-09 0:36 ` paolo dot carlini at oracle dot com
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-07-08 21:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2009-07-08 21:05 -------
I don't think so. Likely nobody bothered to update that document recently.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40689
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/40689] [C++0x]: error with initializer list in N2672
2009-07-08 20:29 [Bug c++/40689] New: [C++0x]: error with initializer list in N2672 bernhard dot merkle at googlemail dot com
` (3 preceding siblings ...)
2009-07-08 21:05 ` rguenth at gcc dot gnu dot org
@ 2009-07-09 0:36 ` paolo dot carlini at oracle dot com
2009-07-12 19:19 ` jason at gcc dot gnu dot org
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-07-09 0:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from paolo dot carlini at oracle dot com 2009-07-09 00:36 -------
And again...
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40689
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/40689] [C++0x]: error with initializer list in N2672
2009-07-08 20:29 [Bug c++/40689] New: [C++0x]: error with initializer list in N2672 bernhard dot merkle at googlemail dot com
` (4 preceding siblings ...)
2009-07-09 0:36 ` paolo dot carlini at oracle dot com
@ 2009-07-12 19:19 ` jason at gcc dot gnu dot org
2009-07-13 6:07 ` jason at gcc dot gnu dot org
2009-07-14 5:18 ` jason at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-07-12 19:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jason at gcc dot gnu dot org 2009-07-12 19:19 -------
Subject: Bug 40689
Author: jason
Date: Sun Jul 12 19:19:03 2009
New Revision: 149533
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149533
Log:
PR c++/40689
* init.c (build_new_1): Handle initializer list as array initializer.
(build_vec_init): Likewise.
* typeck.c (cp_build_modify_expr): Likewise.
* typeck2.c (process_init_constructor_array): Error rather than abort
if too many initializers.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/initlist20.C
trunk/gcc/testsuite/g++.dg/cpp0x/initlist21.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/init.c
trunk/gcc/cp/typeck.c
trunk/gcc/cp/typeck2.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40689
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/40689] [C++0x]: error with initializer list in N2672
2009-07-08 20:29 [Bug c++/40689] New: [C++0x]: error with initializer list in N2672 bernhard dot merkle at googlemail dot com
` (5 preceding siblings ...)
2009-07-12 19:19 ` jason at gcc dot gnu dot org
@ 2009-07-13 6:07 ` jason at gcc dot gnu dot org
2009-07-14 5:18 ` jason at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-07-13 6:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jason at gcc dot gnu dot org 2009-07-13 06:06 -------
Subject: Bug 40689
Author: jason
Date: Mon Jul 13 06:06:27 2009
New Revision: 149543
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149543
Log:
PR c++/36628
* tree.c (rvalue): Use lvalue_or_rvalue_with_address_p.
PR c++/37206
* cp-tree.h (enum cp_lvalue_kind_flags): Add clk_rvalueref.
* tree.c (lvalue_p_1): Return it. Remove
treat_class_rvalues_as_lvalues parm.
(real_lvalue_p): Disallow pseudo-lvalues here.
(lvalue_or_rvalue_with_address_p): New fn.
* call.c (initialize_reference): Use it instead of real_lvalue_p.
PR c++/40689
* init.c (build_new_1): Handle initializer list as array initializer.
(build_vec_init): Likewise.
* typeck.c (cp_build_modify_expr): Likewise.
* typeck2.c (process_init_constructor_array): Error rather than abort
if too many initializers.
Added:
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/decltype17.C
- copied unchanged from r149536,
trunk/gcc/testsuite/g++.dg/cpp0x/decltype17.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/initlist20.C
- copied unchanged from r149534,
trunk/gcc/testsuite/g++.dg/cpp0x/initlist20.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/initlist21.C
- copied unchanged from r149534,
trunk/gcc/testsuite/g++.dg/cpp0x/initlist21.C
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/rv10.C
- copied unchanged from r149534, trunk/gcc/testsuite/g++.dg/cpp0x/rv10.C
Modified:
branches/gcc-4_4-branch/gcc/cp/ChangeLog
branches/gcc-4_4-branch/gcc/cp/ChangeLog-2007 (props changed)
branches/gcc-4_4-branch/gcc/cp/ChangeLog-2008 (props changed)
branches/gcc-4_4-branch/gcc/cp/call.c
branches/gcc-4_4-branch/gcc/cp/cp-tree.h
branches/gcc-4_4-branch/gcc/cp/init.c
branches/gcc-4_4-branch/gcc/cp/tree.c
branches/gcc-4_4-branch/gcc/cp/typeck.c
branches/gcc-4_4-branch/gcc/cp/typeck2.c
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog-2008 (props changed)
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ (props changed)
branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/decltype-38655.C
(props changed)
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr36227.c (props
changed)
branches/gcc-4_4-branch/gcc/testsuite/gcc.target/x86_64/abi/callabi/
(props changed)
Propchange: branches/gcc-4_4-branch/gcc/cp/ChangeLog-2007
('svn:mergeinfo' modified)
Propchange: branches/gcc-4_4-branch/gcc/cp/ChangeLog-2008
('svn:mergeinfo' modified)
Propchange: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog-2008
('svn:mergeinfo' modified)
Propchange: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/
('svn:mergeinfo' modified)
Propchange: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/cpp0x/decltype-38655.C
('svn:mergeinfo' modified)
Propchange: branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/torture/pr36227.c
('svn:mergeinfo' modified)
Propchange:
branches/gcc-4_4-branch/gcc/testsuite/gcc.target/x86_64/abi/callabi/
('svn:mergeinfo' modified)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40689
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c++/40689] [C++0x]: error with initializer list in N2672
2009-07-08 20:29 [Bug c++/40689] New: [C++0x]: error with initializer list in N2672 bernhard dot merkle at googlemail dot com
` (6 preceding siblings ...)
2009-07-13 6:07 ` jason at gcc dot gnu dot org
@ 2009-07-14 5:18 ` jason at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu dot org @ 2009-07-14 5:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jason at gcc dot gnu dot org 2009-07-14 05:18 -------
Fixed for 4.4.1.
--
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40689
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-07-14 5:18 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-08 20:29 [Bug c++/40689] New: [C++0x]: error with initializer list in N2672 bernhard dot merkle at googlemail dot com
2009-07-08 20:30 ` [Bug c++/40689] " bernhard dot merkle at googlemail dot com
2009-07-08 20:38 ` rguenth at gcc dot gnu dot org
2009-07-08 20:56 ` bernhard dot merkle at googlemail dot com
2009-07-08 21:05 ` rguenth at gcc dot gnu dot org
2009-07-09 0:36 ` paolo dot carlini at oracle dot com
2009-07-12 19:19 ` jason at gcc dot gnu dot org
2009-07-13 6:07 ` jason at gcc dot gnu dot org
2009-07-14 5:18 ` jason at gcc dot gnu dot 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).