From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31662 invoked by alias); 19 Aug 2004 16:18:59 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31645 invoked by uid 48); 19 Aug 2004 16:18:56 -0000 Date: Thu, 19 Aug 2004 16:18:00 -0000 From: "krelisnet at softhome dot net" To: gcc-bugs@gcc.gnu.org Message-ID: <20040819161838.17109.krelisnet@softhome.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/17109] New: bogus syntax error of c++ 3.4.0 triggered by -O X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg01953.txt.bz2 List-Id: The code below results in syntax error when using -O. The syntax error is not mentioned when omitting -O. test.cc: #----------------------------------------------------- #include enum keyword_type {UNKNOWN = -1, TEXT, DATE, NUM}; class keyword { public: keyword () {type = UNKNOWN; } std::string gettext() { return txt; } private: enum keyword_type type; std::string txt; }; #----------------------------------------------------- invocation: g++34 -v -save-temps -c -O test.cc #----------------------------------------------------- message: Reading specs from /usr/lib/gcc/i386-redhat-linux/3.4.0/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,java,f77 --host=i386-redhat-linux Thread model: posix gcc version 3.4.0 (Red Hat Linux 3.4.0-1) /usr/libexec/gcc/i386-redhat-linux/3.4.0/cc1plus -E -quiet -v -D_GNU_SOURCE test.cc -O -o test.ii ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/3.4.0/../../../../i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/i386-redhat-linux/3.4.0/../../../../include/c++/3.4.0 /usr/lib/gcc/i386-redhat-linux/3.4.0/../../../../include/c++/3.4.0/i386-redhat-linux /usr/lib/gcc/i386-redhat-linux/3.4.0/../../../../include/c++/3.4.0/backward /usr/local/include /usr/lib/gcc/i386-redhat-linux/3.4.0/include /usr/include End of search list. /usr/libexec/gcc/i386-redhat-linux/3.4.0/cc1plus -fpreprocessed test.ii -quiet -dumpbase test.cc -auxbase test -O -version -o test.s GNU C++ version 3.4.0 (Red Hat Linux 3.4.0-1) (i386-redhat-linux) compiled by GNU C version 3.4.0 (Red Hat Linux 3.4.0-1). GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64479 test.cc:9: error: expected `;' before '(' token test.cc:13: error: expected `;' before "private" -- Summary: bogus syntax error of c++ 3.4.0 triggered by -O Product: gcc Version: 3.4.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: krelisnet at softhome dot net CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i386-redhat-linux GCC host triplet: i386-redhat-linux GCC target triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17109