From a219ed313b031d474f92ae66cc680729c7d800e6 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Fri, 30 Nov 2012 00:00:44 +0100 Subject: [PATCH] Fixed again #2963 (FP: Typedef names considered duplicate because __LINE__ not expanded). It is caused by a regression introduced with commit 75fbe310fffe781f8c788d28b76ccd538765181e. Add also a TODO in the non working detection inside TestSimplifyTokens::simplifyTypedef98. --- lib/tokenize.cpp | 6 +++--- test/testsimplifytokens.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 5ba9b1079..adcad6ace 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -1624,6 +1624,9 @@ bool Tokenizer::tokenize(std::istream &code, // replace inline SQL with "asm()" (Oracle PRO*C). Ticket: #1959 simplifySQL(); + // replace __LINE__ macro with line number + simplifyLineMacro(); + // Concatenate double sharp: 'a ## b' -> 'ab' concatenateDoubleSharp(); @@ -1632,9 +1635,6 @@ bool Tokenizer::tokenize(std::istream &code, return false; } - // replace __LINE__ macro with line number - simplifyLineMacro(); - // replace 'NULL' and similar '0'-defined macros with '0' simplifyNull(); diff --git a/test/testsimplifytokens.cpp b/test/testsimplifytokens.cpp index 2a70c864e..3ec5899ba 100644 --- a/test/testsimplifytokens.cpp +++ b/test/testsimplifytokens.cpp @@ -5792,6 +5792,7 @@ private: } void simplifyTypedef98() { // ticket #2963 + //TODO: this testcase fails because "inconclusive" and "style" are not enabled in "tok". const char code[] = "#define X type ## __LINE__\n" "typedef int X;\n" "typedef int X;\n";