c++/9212: Internal compiler error in grokdeclarator, at cp/decl.c:11052 [gcc 3.2]

jjamison@cs.berkeley.edu jjamison@cs.berkeley.edu
Tue Jan 7 06:06:00 GMT 2003


>Number:         9212
>Category:       c++
>Synopsis:       Internal compiler error in grokdeclarator, at cp/decl.c:11052 [gcc 3.2]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 06 22:06:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Johnathon Jamison
>Release:        gcc version 3.2
>Organization:
>Environment:
[jjamison@acacia ~/lao/Lao_Parsing-bad-gcc]$ uname -a
Linux acacia.CS.Berkeley.EDU 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown
/usr/misc/pkg/gcc-3.2/bin/g++ -v

Configured with: ../gcc-3.2/configure --prefix=/usr/misc/pkg/gcc-3.2 --enable-languages=c,c++
>Description:
[jjamison@acacia ~/lao/Lao_Parsing-bad-gcc]$ /usr/misc/pkg/gcc-3.2/bin/g++ main.cpp 
main.cpp: In function `int main()':
main.cpp:28: Internal compiler error in grokdeclarator, at cp/decl.c:11052
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:
To repeat, compile the following:
---------- Begin Source ----------
class LaoConsonant {
 public:
   enum Consonant { GOH1, HOH3 };
   LaoConsonant(enum Consonant c) {}
};

class LaoVowel {
 public:
   enum Vowel { SL_A };
   LaoVowel(Vowel v) {}
};

class LaoSyllable {
 private:
   LaoConsonant first_consonant;
   LaoVowel vowel;
   LaoConsonant third_consonant;
 public:
  LaoSyllable(LaoConsonant c1, LaoVowel v, LaoConsonant c3) :
      first_consonant(c1),
      vowel(v),
      third_consonant(c3) {}
};

int main(void) {
   LaoSyllable love(LaoConsonant(LaoConsonant::HOH3),
                    LaoVowel(LaoVowel::SL_A),
                    LaoConsonant(LaoConsonant::GOH1));
}
----------- End Source -----------

I can not easily test this on a current development snapshot.  I apologize.  However, as this bug also exists in gcc version 2.95.3 20010315 (release), I do not think it has been fixed.

I can not find a smaller file that also generates this error.  Further modifications of the file generate other odd errors.
>Fix:
Remove LaoConsonant::, LaoVowel::, and LaoConsonant:: from the declaration of love to fix it.

Interestingly, removing any one of the three fields from LaoSyllable causes the ICE to go away.  It will then claim somthing along the lines of:

[jjamison@acacia ~/lao/Lao_Parsing-bad-gcc]$ /usr/misc/pkg/gcc-3.2/bin/g++ main.cpp 
main.cpp: In function `int main()':
main.cpp:27: type `LaoConsonant' is not derived from type `LaoVowel'
main.cpp:27: confused by earlier errors, bailing out

This is clearly nonsense.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list