I've got parse-error on valid code: ---g++-parse-bug.cpp--- struct const_raw_data { const_raw_data(const void* block, unsigned size); }; void packet_tx_1() { char data[] = { 'A', 'B', 'C' }; const_raw_data ( &data[0], 3); } ---------------------------------- [kirr@tugrik test]$ g++ -Wall -c g++-parse-bug.cpp g++-parse-bug.cpp: In function `void packet_tx_1()': g++-parse-bug.cpp:11: error: parse error before `,' token g++-parse-bug.cpp:9: warning: unused variable `char data[3]' [kirr@tugrik test]$ g++ -v Reading specs from /usr/local/gcc-3.3.3/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/specs Configured with: ../gcc-3.3.3/configure --prefix=/usr/local/gcc-3.3.3 --enable-threads=posix --enable-languages=c,c++,f77 --enable-checking --disable-nls Thread model: posix gcc version 3.3.3
This is another instance of the old parser getting things wrong. See the links about well-known bugs on http://gcc.gnu.org/bugs.html. This is fixed in 3.4 and mainline, though. W.
Reopening as this is a dup of ...
bug 11796. *** This bug has been marked as a duplicate of 11796 ***