Daniel Marjamäki
30353d4b61
Tokenizer::setVarId: better handling of c++ casts
2014-10-11 18:35:06 +02:00
Simon Martin
70561682eb
Tokenizer::simplifyConstTernaryOp: Properly detect the end of the 'false' part of ternary operators when it contains '>'.
2014-10-11 17:01:55 +02:00
Daniel Marjamäki
8c8e85d2db
Tokenizer::setVarId: A variable declaration can't start with the typedef keyword
2014-10-11 16:30:51 +02:00
Daniel Marjamäki
dd6ae3033f
Tokenizer::simplifyRedundantParentheses: dont remove parentheses in 'void * operator new(SIZE_TYPE, int);'
2014-10-11 09:18:43 +02:00
Daniel Marjamäki
b0b86f5607
Fixed internal error, use Token::simpleMatch for pattern 'const new' instead of Token::Match
2014-10-10 18:58:04 +02:00
Daniel Marjamäki
19a05b1f53
Tokenizer::setVarId: don't set varid for 'auto' keyword
2014-10-10 16:46:31 +02:00
amai2012
85500dcdbd
Merge pull request #453 from simartin/ticket_5625
...
Ticket #5625 : Simplify constant ternary operator in template parameters.
2014-10-06 09:01:08 +02:00
amai2012
cddb4af10b
Merge pull request #450 from simartin/ticket_6187
...
Ticket #6187 : Avoid infinite loop if eraseDeadCode does not remove anything
2014-10-06 08:59:56 +02:00
Simon Martin
9ddf857dc7
Ticket #5625 : Simplify constant ternary operator in template parameters.
2014-10-04 20:49:57 +02:00
PKEuS
a02712cb66
Some small refactorizations:
...
- Removed redundant calls to std::string constructor
- Use default parameters in some places
2014-10-03 10:02:46 +02:00
PKEuS
14f15d65e7
Support more patterns when replacing stuff like 'or' ( #6201 )
2014-10-01 08:41:55 +02:00
Simon Martin
f088588c88
Ticket #6187 : Avoid infinite loop if eraseDeadCode does not remove anything (invalid goto into a dead loop's body).
2014-09-30 19:43:22 +02:00
PKEuS
448195f255
Added variable name to debug message about typeStartToken()
...
Fixed cppcheck message
2014-09-29 14:36:03 +02:00
PKEuS
de13ad7eca
Improved simplifications of redundant loops:
...
- Execute simplifyWhile0 after simplifyKnownVariables (#394 )
- Support declaration of variable in loop header in removeRedundantFor
2014-09-26 10:47:05 +02:00
Dmitry-Me
b17f2eea16
Cache search result to avoid dual search
2014-09-22 15:54:17 +04:00
Daniel Marjamäki
f93cf9d1b7
Fixed #6170 (Tokenizer: sizeof on array in 2d-array is not handled properly)
2014-09-16 17:21:17 +02:00
Dmitry-Me
b479948f0f
Refactoring: Merge overlapping Token::Match function calls
2014-09-16 06:22:16 +02:00
Daniel Marjamäki
29a49d0641
removed some redundant null pointer checks before calling Token::Match
2014-09-14 11:35:04 +02:00
Simon Martin
53b58f0ed9
Refactoring. Use Token::Match instead of hardcoded patterns to increase readability.
2014-09-14 11:26:16 +02:00
Simon Martin
4b750997cb
Ticket #6121 : Report a syntax error for invalid enum initializers.
2014-09-13 20:46:53 +02:00
Dmitry-Me
961a1b65ae
Merge partially duplicate patterns
2014-09-12 19:10:41 +04:00
Matthias Krüger
323fd1b3dc
tokenize.cpp: fix internal warning: Found simple pattern inside Token::Match() call: ") :"
2014-09-08 22:00:57 +02:00
Frank Zingsheim
8c5013adda
Fixed #6073
2014-09-07 21:53:32 +02:00
Daniel Marjamäki
db929ffd19
Fixed CID 1037074. Useless null pointer check. Created ticket #6144 .
2014-09-07 13:50:55 +02:00
PKEuS
35b00a5e05
Support rValue references in typedef ( #1823 )
2014-09-06 19:00:26 +02:00
Simon Martin
eeeb816db9
Ticket #6103 : Simplify "new (type)" constructs into "new type" to avoid confusion upon certain input.
2014-09-05 08:02:18 +02:00
PKEuS
8c24553229
Support inherited member variables in setVarId ( #4101 )
2014-09-04 22:22:09 +02:00
PKEuS
a52401cf1b
Fixed some compiler warning about signed/unsigned conversions.
2014-09-02 11:44:51 +02:00
PKEuS
3e65cb446e
Remove "auto" keyword (storage class specifier) from C++03 and C code ( #4990 ).
2014-09-02 11:21:47 +02:00
PKEuS
80df3dc642
Disabled several checks and simplifications for C code, if they are C++-only. Do not match arguments for C code, since there can't be overloads.
2014-09-01 18:43:24 +02:00
Dmitry-Me
9199dde560
Move declarations closer to where they're first used
2014-09-01 10:05:59 +04:00
PKEuS
3ccdae78ba
Support __declspec(property) ( #4700 )
2014-08-31 20:17:18 +02:00
PKEuS
6a4319f050
Improved simplifications:
...
- Rearranged their order to solve problems with typedefs. If we simplify chained declarations before typedef parsing, we have less complex expressions to deal with (#4777 ).
- Fixed detection of variables hiding enums
2014-08-26 15:21:19 +02:00
PKEuS
2326e78381
Fixed #6058 : Don't detect class with unknown macro as variable.
...
Commented out crashing unit test tokenize33() in VS12
2014-08-26 10:40:00 +02:00
amai2012
e02741c82c
#5780 Crash on template code below Tokenizer::setVarId(). Fix several crashes with same location.
2014-08-26 09:12:10 +02:00
Dmitry-Me
67ea470275
Break loop early, cleanup declarations
2014-08-24 20:17:41 +02:00
PKEuS
7f2be2f57c
Fixed template bracket linkage in while loop simplification
...
Ran AStyle
2014-08-23 12:28:54 +02:00
PKEuS
c678937538
Fixed more false positives of #6056 :
...
- Implemented nextArgument() for usages before < and > are linked
- slightly optimized nextArgument()
2014-08-20 15:02:52 +02:00
PKEuS
5d50e7e9ae
Changed heuristics to detect variable constructor initialization syntax ( #6071 )
2014-08-19 11:06:52 +02:00
PKEuS
eac2d58c9e
Fixed fix for #6056
2014-08-18 20:40:43 +02:00
Dmitry-Me
120e8c0674
Make loop termination more explicit.
2014-08-18 14:00:25 +04:00
PKEuS
e7754be316
Fixed #6056 - properly detect member functions in setVarId()
2014-08-18 11:07:56 +02:00
PKEuS
5c54f8d0d8
Support namespaces and static member variables in setVarId (only one depth) ( #6061 )
2014-08-18 10:25:30 +02:00
Daniel Marjamäki
a52c122229
Tokenizer::createLinks2: set no template-links in 'if (a < b || c > d)'
2014-08-17 19:03:06 +02:00
Daniel Marjamäki
5cdbe0f42d
ValueFlow: Improved value flow after for loop
2014-08-17 10:40:22 +02:00
Daniel Marjamäki
75ec97ad23
Tokenizer::simplifyKnownVariables: Fixed bad simplification in for loop header
2014-08-17 07:39:42 +02:00
Daniel Marjamäki
65f10edcb6
Fixed #5866 (False negative: useless condition or null pointer dereference (null object after while loop, method))
2014-08-16 18:32:25 +02:00
PKEuS
e4b55cf843
Fixed a bug and two warnings introduced recently.
2014-08-06 13:35:39 +02:00
PKEuS
adcc8b1634
Implement support for __attribute__((used)) ( #3408 )
2014-08-06 11:13:58 +02:00
PKEuS
fd5ff1bb8b
Fixed false positive #6030 : inheriting classes is not a variable declaration.
2014-08-06 09:04:03 +02:00