This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Sorry - message body was missing *blush*


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]