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: unassig...@gcc.gnu.org ReportedBy: marktbreme...@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: