[cfe-dev] Fix paste avoidance

Neil Booth neil at daikokuya.co.uk
Mon Jul 23 16:03:30 PDT 2007


Neil Booth wrote:-

> Apparently a logic bug; confused how it was working for anyone
> else.

And another.

Neil.
-------------- next part --------------
Index: Driver/PrintPreprocessedOutput.cpp
===================================================================
--- Driver/PrintPreprocessedOutput.cpp	(revision 40452)
+++ Driver/PrintPreprocessedOutput.cpp	(working copy)
@@ -426,7 +426,7 @@
     if (Tok.getKind() == tok::equal ||
         Tok.getKind() == tok::equalequal)
       return true;
-    ConcatInfo &= ~ConcatInfo;
+    ConcatInfo &= ~aci_avoid_equal;
   }
   
   if (ConcatInfo == 0) return false;
@@ -540,7 +540,7 @@
     } else if (Tok.hasLeadingSpace() || 
                // If we haven't emitted a token on this line yet, PrevTok isn't
                // useful to look at and no concatenation could happen anyway.
-               (!Callbacks->hasEmittedTokensOnThisLine() &&
+               (Callbacks->hasEmittedTokensOnThisLine() &&
                 // Don't print "-" next to "-", it would form "--".
                 Callbacks->AvoidConcat(PrevTok, Tok))) {
       OutputChar(' ');


More information about the cfe-dev mailing list