This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Switch question
- To: gcc at gcc dot gnu dot org
- Subject: Switch question
- From: Ryszard Kabatek <Ryszard dot Kabatek at softax dot pl>
- Date: Wed, 23 May 2001 12:47:40 +0200
- Reply-To: Ryszard dot Kabatek at softax dot pl
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