Clang build issues FreeBSD + gcc 4.2

Here's the error I'm getting during a build against trunk. The
getTokenName function is defined in the tok namespace. The build
results and the patch are below. After applying the patch, the code
compiles.

$ gmake
gmake[1]: Entering directory `/llvm-trunk/tools/clang/Basic'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `/llvm-trunk/tools/clang/Basic'
gmake[1]: Entering directory `/llvm-trunk/tools/clang/Lex'
llvm[1]: Compiling IdentifierTable.cpp for Debug build
In file included from
/llvm-trunk/tools/clang/Lex/../include/clang/Lex/MacroInfo.h:17,
                 from IdentifierTable.cpp:16:
/llvm-trunk/tools/clang/Lex/../include/clang/Lex/Token.h: In member
function 'const char* clang::Token::getName() const':
/llvm-trunk/tools/clang/Lex/../include/clang/Lex/Token.h:64: error:
'getTokenName' was not declared in this scope
gmake[1]: *** [/llvm-trunk/tools/clang/Lex/Debug/IdentifierTable.o] Error 1
gmake[1]: Leaving directory `/llvm-trunk/tools/clang/Lex'
gmake: *** [all] Error 1

$ gcc --version
gcc (GCC) 4.2.2 20070822 (prerelease)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
FreeBSD 6.2-STABLE FreeBSD 6.2-STABLE amd64

Here's the patch:

Index: include/clang/Lex/Token.h

Here's the error I'm getting during a build against trunk. The
getTokenName function is defined in the tok namespace. The build
results and the patch are below. After applying the patch, the code
compiles.

Hrm, it looks like GCC 4.2.2 broke argument dependent lookup based on a bitfield enum argument. You should probably file a gcc bugzilla about this.

In any case, relying on ADL is badness, so I applied your patch, thanks!

-Chris

Hrm, it looks like GCC 4.2.2 broke argument dependent lookup based on
a bitfield enum argument. You should probably file a gcc bugzilla
about this.

In any case, relying on ADL is badness, so I applied your patch, thanks!

-Chris

Yeah, that's highly likely. I'll reduce it to a test case and submit it to gcc.

Thanks,
Justin