Daniel Marjamäki
5b377ea2e4
Fixed #7821 (segmentation fault, invalid last token)
2016-11-20 14:15:51 +01:00
Daniel Marjamäki
efa3aba32a
Remove Tokenizer::simplifyNull()
2016-10-18 21:44:02 +02:00
Daniel Marjamäki
9cea2d6dfa
Tokenizer: Removed simplifications of standard functions that should be handled through configuration.
2016-10-18 19:25:58 +02:00
Daniel Marjamäki
d09a8dde57
Improved char literal handling. In the 'normal' tokenlist these should not be simplified to integer literals.
2016-10-12 10:20:24 +02:00
Daniel Marjamäki
bcbc8ef017
Fixed #7747 (Syntax error when setting the bitcount of an enum defined inside a struct)
2016-10-04 15:57:43 +02:00
Robert Reif
62ac40fc5e
Fixed #7706 ((debug) Executable scope 'foo' with unknown function.)
2016-08-20 22:43:27 +02:00
Daniel Marjamäki
7d6c587580
Fixed #6113 (Tokenizer::simplifyFunctionPointer: wrong simplification of usage 'return (*f)();')
2016-08-04 19:10:08 +02:00
Daniel Marjamäki
864cef2fd2
astyle formatting
...
[ci skip]
2016-08-02 09:03:03 +02:00
Daniel Marjamäki
31484133c0
Fixed #7158 (Tokenizer::createLinks2(): does not set links for < > in 'enum { value = boost::mpl::at_c<B,C> };')
2016-08-01 22:26:11 +02:00
Daniel Marjamäki
71f62950ed
Tokenizer::findGarbageCode: Make it less picky about 'UNKNOWN_MACRO if ..'
2016-07-26 14:35:11 +02:00
Daniel Marjamäki
7ff9545b10
Fixed #7637 (FP syntax error assignment in switch)
2016-07-26 12:15:55 +02:00
Daniel Marjamäki
fd19ab4ed1
fix garbage code handling
2016-07-26 08:50:00 +02:00
Daniel Marjamäki
adf16fae8b
Remove handling of ##, __FILE__, __LINE__ from tokenizer
2016-07-25 07:58:03 +02:00
Daniel Marjamäki
ed4a47de45
Tokenizer: Improve syntax checking of switch,if,while
2016-07-22 16:54:24 +02:00
Daniel Marjamäki
3eef225b36
Revert preprocessor fix for struct tag macros. There are performance problems.
2016-07-19 18:59:58 +02:00
Daniel Marjamäki
4cc4ebd5cd
Travis: run slow unit test on travis that is too slow to run on development machines
2016-07-19 17:10:49 +02:00
Daniel Marjamäki
72ead10d93
cleanup tests
2016-07-18 10:52:38 +02:00
Daniel Marjamäki
45ee29d5dc
Fixed #7604 (simplifyCalculation: expression '0 && x[2]' is not simplified properly)
2016-07-17 15:52:53 +02:00
Daniel Marjamäki
6e3d5dc0d1
Fixed #7580 (False positive when using logical operator keywords 'and', 'or')
2016-07-16 20:21:31 +02:00
Daniel Marjamäki
be755af762
Removed todo testcase for #5783
2016-05-26 18:47:36 +02:00
Daniel Marjamäki
06a594a9e0
Fixed #6207 ('not' misinterpreted as alternative C token)
2016-05-24 13:33:21 +02:00
Daniel Marjamäki
06d5e73e88
Fixed #7471 (Tokenizer::prepareTernaryOpForAST: typedef with comma inside ?:)
2016-05-22 11:33:21 +02:00
Alexander Mai
303a85a930
#4195 segmentation fault of cppcheck (invalid code). Fix segfault which turned up after refactoring the enum handling code.
2016-05-17 22:19:23 +02:00
Alexander Mai
9d1302d523
#7490 sizeof('a') should be sizeof(int) in C mode. Previous fix was hardcoding 4 for C.
2016-05-14 22:52:43 +02:00
Daniel Marjamäki
2cb03b3fd0
Fixed #7409 (Tokenizer: Links not set properly 'Data<T&&>')
2016-05-14 20:40:30 +02:00
Alexander Mai
251fc022fa
#7490 sizeof('a') should be 4 in C mode
2016-05-14 13:05:44 +02:00
Daniel Marjamäki
1caa79c45f
Tokenizer::simplifyPointerConst: Remove simplification. Its purpose was to avoid crash for garbage code ( #6900 ). This fixes #7485 .
2016-05-08 21:32:34 +02:00
PKEuS
f0fb7a8245
Simplify __attribute__ earlier ( #7462 )
2016-05-04 13:51:34 +02:00
PKEuS
b65cacf4b1
Tokenizer::simplifyStaticConst(): Support "struct" and operator:: ( #7403 )
2016-05-04 12:33:19 +02:00
Daniel Marjamäki
dc2a92263a
Fixed #7426 (RFC: time to replace simplifyEnum?)
2016-04-22 06:02:54 +02:00
amai2012
9f4d4bdde7
#6167 Refactoring: rename test functions. Rename TestTokenizer::removeCast*. TestTokenizer::varid* doesn't exist (anymore?).
2016-03-27 17:36:07 +02:00
Daniel Marjamäki
ac8341e3de
keep type suffixes after constant folding using bit operations
2016-03-21 21:20:02 +01:00
Daniel Marjamäki
253bfe432c
Fixed #7410 (Tokenizer: function pointer with throw())
2016-02-29 08:02:02 +01:00
Daniel Marjamäki
c0056d2455
Fixed #7347 (AST: wrong ast when template variable is declared and initiailized in if 'if (A::B<C> abc = 123)')
2016-01-26 10:40:44 +01:00
Daniel Marjamäki
7663b6ee75
Fixed #7348 (AST: wrong ast for cast that starts with :: '(::X*)x;')
2016-01-25 10:29:24 +01:00
Daniel Marjamäki
26612ab846
Fixed #5332 (Tokenizer: if braces not added properly 'if (x==123) label: {}')
2016-01-23 11:43:48 +01:00
Daniel Marjamäki
8568a80208
Fixed #6883 (Template parsing error)
2016-01-20 16:10:58 +01:00
Daniel Marjamäki
ab441f3fb1
Tokenizer:vardecl: split up reference variables declared in class better
2016-01-19 15:27:11 +01:00
Daniel Marjamäki
a0971355b7
Tweaked Tokenizer::simplifyAsm2()
2016-01-04 19:18:10 +01:00
Daniel Marjamäki
f1d3d5b47d
TestTokenizer::simplifyAsm2: replace invalid example code with valid code
2016-01-04 10:50:52 +01:00
Daniel Marjamäki
b748453b30
Tokenizer: Improve handling of block declarations (C extension)
2016-01-04 09:59:53 +01:00
Daniel Marjamäki
79e663dd6f
Settings: Remove '_' prefix for public member variables
2016-01-03 16:18:17 +01:00
Daniel Marjamäki
cd89e68f60
Fixed #6931 (noexcept and override qualifiers plus less than operator results in a syntax error)
2016-01-03 12:22:07 +01:00
Daniel Marjamäki
91d0f0fee0
astyle formatting
...
[ci skip]
2016-01-03 09:38:03 +01:00
Daniel Marjamäki
ed12b4dc44
Fixed #7253 (AST wrong on nested reinterpret_cast)
2016-01-03 09:37:38 +01:00
Daniel Marjamäki
95009a4630
Merge pull request #745 from lanurmi/2016_ad
...
Update copyright year to 2007-2016.
2016-01-01 22:57:19 +01:00
Daniel Marjamäki
f5715c1496
Rename Unspecified platform type to Native
2016-01-01 16:39:41 +01:00
Lauri Nurmi
996c9244d8
Update copyright year to 2007-2016.
2016-01-01 15:34:45 +02:00
Daniel Marjamäki
8171154e12
Fixed #7230 (Confusing code snippet in error message)
2015-12-31 01:15:49 +01:00
Daniel Marjamäki
15ecb26a6c
Tokenizer: Moved simplifyAssignmentInFunctionCall from simplifyTokenList1 to simplifyTokenList2
2015-12-28 13:58:41 +01:00
PKEuS
8f22e4924c
Updated AStyle to version 2.05.1
...
Tweaked runastyle.bat a little bit.
2015-12-17 15:53:13 +01:00
Daniel Marjamäki
8fd62e0cf9
Fixed #4931 (Wrong calculation of constants (simplifying: +,<<,% operations))
2015-11-20 19:43:11 +01:00
PKEuS
1566b72c5b
Fixed broken AST for simple expressions with delete operator.
...
Fixed cppcheck internal warning
2015-11-18 21:37:37 +01:00
Daniel Marjamäki
0f9d90d2be
Changed Copyrights. Removed my name.
2015-11-18 20:04:50 +01:00
PKEuS
feae241fc0
Fixed simplification of pointers ( #6829 )
2015-11-10 14:45:24 +01:00
PKEuS
7a90b763f6
Tokenizer::simplifyLabelsCaseDefault(): Do not insert ; between two cases.
2015-11-06 19:59:23 +01:00
PKEuS
95a0c0f14c
Limit the number of cases created by Tokenizer::simplifyCaseRange().
2015-11-06 19:21:56 +01:00
PKEuS
1fe1d7ea4a
Extended Tokenizer::simplifyCaseRange() to support also ranges of chars.
2015-11-06 18:46:43 +01:00
PKEuS
41b1b9d850
Support case ranges (gcc extension, #6490 )
2015-11-06 18:39:03 +01:00
PKEuS
be36539ad7
Fixed AST generation for C++11-style initialization ( #6528 )
2015-11-06 17:34:26 +01:00
PKEuS
62bc827eb0
Fixed createLinks2() when inheriting from a template ( #6601 )
2015-11-06 10:44:37 +01:00
PKEuS
8374e8414b
Fixed use-after-free in clang test suite introduced recently ( #7087 )
2015-11-03 19:24:19 +01:00
PKEuS
b97f9e576d
Fixed crash in clang test suite introduced by previous commit.
2015-11-02 22:53:05 +01:00
PKEuS
b049050792
Fixed wrong parsing of ^{}
2015-11-02 22:14:41 +01:00
PKEuS
4ee56d2306
Fixed simplifyAssignmentInFunctionCall for complex expressions ( #6927 )
2015-10-27 20:01:40 +01:00
Daniel Marjamäki
fc2bf2ef08
Fixed #7065 (AST: More explicit handling of lambda functions, generate ast for ';new Fred;')
2015-10-20 23:55:29 +02:00
Alexander Mai
3b1d849476
Correct template syntax check which got introduced by an attempt fix #6865 . Disable test for #6865 , adjust some modified tests and add new regression tests
2015-10-19 20:03:33 +02:00
Daniel Marjamäki
b856ac51dd
Fixed #7064 (Tokenizer: Wrong simplification of 'a.public:')
2015-10-19 10:01:57 +02:00
Daniel Marjamäki
9be284e80f
AST: proper operator precedence for c++11 initializer {} and ::
2015-10-18 16:58:15 +02:00
Daniel Marjamäki
9bb2af1893
Fixed #7059 (AST: handle C++ initialization with {} better)
2015-10-18 13:43:39 +02:00
Daniel Marjamäki
ec87b09d89
Fixed #7056 (iscast does not handle '(ulong)~0' properly, Tokenizer::simplifyCalculations wrongly simplifies '(ulong)~0' to 'ulong~0')
2015-10-17 18:58:13 +02:00
Daniel Marjamäki
30af2fcd73
iscast: handle '(ulong)~0' better
2015-10-17 18:25:27 +02:00
Daniel Marjamäki
c88297c971
Fixed #7054 (AST: handle C++ initialization with {} better)
2015-10-17 17:03:24 +02:00
PKEuS
46bfa62aad
Execute prepareTernaryOpForAST earlier ( #7048 )
2015-10-15 10:31:54 +02:00
PKEuS
d0cc97a4cf
Fixed wrong syntax error ( #7045 )
2015-10-14 16:01:48 +02:00
Daniel Marjamäki
a04e072976
Fixed #7040 (False positive syntaxError False positive syntaxError)
2015-10-13 20:31:17 +02:00
PKEuS
05b5275110
Improved AST:
...
- Fixed TODO for ternary operator. Add parantheses between ? and : where necessary as a preparation for createAst()
- Improved AST validation:
-- Better message for binary operator with only one operand
-- Ensure ? has : as second operand (#7035 )
2015-10-12 19:21:48 +02:00
Daniel Marjamäki
a500f6f703
Improved handling of 'long double' and address-of in ValueType. Removed Tokenizer::simplifyFloatCasts() to handle float casts better.
2015-10-08 19:50:10 +02:00
PKEuS
3645e3c16b
Fixed two TODO unit tests by delaying arraySize simpification until createLink2 is executed
2015-10-08 12:52:28 +02:00
PKEuS
0a34b206e8
Refactorization: Reduced code duplication in test suite
2015-10-08 11:35:51 +02:00
Philipp Kloke
4ac6623875
Moved a few tests out of testtokenize.cpp; refactorized them
2015-10-07 22:45:38 +02:00
PKEuS
3a5cef8a7e
Refactorization: Improved usage of Settings instances in test suite
2015-10-07 18:40:03 +02:00
PKEuS
590f1f1d66
Fixed handling of __asm...__endasm ( #6970 )
2015-09-28 15:43:48 +02:00
Daniel Marjamäki
d88dc3ed3e
Reverted 00c54df07c
(don't remove enum declarations) because it caused unexpected false positives
2015-09-06 18:37:22 +02:00
Daniel Marjamäki
00c54df07c
Tokenizer: Don't remove enum declarations
2015-09-06 17:44:49 +02:00
amai2012
e683d31e71
Re-enable okenizer::removeMacroInClassDef for C code
2015-09-01 07:10:12 +02:00
PKEuS
d7853b9963
Fixed simplification of fma(a, b, c) ( #6958 )
2015-08-29 20:52:03 +02:00
PKEuS
d5bc3285b9
Move "extern" to the beginning of a declaration like "static" and "const"
2015-08-29 10:57:52 +02:00
PKEuS
2ace3d3144
Rewritten handling of declaration specifiers:
...
- Removed simplifyConst() because it did the opposite of the (superior) simplifyStaticConst()
- Execute simplifyStaticConst() in simplifyTokenList1() - there is no reason to defer it, and it is required to properly parse declarations like "unsigned static int i;"
- Fixed simplifyStaticConst() to handle more patterns. It did not work at the beginning of the token list and for function arguments
- Reimplemented Tokenizer::simplifyStdType()
-> properly support all possible ways to declare integers as requested by the standard, instead of only a few common permutations of "unsigned|signed", "short|char|long|int"
-> Fixed parsing of _Complex/complex types
2015-08-27 14:34:17 +02:00
PKEuS
37aec52399
Simplify complex/_Complex types ( #6939 )
2015-08-26 13:13:45 +02:00
Simon Martin
6fb19b02d0
Properly differentiate arrays of pointers and pointers to arrays.
2015-08-25 21:19:19 +02:00
PKEuS
8d926d7328
Moved some simple WinAPI/MFC-specific simplifications to windows.cfg
2015-08-20 15:59:59 +02:00
PKEuS
0babc4f38f
Moved some unit tests to testgarbage.cpp
2015-08-16 14:49:35 +02:00
Alexander Mai
b3cc4629a6
Remove obsolete tests. Add incomplete test for GNU __builtin_expect to gnu.c
2015-08-10 21:20:20 +02:00
Daniel Marjamäki
72706cd0b8
Fixed #6868 (Tokenizer: wrong simplification of the unlikely keyword)
2015-08-08 12:49:42 +02:00
Frank Zingsheim
7021cb2c6b
Fixed #6284 (Token::Match called with varid 0. Constants)
2015-08-02 09:11:51 +02:00
Alexander Mai
acf050793e
#6907 segmentation fault (invalid code) in Tokenizer::simplifyTokenList1
2015-08-01 07:39:56 +02:00
Matthias Krüger
83ee640977
Tokenizer::syntaxError: put the character that we have an invalid number of into singlequotes instead of parentheses.
2015-07-31 15:28:59 +02:00
Daniel Marjamäki
05a21d45eb
Fixed #6670 (Analysis failed when there are {} in LHS in compound assignment)
2015-07-27 13:44:35 +02:00
Daniel Marjamäki
35eb1a393d
AST: handle concatening of strings better. this is not ideal but better.
2015-07-27 13:13:30 +02:00
Simon Shanks
9910c1fa0c
Fixed #6617 (preprocessor performance improvement)
2015-07-24 13:30:41 +02:00
Daniel Marjamäki
8ffa917fa2
Fixed #6863 (AST: wrong handling of assignment between ? and :)
2015-07-24 13:02:00 +02:00
Daniel Marjamäki
f9d22f70db
Removed simplifyIfNot simplification ( #6072 )
2015-07-21 20:56:47 +02:00
Daniel Marjamäki
1b8252181d
Tokenizer: Removed Tokenizer::simplifyIfNotNull ( #6072 )
2015-07-21 17:58:44 +02:00
Daniel Marjamäki
8a72bb8aa8
AST: Fixed AST for struct initialisation
2015-07-21 11:40:42 +02:00
PKEuS
149d11d9ad
Improved handling of inline assembly ( #6813 ):
...
- Add ; after asm {} block if required
- Fixed inline suppressions
2015-07-20 23:09:54 +02:00
Alexander Mai
8b97f04de4
Try to address some Coverity issues. Add TODO testcase for #5783 . Introduce TODO_ASSERT macro.
2015-07-19 15:03:35 +02:00
Daniel Marjamäki
a884362817
Fixed #6752 (wrong AST when there is lambda function)
2015-06-17 19:32:44 +02:00
orbitcowboy
06e818f89d
Running astyle, no functional change.
2015-06-17 09:09:23 +02:00
amai2012
a8db00b4bf
Repair test which had to be adjusted after previous changeset.
...
Refactoring: Add some const
2015-06-16 22:45:33 +02:00
Alexander Mai
70ba6c4340
#6767 False positive: memory leak when variable name is 'new'. Fix handling of new in C code. Move some tests for TokenList to new testtokenlist.cpp
2015-06-14 15:49:49 +02:00
Frank Zingsheim
6857dbe864
#6729 Simplification reference to constants.
2015-06-01 10:00:03 +02:00
Simon Martin
85b47636dc
Simplify known variableswhen they are at the end of a statement.
2015-05-30 23:34:50 +02:00
Simon Martin
50e5595845
Ticket #6708 : Check that a function name is not a reserved keyword in SymbolDatabase::isFunction instead of later.
2015-05-26 00:28:08 +02:00
Alexander Mai
7416d6add9
Another fix for handling of final/override specifiers in Tokenizer::simplifyKeyword() including a testcase. Ran astyle
2015-05-23 20:51:15 +02:00
Simon Martin
67eab0cd7c
Ticket #6620 , #6685 : Reserved keywords cannot be function names.
2015-05-23 11:29:58 +02:00
Alexander Mai
f0bc300198
#6510 False positive performance warning for std::list::size(). Fix this and other similar false positives. Refactoring of Variable::isStlType(), use fail-safe std::set instead of plain array. Run astyle
2015-05-17 20:02:41 +02:00
amai2012
20842fb1fc
#6690 override and final qualifiers plus less than operator results in a syntax error
...
Tokenizer::simplifyKeyword() is now able to handle all combinations out
of const|final|override
2015-05-17 13:02:13 +02:00
PKEuS
77c5381612
Support C++14 [[deprecated]]
2015-05-10 12:36:28 +02:00
Alexander Mai
8fa7b13a18
#6659 heap user after free: kernel: sm750_accel.c. Add testcase.
2015-05-10 11:37:23 +02:00
orbitcowboy
785df82513
#6660 : Fixed crash in Tokenize::SetVarid().
2015-04-29 09:18:54 +02:00
PKEuS
c4ceb97cea
Fixed #6629 : Don't simplify sinf(0) if sinf is a variable
2015-04-13 20:37:07 +02:00
PKEuS
c2ccd7d9e4
Simplify _declspec like __declspec
2015-04-11 11:02:52 +02:00
PKEuS
42673255ed
Refactorized testrunner: Create std::string only where necessary
2015-03-15 12:36:40 +01:00
PKEuS
bc5132e0ac
Refactorization: Moved declaration of errout, ... to testsuite.h, uniformized style
2015-03-11 22:54:43 +01:00
Simon Martin
9c6a625f91
Ticket #6181 : Normalize '>>' into '> >' when it's closing a C++11 template parameter list.
2015-03-07 11:06:04 +01:00
Daniel Marjamäki
f705cdce72
Fixed #6556 (Tokenizer::simplifyVarDecl: doesn't simplify template variables properly)
2015-03-06 17:30:20 +01:00
Daniel Marjamäki
925f077b8a
Fixed #6110 (TemplateSimplifier::simplifyCalculations: wrong simplification of 'if (VG_(strlen)(s)>=3)')
2015-03-02 16:27:00 +01:00
Daniel Marjamäki
86cdc8e7a6
Fixed #6540 (Tokenizer::simplifyKnownVariables: Missing varid for simplification in conditional code)
2015-03-02 06:18:00 +01:00
Daniel Marjamäki
449b88aa0c
Fixed #6547 (Regression - unknown macro causes analysis error)
2015-02-28 11:09:39 +01:00
Daniel Marjamäki
d4fa656e58
Refactor and improve Tokenizer::sizeofAddParentheses
2015-02-22 13:38:06 +01:00
Daniel Marjamäki
e251a99817
AST: fix handling of sizeof. ticket #6515
2015-02-18 19:56:13 +01:00
Simon Martin
c4c46be972
Revert fix for #6181 , that caused #6354 and #6414 .
2015-02-14 12:29:05 +01:00
Daniel Marjamäki
78b711fd7b
astyle formatting
2015-02-01 14:50:51 +01:00
PKEuS
f78744ac30
Fixed AST generation if expression starts with ternary operator
2015-02-01 14:02:19 +01:00
PKEuS
21cb0cfd60
Take simplifyIfNotNull and simplifyIfNot out of simplifyTokenList1 (first step for #6072 )
2015-01-31 20:12:02 +01:00
PKEuS
b2835051df
Refactorization: Renamed Token::Match pattern %var% to %name%, implement new pattern %var% which is true if varId > 0.
2015-01-31 12:32:04 +01:00
Martin Ettl
fab34a8382
Fixed a few inconclusive warnings regarding const-correctness in cppcheck code base.
2015-01-20 16:50:16 +01:00
Robert Reif
193645318b
Tokenizer: Remove macro in class declaration like 'class DLLEXPORT Fred {}' to be able to handle the class better later
2015-01-17 07:42:49 +01:00
Daniel Marjamäki
ff11ba9847
Updated copyright year to 2015
2015-01-03 12:14:58 +01:00
PKEuS
5dc45bd4ac
Fixed #5497 : Support designated initializers in array size detection
2014-12-30 19:23:01 +01:00
Robert Reif
9e60f584d9
Fixed #6321 : Implemented function Token::swapWithNext().
2014-12-27 10:53:26 +01:00
Daniel Marjamäki
fb3f5a159d
Token: Added flag for attribute noreturn ( #6328 )
2014-12-24 12:50:51 +01:00
Simon Martin
4c7a8c5497
Ticket #6181 : Properly handle >> terminating template parameter lists.
2014-12-14 15:14:27 +01:00
Daniel Marjamäki
051d42ae6b
astyle formatting
2014-11-20 14:20:09 +01:00
orbitcowboy
f5d804f71a
running astyle
2014-11-20 10:13:03 +01:00
PKEuS
428587f3d4
Fixed #6275 : Simplification of = (NULL); to = 0;
2014-11-18 19:39:38 +01:00
PKEuS
ad8749c0bd
Fixed #6278 : Remove casts to references to pointers in Tokenizer::simplifyCasts()
2014-11-18 19:23:59 +01:00
Simon Martin
cc6b51f2d9
Ticket #6059 : Properly handle class... in parameter lists.
2014-11-07 23:08:54 +01:00
PKEuS
c7d315fba3
Refactorization: Changed simplifyMathFunctions() to a single pass simplifier
2014-10-31 23:08:11 +01:00
PKEuS
6fdaf65cea
Fixed createLinks2() when > is followed by ; ( #6242 )
2014-10-30 11:15:24 +01:00
Robert Reif
42f709c09d
Fixed #6229 (Move Windows builtin types __intXX to library)
2014-10-21 06:11:19 +02:00
Robert Reif
e2f72b4cb1
Fixed #6215 (Move Windows platform types into library)
2014-10-19 07:34:40 +02:00
Daniel Marjamäki
7107286be6
Fixed #5891 (AST: wrong ast generated for 'x = (int)(double(123)*i);')
2014-10-16 15:57:05 +02:00
PKEuS
6955e719cf
Collected garbage code tests and moved them to testgarbage.cpp
2014-10-16 10:59:46 +02:00
Frank Zingsheim
eab0878b8a
Support {} initialization in initializer list ( #6216 )
2014-10-15 21:33:21 +02:00
Daniel Marjamäki
94c677905b
ast: don't hang when invalid code with new is found 'new (var1,var2,var3);'
2014-10-13 19:12:20 +02:00
Daniel Marjamäki
aac9e66147
AST: fixed ast for 'new (char *)[10]'
2014-10-12 12:57:01 +02:00
Daniel Marjamäki
f72a8d3f15
AST: fixed ast for 'a(new A(1)), b(new B(2))'
2014-10-12 12:13:01 +02:00
Daniel Marjamäki
649e2dfa97
AST: fixed ast for 'a = new (b) ::X;'
2014-10-12 11:12:25 +02:00
Daniel Marjamäki
f96ea94048
AST: fixed ast for 'a(new (X), 5);'
2014-10-12 10:20:03 +02:00
Daniel Marjamäki
c537c98751
AST: fixed ast for 'a(new (X));'
2014-10-12 09:24:43 +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
489fc6cce7
AST: more fixes of new statements in clang test suite. some of it is not handled very well.
2014-10-11 13:20:48 +02:00
Daniel Marjamäki
4783a67042
AST: fixes for more new statements from clang test suite
2014-10-11 11:27:13 +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
e6708c1ae2
AST: fixed hang for 'new (int S::*[3][4][5])()' (clang test suite)
2014-10-11 08:32:49 +02:00
Daniel Marjamäki
66d4614a87
AST: don't hang when using auto in new statement
2014-10-10 12:47:01 +02:00
Daniel Marjamäki
b5faf3a0cc
AST: improved handling of new
2014-10-10 10:37:54 +02:00
Daniel Marjamäki
cca003490b
Fixed #6203 (AST: fix problem with '; static_cast<...')
2014-10-10 08:18:24 +02:00
Daniel Marjamäki
8233edcbf2
astyle formatting
...
[ci skip]
2014-10-10 08:15:46 +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
PKEuS
58fe668fc4
Fixed AST for operator:: after template ( #6195 )
2014-09-29 11:01:37 +02:00
PKEuS
55b14853d0
Fixed AST: Compile expression inside [] brackets of operator new. ( #6193 )
2014-09-29 10:26:15 +02:00
PKEuS
20966c5c37
Added test file for garbage code:
...
- cppcheck should be run entirely on garbage code to ensure that no check crashs/hangs on it (TODO).
- All garbage code tests should be moved here (TODO, so far only those from testtokenize.cpp were moved)
2014-09-24 13:45:56 +02:00
PKEuS
affd0ffdfd
Splitted large groups of tests out of testsimplifytokens.cpp and testtokenize.cpp
2014-09-24 13:23:44 +02:00
Lauri Nurmi
1cc872f5b2
Change "obsolete" in all filenames into "obsolescent", and also update all references to such files.
...
Neither the C standard, the C++ standard, or POSIX talks about "obsolete". All of them use the word "obsolescent", which is a different word with a different meaning.
2014-09-23 16:18:04 +02:00
Simon Martin
4b750997cb
Ticket #6121 : Report a syntax error for invalid enum initializers.
2014-09-13 20:46:53 +02:00
Daniel Marjamäki
0ab7abded1
AST: fixed cast for 'return (long long)c << 40;'
2014-09-12 06:43:52 +02:00
Frank Zingsheim
8c5013adda
Fixed #6073
2014-09-07 21:53:32 +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
Alexander Mai
5a96413220
#6127 crash on patch(?)-".c" file. Avoid segfault.
2014-09-04 21:28:18 +02: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
amai2012
b14ebb791b
#5780 - Correct unit test which was calling wrong ASSERT
2014-08-26 12:19:58 +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
Daniel Marjamäki
cd75b2d83d
AST: fix hang for code 'MACRO({.x=1,.y=2})'
2014-08-25 19:10:16 +02:00
Daniel Marjamäki
1060b30e52
AST: better AST for placement new expression 'new (a) MyClass;'
2014-08-23 13:21:36 +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
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
PKEuS
fd5ff1bb8b
Fixed false positive #6030 : inheriting classes is not a variable declaration.
2014-08-06 09:04:03 +02:00
PKEuS
83a80cebeb
Fixed order of simplifications ( #6029 )
2014-08-06 08:39:23 +02:00
PKEuS
f3e0df7501
Support C++11 style initialization with {}:
...
-> Support in setVarId and SymbolDatabase (#4344 )
-> Fixed false positives in unused variable checking (#5491 , #5494 )
Side-effect: Support global variables initialized with brackets (C++03 style) in SymbolDatabase
2014-08-05 15:33:57 +02:00
PKEuS
95afa51b24
Fixed crash #5991 : Don't crash when lambda is incomplete
...
Fixed crash #6004 : Support struct initializations in AST
2014-07-31 23:15:36 +02:00
Daniel Marjamäki
328cc7b8f5
Fixed #5996 (false positive: Clarify calculation precedence for '+' and '?'.)
2014-07-19 18:29:53 +02:00
Daniel Marjamäki
14def42c99
Fixed #5972 (FP: Buffer is accessed out of bounds)
2014-07-08 16:31:08 +02:00
Zachary D. Blair
f6523e384b
Fixed 4979 (Doesn't allow any ordering of int modifiers)
2014-07-01 23:59:04 -07:00
Simon Martin
7b942650c2
Ticket #5952 : Simplify redundant parentheses in pointer variable declarations.
2014-06-28 09:36:51 +02:00
Daniel Marjamäki
72992c7973
AST: fixed ast for '++i;'
2014-06-26 17:31:57 +02:00
PKEuS
e80104327a
AST: Fixed detection of operator new/delete - don't hang when C code is checked as C++ ( #5910 )
2014-06-26 09:19:57 +02:00
orbitcowboy
76f3f67bcf
Fixed fsanitize=undefined: left shift of negative value -10000 in lib/templatesimplifier.cpp.
2014-06-16 10:58:41 +02:00
Simon Martin
efb12f0409
Ticket #5268 : Properly detect function heads when in Tokenizer::simplifyEnum.
2014-06-15 15:52:58 +02:00
Simon Martin
d588ed49b3
Ticket #5868 : Ignore variables called like a typedef when substituing typedefs.
2014-06-14 00:50:14 +02:00
Simon Martin
dc12a73987
Ticket #5907 : Properly handle extern declarations in Tokenizer::simplifyVarDecl.
2014-06-08 14:59:58 +02:00
PKEuS
8fe515b929
Improved testing of AST, added unit test for #5787
2014-06-05 17:39:14 +02:00
PKEuS
2455b76abd
Fixed lots of bugs in the AST:
...
- Support new and delete
- Properly handle "..."
- References and rValue references as function parameters
- Destructor definitions
2014-06-04 18:47:56 +02:00
PKEuS
39b64ea5fb
Simplify rValue reference arguments without name (&& -> & &)
2014-06-04 18:45:56 +02:00
PKEuS
a407b55945
Added support for lambdas to AST
...
Fixed bug that return statement left an operand on the stack
2014-05-25 21:55:39 +02:00
PKEuS
55c87248ba
Fixed crash on complex cast.
2014-05-24 20:21:08 +02:00
PKEuS
38aaa46804
Stabilized AST:
...
- Fixed broken simplification causing crashs when cast was followed by unary minus (real world examples from arch/parisc/math-emu/ (linux-kernel))
- Stabilized determination of unary and binary operators
2014-05-24 19:05:04 +02:00
amai2012
00e28de3b7
Merge pull request #315 from simartin/ticket_5823
...
Ticket #5823 : Properly count template parameters in TemplateSimplifier::useDefaultArgumentValues
2014-05-24 11:47:14 +02:00
PKEuS
b78131cfcf
Improved cast detection in AST:
...
-> Make use of it in checkother.cpp
Use tokenizer simplification instead of reimplementation for test suite
2014-05-24 11:29:32 +02:00
Simon Martin
2b809800b6
Ticket #5823 : Properly count template parameters in TemplateSimplifier::useDefaultArgumentValues and handle casts in template parameters' default values.
2014-05-23 23:38:40 +02:00
orbitcowboy
031020ae4a
#Fixed 5485: Wrong simplification of numbers like 1e+007 to 1e+007.0
2014-05-22 17:40:15 +02:00
PKEuS
7b1eca700b
Fixed bug in setVarId: VarIds for member functions defined inline in class were not properly set
2014-05-21 17:30:58 +02:00
orbitcowboy
90c1016c74
Fixed #5842 : remove C99 static keyword between [] in tokenizer.
2014-05-13 16:28:28 +02:00
Alexander Mai
be9a566d48
Refactoring/small corrections to fix warnings from clang -fsanitize=undefined 'member call on null pointer'
2014-05-20 21:55:08 +02:00
PKEuS
d1c4777053
Fixed two bugs in AST compilation ( #5830 ):
...
- Correctly parse operators .* and ->*
- Support empty branch in ternary expression (a?:c)
2014-05-19 21:54:59 +02:00
Philipp Kloke
ed7d0b321b
Bugfixes for AST and AST testing:
...
- Validate AST in test suite: Check for operand1 being set if operand2 is non-zero
- Fixed buggy unit tests in AST
- Fixed detection unary operator* after return statement (MPC-HC false positive)
2014-05-19 11:17:37 +02:00
PKEuS
683d0b7e82
Partially rewritten AST compilation:
...
- More straightforward approach for handling right-to-left associativity
- More straightforward approach to handling unary operators
- Improved handling of brackets
This fixes #5784 , #5795 , #5797 , #5799 , #5810 and a bunch of other problems
2014-05-18 12:10:39 +02:00
Simon Martin
e61e1cb13d
Ticket #5786 : Properly handle cv-qualified member pointers as template parameter.
2014-05-14 22:27:31 +02:00
PKEuS
a3bb8bf39c
AST: Parse ternary and assignment operators as right-to-left and on the same precedence level
2014-05-11 17:50:58 +02:00
Daniel Marjamäki
0dfbbd0f80
Fixed #5479 (Tokenizer: don't remove parentheses in code 'a<b<c>>(2)')
2014-05-11 08:22:28 +02:00
Daniel Marjamäki
2905593cf6
Merge pull request #302 from simartin/ticket_5774
...
Ticket #5774 : Properly handle "typename..." in template parameter list.
2014-05-10 09:32:06 +02:00
Simon Martin
46d8d81176
Ticket #5774 : Properly handle "typename..." in template parameter list.
2014-05-09 22:20:22 +02:00
PKEuS
edd84c0906
Fixed #5773 : Don't prepend "std::" to function definitions
2014-05-09 21:58:28 +02:00
Daniel Marjamäki
1541e27e4a
Fixed #5533 (False positive: 'Assignment of function parameter has no effect outside the function.')
2014-05-09 18:43:29 +02:00
Daniel Marjamäki
331d7e2e42
Merge pull request #297 from simartin/ticket_5605_5759
...
Fix ticket #5605 (take 3)
2014-05-08 15:51:42 +02:00
Simon Martin
2a6acdf357
Ticket #5605 : Don't consider '>' as a default template parameter value. Don't choke on template parameters with erroneous default values.
...
Ticket #5759 : Properly handle pointers to class members in template parameter lists.
Ticket #5762 : Handle template specialization tokens.
2014-05-08 13:54:56 +02:00
Daniel Marjamäki
9fc8bdcbac
Fixed #5770 (AST: better handling of 'a.b[c.d]==0')
2014-05-08 06:48:53 +02:00
Daniel Marjamäki
6e25280c90
Reverted fix for #5605 since it cause this crash: #5759
2014-05-05 21:11:47 +02:00
Daniel Marjamäki
7d583e639c
AST: Fixed handling of '(((typeof(x))*)0)'
2014-05-04 18:36:04 +02:00
Simon Martin
b03f36cd71
Ticket #5709 : Comma operator not properly tokenized.
2014-05-03 21:35:04 +02:00
Simon Martin
ffe6a0be2b
Ticket #5605 : Don't consider '>' as a default template parameter value. Don't choke on template parameters with erroneous default values.
2014-05-03 16:26:14 +02:00
Daniel Marjamäki
4b7aaba159
AST: assignment operators are executed from right to left
2014-05-03 12:08:42 +02:00
Daniel Marjamäki
648479d909
AST: Fixed tree for 'a.b[5]'
2014-04-29 06:09:26 +02:00
Daniel Marjamäki
9c74d914d7
Fixed #5667 (Tokenizer: simplify 'void (X::*f)()' to 'void *f')
2014-04-27 19:49:21 +02:00
Daniel Marjamäki
d279f3fb41
Fixed #5736 (AST: proper handling of 'a=(b).c;')
2014-04-27 18:03:50 +02:00
Daniel Marjamäki
9f2e37da37
AST: fixed 'a.b++' and '*c[5]--'
2014-04-27 16:02:24 +02:00
Robert Reif
ca9386859b
Tokenizer: replace ') const| {' pattern to detect function start
2014-04-26 18:31:56 +02:00