Am running into this kind of thing when I convert include/ext/rope and friends
to using anonymous namespace.
This simplified source doesn't show the bug, sadly, but I'll put up
pre-processed code that demonstrates it in a bit.
namespace __gnu_cxx
{
namespace
{
enum _Tag1 {_S_leaf1, _S_concat1, _S_substringfn1, _S_function1};
}
namespace constants
{
enum _Tag2 {_S_leaf2, _S_concat2, _S_substringfn2, _S_function2};
}
template<typename T>
struct A
{
static void foo(const T i)
{
int j;
switch(i)
{
case _S_concat1: // error here, invalid integer constant
j = 5;
break;
case constants::_S_leaf2:
j = 5;
break;
default:
j = 0;
}
}
};
Code seems correct, but something about PCH kills it.
--
Summary: pch vs. anonymous namespaces
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bkoz at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28514