public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55020] New: 4.7.2 allow array init wih non-const argument
@ 2012-10-22 12:28 marktbremen45 at gmail dot com
  2012-10-22 12:34 ` [Bug c++/55020] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: marktbremen45 at gmail dot com @ 2012-10-22 12:28 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55020
           Summary: 4.7.2 allow array init wih non-const argument
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: marktbremen45@gmail.com


Created attachment 28506
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28506
g++ -v --version > e.lis 2>&1

int main() {
   int sz = 13; // not a constant expression
   int arr[sz];          // should not compile, but does so
}

compiles, but should not. 
Array even works at runtime  with int arg; cin >> arg; int arr[arg]; !

System: Suse Linux 12.2

g++ -v yields:

"
Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.7.2/lto-wrapper
Ziel: i686-pc-linux-gnu
Konfiguriert mit: ../gcc-4.7.2/configure --enable-languages=c++
Thread-Modell: posix
gcc-Version 4.7.2 (GCC) 
"
g++ -v --version : see attachment:


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

* [Bug c++/55020] 4.7.2 allow array init wih non-const argument
  2012-10-22 12:28 [Bug c++/55020] New: 4.7.2 allow array init wih non-const argument marktbremen45 at gmail dot com
@ 2012-10-22 12:34 ` redi at gcc dot gnu.org
  2012-10-22 12:36 ` redi at gcc dot gnu.org
  2012-10-22 14:20 ` marktbremen45 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2012-10-22 12:34 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-22 12:34:20 UTC ---
This is a GNU extension and works by design, use -pedantic or -pedantic-errors
to get a diagnostic

f.cc:3:14: warning: ISO C++ forbids variable length array 'arr' [-Wvla]


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

* [Bug c++/55020] 4.7.2 allow array init wih non-const argument
  2012-10-22 12:28 [Bug c++/55020] New: 4.7.2 allow array init wih non-const argument marktbremen45 at gmail dot com
  2012-10-22 12:34 ` [Bug c++/55020] " redi at gcc dot gnu.org
@ 2012-10-22 12:36 ` redi at gcc dot gnu.org
  2012-10-22 14:20 ` marktbremen45 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2012-10-22 12:36 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-22 12:36:04 UTC ---
Documented at http://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html


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

* [Bug c++/55020] 4.7.2 allow array init wih non-const argument
  2012-10-22 12:28 [Bug c++/55020] New: 4.7.2 allow array init wih non-const argument marktbremen45 at gmail dot com
  2012-10-22 12:34 ` [Bug c++/55020] " redi at gcc dot gnu.org
  2012-10-22 12:36 ` redi at gcc dot gnu.org
@ 2012-10-22 14:20 ` marktbremen45 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: marktbremen45 at gmail dot com @ 2012-10-22 14:20 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from marktbremen45 at gmail dot com 2012-10-22 14:20:39 UTC ---
ok - no bug

thanks for the hint


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

end of thread, other threads:[~2012-10-22 14:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22 12:28 [Bug c++/55020] New: 4.7.2 allow array init wih non-const argument marktbremen45 at gmail dot com
2012-10-22 12:34 ` [Bug c++/55020] " redi at gcc dot gnu.org
2012-10-22 12:36 ` redi at gcc dot gnu.org
2012-10-22 14:20 ` marktbremen45 at gmail 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).