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]

Switch question


Hi.

In te sample below I get the folowing error message
from gcc version 3.0 20010514 (prerelease).

g++ -Wall x.cc

x.cc: In function `int f(std::_Ios_Openmode)':
x.cc:6: case label does not reduce to an integer constant


#include <iostream>
 
int f(std::ios_base::openmode mode)
{
  switch(mode & ~std::ios_base::ate) {
     case std::ios_base::out | std::ios_base::trunc:
        return 1;
  }
  return 0;
} 

Hm. The values of ate, out and trunc are integer constants.
Is it a compiler bug?

Regards
-- 
Ryszard Kabatek


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