This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Sorry - message body was missing *blush*
- To: egcs at egcs dot cygnus dot com
- Subject: Sorry - message body was missing *blush*
- From: Christian Loth <sg618lo at unidui dot uni-duisburg dot de>
- Date: Mon, 16 Aug 1999 02:22:29 +0200 (MESZ)
Greetings,
Recently I have test-installed gcc 2.95 and compiled a medium
project (as of writing ~16k lines of code) with it. Now, I stumbled
across an error, where egcs 1.1.2 compiled flawlessly. The critical
code is:
const string &elf::speaksLike(tongue_mode _tm)
{
static const string speak_modes[3][3] = {
{ "ask", "exclaim", "say" },
{ "intone", "chant", "melodically say" },
{ "sweetly inquire", "emote", "sing" }
};
return speak_modes[whatGender()][_tm];
}
tongue_mode is the following enumeration:
enum tongue_mode { tm_question, tm_exclaim, tm_sentence };
and whatGender() returns the following enumeration:
enum c_gender { neutral, male, female };
Now, compiling the above gives the following errormessages with gcc 2.95:
elf.cc: In method `const class string & elf::speaksLike(tongue_mode)':
elf.cc:61: conversion from `const
basic_string<char,string_char_traits<char>,__default_alloc_template<true,0> >[3]'
to non-scalar type
`basic_string<char,string_char_traits<char>,__default_alloc_template<true,0> >'
requested
elf.cc:61: conversion from `const
basic_string<char,string_char_traits<char>,__default_alloc_template<true,0> >[3]'
to non-scalar type
`basic_string<char,string_char_traits<char>,__default_alloc_template<true,0> >'
requested
elf.cc:61: conversion from `const
basic_string<char,string_char_traits<char>,__default_alloc_template<true,0> >[3]'
to non-scalar type
`basic_string<char,string_char_traits<char>,__default_alloc_template<true,0> >'
requested
Now my question: is this a (known?) bug with gcc 2.95, or is the above
code not conforming to the C++ Standard?
- Chris
--
Christian Loth Coder of 'Project Gidayu'
Computer Science Student, University of Dortmund
sg618lo@uni-duisburg.de - chloth00@marvin.cs.uni-dortmund.de