c++/2215: ICE on compilation of code with -fhonor-std and -ggdb
leo.dearden@acm.org
leo.dearden@acm.org
Wed Mar 7 14:06:00 GMT 2001
>Number: 2215
>Category: c++
>Synopsis: ICE on compilation of code with -fhonor-std and -ggdb
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: unassigned
>State: open
>Class: ice-on-illegal-code
>Submitter-Id: net
>Arrival-Date: Wed Mar 07 14:06:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Leo Dearden (leo.dearden@acm.org)
>Release: 2.95.3 20010219 (prerelease)
>Organization:
>Environment:
debian unsable (woody) current 7/3/01,
ALSA and NVdriver additional kernel modules,
default environment setteings,
IA-32 (intel celeron, i440BX chipset, 256MB RAM,
UDMA (IDE) HD)
>Description:
the code is incorrect, in that ALSAExeption.h:9: should read ALSAException: public std::exception
but reads:
ALSAException: public exception
hence the parse errors.
However with -ggdb or -ggdb3 the attempt to compile causes an ICE.
-ggdb1 or any -g[1,2,3] don't cause the ICE.
When I avoid the ICE by adding "std::" I get output code that I think is incorect, but that's in another bug report.
ld225@ld225:~/avm/main$ s
In file included from ALSAException.cpp:4:
ALSAException.h:10: parse error before `{'
ALSAException.h:14: parse error before `const'
ALSAException.h:15: destructors must be member functions
ALSAException.h:15: virtual outside class declaration
ALSAException.h:16: virtual outside class declaration
ALSAException.h:16: non-member function `what()' cannot have `const' method qualifier
ALSAException.h:17: virtual outside class declaration
ALSAException.h:17: non-member function `getErrorNumber()' cannot have `const' method qualifier
ALSAException.h:18: virtual outside class declaration
ALSAException.h:18: non-member function `getCall()' cannot have `const' method qualifier
ALSAException.h:20: parse error before `private'
ALSAException.h:27: parse error before `}'
ALSAException.cpp:10: invalid use of undefined type `class ALSAException'
ALSAException.h:9: forward declaration of `class ALSAException'
ALSAException.cpp: In method `ALSAException::ALSAException(int, const char *)':
ALSAException.cpp:12: class `ALSAException' does not have any field named `call'
ALSAException.cpp:13: class `ALSAException' does not have any field named `errorNumber'
ALSAException.cpp:15: class `ALSAException' does not have any field named `errorNumberText'
ALSAException.cpp:16: class `ALSAException' does not have any field named `errorNameText'
ALSAException.cpp:18: `call' undeclared (first use this function)
ALSAException.cpp:18: (Each undeclared identifier is reported only once
ALSAException.cpp:18: for each function it appears in.)
ALSAException.cpp:21: Internal compiler error in `scope_die_for', at dwarf2out.c:7804
Please submit a full bug report.
>How-To-Repeat:
// to get ICE:
// g++ -fhonor-std -ggdb -c -o ALSAException.o ALSAException.cpp
// I can't get mozilla to attach more than one file, so
// here is the other part of the problem.
#ifndef AVM_ALSA_EXCEPTION_H
#define AVM_ALSA_EXCEPTION_H
#include <exception>
class ALSAException : public exception
{
public:
// ALSAException(char const * const call = "call unspecified.");
ALSAException(int newErrorNumber, char const * newCall = "call unspecified");
ALSAException(ALSAException const &);
virtual ~ALSAException();
virtual char const * what() const;
virtual int getErrorNumber() const;
virtual char const * getCall() const;
private:
char* call;
// bool const errorNumberValid;
int errorNumber;
char* errorNumberText;
char* errorNameText;
};
#endif //AVM_ALSA_EXCEPTION_H
>Fix:
don't use -ggdb or -ggdb3 with -fhonor-std and lack of scope resolution.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/cpp; name="ALSAException.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="ALSAException.cpp"
Ly8gYmFzZSBjbGFzcyBmb3IgYWxsIGV4Y2VwdGlvbnMKLy8gd3JpdHRlbiAzLzMvMDEgYnkgTGVv
IERlYXJkZW4KCiNpbmNsdWRlICJBTFNBRXhjZXB0aW9uLmgiCiNpbmNsdWRlIDxzeXMvYXNvdW5k
bGliLmg+Ci8vI2luY2x1ZGUgPGNzdHJpbmc+CiNpbmNsdWRlIDxjc3RkaW8+CgovLyBjYWxsID0g
bmFtZSBvZiBjYWxsIHdoaWNoIGZhaWxlZApBTFNBRXhjZXB0aW9uOjpBTFNBRXhjZXB0aW9uKGlu
dCBuZXdFcnJvck51bWJlciwgY2hhciBjb25zdCAqIG5ld0NhbGwpOgogI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