Switch question
Ryszard Kabatek
Ryszard.Kabatek@softax.pl
Wed May 23 03:50:00 GMT 2001
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
More information about the Gcc
mailing list