From 86851109b8f70eee7a743bc914219e4f0d8bf9f4 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 26 Mar 2010 17:10:02 +0000 Subject: [PATCH] fix a bug in paste avoidance which would cause us to accidentally form a >>=. Patch by Abramo Bagnara, testcase by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99624 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/TokenConcatenation.cpp | 2 +- test/Preprocessor/output_paste_avoid.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Lex/TokenConcatenation.cpp b/lib/Lex/TokenConcatenation.cpp index 07951646ff..51d2e2326f 100644 --- a/lib/Lex/TokenConcatenation.cpp +++ b/lib/Lex/TokenConcatenation.cpp @@ -85,7 +85,7 @@ TokenConcatenation::TokenConcatenation(Preprocessor &pp) : PP(pp) { TokenInfo[tok::star ] |= aci_avoid_equal; // *= TokenInfo[tok::exclaim ] |= aci_avoid_equal; // != TokenInfo[tok::lessless ] |= aci_avoid_equal; // <<= - TokenInfo[tok::greaterequal] |= aci_avoid_equal; // >>= + TokenInfo[tok::greatergreater] |= aci_avoid_equal; // >>= TokenInfo[tok::caret ] |= aci_avoid_equal; // ^= TokenInfo[tok::equal ] |= aci_avoid_equal; // == } diff --git a/test/Preprocessor/output_paste_avoid.c b/test/Preprocessor/output_paste_avoid.c index 835a921fb7..8c6173a78d 100644 --- a/test/Preprocessor/output_paste_avoid.c +++ b/test/Preprocessor/output_paste_avoid.c @@ -24,3 +24,7 @@ E: test(str) // Should expand to L "str" not L"str" // CHECK: E: L "str" +// Should avoid producing >>=. +#define equal = +F: >>equal +// CHECK: F: >> =