[cfe-dev] Unused variable in lib/AST/Expr.cpp -- a bug?

Dmitri Gribenko gribozavr at gmail.com
Mon Jun 11 17:24:23 PDT 2012


Hi,

I have found an unused variable (see below).  I am not familiar with
this code and I am not sure that removing it is the correct fix.

Index: lib/AST/Expr.cpp
===================================================================
--- lib/AST/Expr.cpp	(revision 158328)
+++ lib/AST/Expr.cpp	(working copy)
@@ -702,11 +702,6 @@

     const char *StrData = Buffer.data()+LocInfo.second;

-    // Create a langops struct and enable trigraphs.  This is sufficient for
-    // relexing tokens.
-    LangOptions LangOpts;
-    LangOpts.Trigraphs = true;
-
     // Create a lexer starting at the beginning of this token.
     Lexer TheLexer(SM.getLocForStartOfFile(LocInfo.first), Features,
                    Buffer.begin(), StrData, Buffer.end());

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unused-var-expr-cpp.patch
Type: application/octet-stream
Size: 619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120611/2efa591b/attachment.obj>


More information about the cfe-dev mailing list