[cfe-dev] Clang build issues FreeBSD + gcc 4.2

Chris Lattner clattner at apple.com
Fri Sep 7 18:29:17 PDT 2007


On Sep 7, 2007, at 5:40 PM, Justin Handville wrote:
> 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

> $ 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
> ===================================================================
> --- include/clang/Lex/Token.h   (revision 41776)
> +++ include/clang/Lex/Token.h   (working copy)
> @@ -61,7 +61,7 @@
>    void setLocation(SourceLocation L) { Loc = L; }
>    void setLength(unsigned Len) { Length = Len; }
>
> -  const char *getName() const { return getTokenName(Kind); }
> +  const char *getName() const { return tok::getTokenName(Kind); }
>
>    /// startToken - Reset all flags to cleared.
>    ///
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list