public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52742] New: Initializing an array using brace initializer and template parameters
@ 2012-03-27 19:05 M at ttDiesel dot co.uk
2012-03-28 7:15 ` [Bug c++/52742] " M at ttDiesel dot co.uk
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: M at ttDiesel dot co.uk @ 2012-03-27 19:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52742
Bug #: 52742
Summary: Initializing an array using brace initializer and
template parameters
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: M@ttDiesel.co.uk
This follows on from this question on stackoverflow.com:
http://stackoverflow.com/questions/9894406/initializing-a-const-instance-member-array
This has been tested on three versions of GCC (4.7, 4.6.3 and 4.5) on a variety
of systems.
Output from 4.5 and 4.6.3 are both: http://ideone.com/h7K7y
Output from 4.7 is slightly different: http://pastie.org/3679616
Latter includes preprocessed output, using The following:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-1'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin
--enable-objc-gc --with-arch-32=i586 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-1)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/52742] Initializing an array using brace initializer and template parameters
2012-03-27 19:05 [Bug c++/52742] New: Initializing an array using brace initializer and template parameters M at ttDiesel dot co.uk
@ 2012-03-28 7:15 ` M at ttDiesel dot co.uk
2012-03-29 17:06 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: M at ttDiesel dot co.uk @ 2012-03-28 7:15 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52742
--- Comment #1 from Mat <M at ttDiesel dot co.uk> 2012-03-28 07:07:58 UTC ---
A shorter reproducer has been shown here: https://gist.github.com/2220810
This does not actually have the template parameters inside the braces.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/52742] Initializing an array using brace initializer and template parameters
2012-03-27 19:05 [Bug c++/52742] New: Initializing an array using brace initializer and template parameters M at ttDiesel dot co.uk
2012-03-28 7:15 ` [Bug c++/52742] " M at ttDiesel dot co.uk
@ 2012-03-29 17:06 ` paolo.carlini at oracle dot com
2015-08-12 17:18 ` paolo at gcc dot gnu.org
2015-08-12 17:19 ` paolo.carlini at oracle dot com
3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-03-29 17:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52742
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-03-29
Ever Confirmed|0 |1
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-03-29 16:43:47 UTC ---
To wit:
void foo() {
new int[1] {1};
}
template<int A>
void goo() {
new int[1] {1};
}
int main() {
foo();
goo<1>();
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/52742] Initializing an array using brace initializer and template parameters
2012-03-27 19:05 [Bug c++/52742] New: Initializing an array using brace initializer and template parameters M at ttDiesel dot co.uk
2012-03-28 7:15 ` [Bug c++/52742] " M at ttDiesel dot co.uk
2012-03-29 17:06 ` paolo.carlini at oracle dot com
@ 2015-08-12 17:18 ` paolo at gcc dot gnu.org
2015-08-12 17:19 ` paolo.carlini at oracle dot com
3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-08-12 17:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52742
--- Comment #4 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Wed Aug 12 17:18:14 2015
New Revision: 226824
URL: https://gcc.gnu.org/viewcvs?rev=226824&root=gcc&view=rev
Log:
2015-08-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52742
* g++.dg/cpp0x/pr52742.C: New.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/pr52742.C
Modified:
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/52742] Initializing an array using brace initializer and template parameters
2012-03-27 19:05 [Bug c++/52742] New: Initializing an array using brace initializer and template parameters M at ttDiesel dot co.uk
` (2 preceding siblings ...)
2015-08-12 17:18 ` paolo at gcc dot gnu.org
@ 2015-08-12 17:19 ` paolo.carlini at oracle dot com
3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-08-12 17:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52742
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC|M at ttDiesel dot co.uk |
Resolution|--- |FIXED
Target Milestone|--- |4.8.1
--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Closing.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-12 17:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-27 19:05 [Bug c++/52742] New: Initializing an array using brace initializer and template parameters M at ttDiesel dot co.uk
2012-03-28 7:15 ` [Bug c++/52742] " M at ttDiesel dot co.uk
2012-03-29 17:06 ` paolo.carlini at oracle dot com
2015-08-12 17:18 ` paolo at gcc dot gnu.org
2015-08-12 17:19 ` paolo.carlini at oracle 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).