public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17109] New: bogus syntax error of c++ 3.4.0 triggered by -O
@ 2004-08-19 16:18 krelisnet at softhome dot net
2004-08-19 16:42 ` [Bug c++/17109] " reichelt at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: krelisnet at softhome dot net @ 2004-08-19 16:18 UTC (permalink / raw)
To: gcc-bugs
The code below results in syntax error when using -O. The syntax error is not
mentioned when omitting -O.
test.cc:
#-----------------------------------------------------
#include <string>
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/17109] bogus syntax error of c++ 3.4.0 triggered by -O
2004-08-19 16:18 [Bug c++/17109] New: bogus syntax error of c++ 3.4.0 triggered by -O krelisnet at softhome dot net
@ 2004-08-19 16:42 ` reichelt at gcc dot gnu dot org
2004-08-19 16:52 ` krelisnet at softhome dot net
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-08-19 16:42 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-08-19 16:42 -------
The problem is "gettext" when "-O" is specified, a macro definition for
gettext is provided, which causes the error messages. Here's a shorter
testcase:
===============================
#include <string>
struct A
{
void gettext();
};
===============================
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17109
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/17109] bogus syntax error of c++ 3.4.0 triggered by -O
2004-08-19 16:18 [Bug c++/17109] New: bogus syntax error of c++ 3.4.0 triggered by -O krelisnet at softhome dot net
2004-08-19 16:42 ` [Bug c++/17109] " reichelt at gcc dot gnu dot org
@ 2004-08-19 16:52 ` krelisnet at softhome dot net
2004-08-19 18:26 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: krelisnet at softhome dot net @ 2004-08-19 16:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From krelisnet at softhome dot net 2004-08-19 16:52 -------
(In reply to comment #1)
> The problem is "gettext" when "-O" is specified, a macro definition for
> gettext is provided, which causes the error messages. Here's a shorter
> testcase:
You're right. Thanks for the quick reply and sorry for bothering.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17109
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/17109] bogus syntax error of c++ 3.4.0 triggered by -O
2004-08-19 16:18 [Bug c++/17109] New: bogus syntax error of c++ 3.4.0 triggered by -O krelisnet at softhome dot net
2004-08-19 16:42 ` [Bug c++/17109] " reichelt at gcc dot gnu dot org
2004-08-19 16:52 ` krelisnet at softhome dot net
@ 2004-08-19 18:26 ` pinskia at gcc dot gnu dot org
2004-08-19 19:41 ` bangerth at dealii dot org
2004-08-19 19:41 ` bangerth at dealii dot org
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-19 18:26 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-08-19 18:26 -------
And this would be a bug in the glibc headers, bad glibc.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17109
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/17109] bogus syntax error of c++ 3.4.0 triggered by -O
2004-08-19 16:18 [Bug c++/17109] New: bogus syntax error of c++ 3.4.0 triggered by -O krelisnet at softhome dot net
` (2 preceding siblings ...)
2004-08-19 18:26 ` pinskia at gcc dot gnu dot org
@ 2004-08-19 19:41 ` bangerth at dealii dot org
2004-08-19 19:41 ` bangerth at dealii dot org
4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2004-08-19 19:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-08-19 19:41 -------
... PR 15773.
W.
*** This bug has been marked as a duplicate of 15773 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17109
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/17109] bogus syntax error of c++ 3.4.0 triggered by -O
2004-08-19 16:18 [Bug c++/17109] New: bogus syntax error of c++ 3.4.0 triggered by -O krelisnet at softhome dot net
` (3 preceding siblings ...)
2004-08-19 19:41 ` bangerth at dealii dot org
@ 2004-08-19 19:41 ` bangerth at dealii dot org
4 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2004-08-19 19:41 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-08-19 19:41 -------
This is actually a duplicate of ...
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17109
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-08-19 19:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-19 16:18 [Bug c++/17109] New: bogus syntax error of c++ 3.4.0 triggered by -O krelisnet at softhome dot net
2004-08-19 16:42 ` [Bug c++/17109] " reichelt at gcc dot gnu dot org
2004-08-19 16:52 ` krelisnet at softhome dot net
2004-08-19 18:26 ` pinskia at gcc dot gnu dot org
2004-08-19 19:41 ` bangerth at dealii dot org
2004-08-19 19:41 ` bangerth at dealii dot org
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).