Commit Graph

2435 Commits

Author SHA1 Message Date
IOBYTE f02e45bf3d fix syntax error for std::literals::complex_literals::operator""if (#1870) 2019-06-05 10:15:22 +02:00
IOBYTE bee248b2de token simplifier: fix namespace, token link and syntax error support for template type aliases (#1863) 2019-06-01 10:52:29 +02:00
Paul Fultz II 33130bdff6 Fix issue 9145: Syntax error on valid C++14 code (#1860) 2019-05-31 08:05:01 +02:00
Paul Fultz II 312fdf157b Fix issue 9144: Syntax error with type intrinsics (#1852)
* Fix issue 9144: Syntax error with type intrinsics

* Only run when using cpp
2019-05-27 06:54:21 +02:00
Paul Fultz II 61935802d1 Fix issue 9141: Syntax error (#1853) 2019-05-27 06:50:43 +02:00
Daniel Marjamäki de4a33167d astyle formatting
[ci skip]
2019-05-21 10:43:33 +02:00
Paul Fultz II 9949ae1b4f Fix issue 8995: False Positive: Redundant code with initializer-list created object (#1844) 2019-05-21 10:40:36 +02:00
Paul Fultz II 9055682fdc Fix synax error in issue 9057 and 9138 (#1843) 2019-05-21 08:47:10 +02:00
Paul Fultz II ce96ec2773 Fix issue 9136: Syntax error on valid C++14 code: createLinks2() failed 2019-05-19 19:06:12 +02:00
Paul Fultz II 8cbd9b03aa Fix issue 8890: AST broken calling member function from templated base class (#1836)
* Fix issue 8890: AST broken calling member function from templated base class

* Format

* Check for double bracket

* Add test to createLinks2

* Remove extra test

* Reduce test case for links
2019-05-19 10:05:34 +02:00
Daniel Marjamäki 57c6628732 Revert 'Cleaning up unsimplified templates'. This fix caused problems. 2019-05-16 21:11:04 +02:00
Daniel Marjamäki 34cf62452e Change approach for Tokenizer::createLinks2: assume that <> should be linked 2019-05-16 20:50:56 +02:00
Daniel Marjamäki 0144db2490 Fixed 'Syntax Error' when < link is not set properly 2019-05-15 21:34:56 +02:00
Daniel Marjamäki 21ec78d8a1 Fix typo: %stype% => %type% 2019-05-15 09:06:27 +02:00
Daniel Marjamäki 79bb22f038 Fixed #9131 (Tokenizer::createLinks2; using std::list; list<config_option*> stack;) 2019-05-14 20:30:02 +02:00
Daniel Marjamäki 27fad38e00 Fixed #9084 (Tokenizer::setVarId: Same varid for member variable and argument, unknown template type) 2019-05-12 09:10:37 +02:00
Daniel Marjamäki 4d9b1e6c3d Fixed #9094 (Tokenizer::createLinks2 problem with 'x%x<--a==x>x') 2019-05-11 19:11:40 +02:00
Daniel Marjamäki d58d4273f9 Cleaning up unsimplified templates 2019-05-11 13:00:03 +02:00
IOBYTE eade2bb2c2 Add support for simplifying user defined literal operator. (#1827) 2019-05-09 09:52:18 +02:00
Daniel Marjamäki f6527fcd9b fixed tests, unused templates are removed by default 2019-05-05 19:40:58 +02:00
IOBYTE 505b7f7ebd Fixed #9110 (Syntax error on valid C++ code) (#1813) 2019-04-29 15:17:37 +02:00
Daniel Marjamäki aaf1af6736 Fix Cppcheck passedByValue warning 2019-04-28 07:58:47 +02:00
IOBYTE e786c6b7d4 partial fix for #8663 (Stack overflow with template disambiguator) (#1801)
This fixes simplifyUsing to remove 'typename' and 'template' from type
aliases of the form: using T3 = typename T1::template T3<T2>;

This lets the template simplifier instantiate the type alias which will
then remove the using type alias.

The crash will still happen if there is no instantiation because the
type alias will not be removed.  The type alias is what cppcheck is
crashing on after the template simplifier and that still needs fixing.
2019-04-21 06:46:16 +02:00
amai2012 28bc3cad92 #8913 SIGSEGV in CheckUnusedVar::checkFunctionVariableUsage - C++/CLI code 2019-04-19 13:55:25 +02:00
IOBYTE 7799ed4243 Fixed #8889 (varid on function when using trailing return type.) (#1800)
* Fixed #8889 (varid on function when using trailing return type.)

Don't set varid for trailing return type.

* Add a test for #9066 (Tokenizer::setVarId: varid set for trailing return type)
2019-04-18 20:22:39 +02:00
Daniel Marjamäki b1b5b27b4e addons: write column in error message(s) 2019-04-13 10:22:13 +02:00
Daniel Marjamäki b04d1815ed Add -std=c++17 and allow semicolon in 'if ()' 2019-04-12 09:10:25 +02:00
Daniel Marjamäki f6b410b469 GUI: add setting for 'checkHeaders', 'checkUnusedTemplates' and 'maxCtuDepth' to project 2019-04-10 16:49:24 +02:00
Daniel Marjamäki 7610513c49 Fixed #9090 (Do not simplify standard functions) 2019-04-08 19:00:46 +02:00
Daniel Marjamäki 83106d5827 Unused templates: Remove unused template function with variadic arguments 2019-04-07 08:37:04 +02:00
Rikard Falkeborn d23e987941 Fix CheckInternal warnings (#1790) 2019-04-06 06:55:46 +02:00
Daniel Marjamäki 73433c2961 Syntax error: Clarify a syntax error in audacity 2019-03-31 10:46:59 +02:00
Daniel Marjamäki b30d463baf Fix wrong syntax error 2019-03-31 09:34:19 +02:00
IOBYTE 22f01f035c Fixed #9042 (Another `using BOOL` type breach) (#1765) 2019-03-27 21:42:50 +01:00
Daniel Marjamäki 0f6a90c595 Fixed #9069 (crash on invalid code: ' x= y{ } name5 ')
Credit to OSS-Fuzz for reporting this!
2019-03-27 18:17:11 +01:00
Frank Zingsheim 574b77cf1f Fixed: FP return reference to thread_local variable (#1758) 2019-03-27 12:22:53 +01:00
Daniel Marjamäki c77f31319d Fix crash when checking re2c textfile 2019-03-26 20:51:41 +01:00
Daniel Marjamäki c262aeffdd Fixed #9068 (crash on invalid code) 2019-03-26 19:57:32 +01:00
Daniel Marjamäki 15676612c0 Fixed #9034 (crash on reading invalid code: '> typedef') 2019-03-26 16:14:24 +01:00
IOBYTE 5b72e1f568 Fixed #9040 (Type alias 'BOOL' declared with 'using' keyword breaks type detection) (#1759)
Moved simplifyUsing from TemplateSimplifier to Tokenizer.
2019-03-26 07:09:56 +01:00
Daniel Marjamäki 49e2f9d551 Fixed #9063 (Crash on invalid code: x='0' ++ '0' ( return)[ ];) 2019-03-25 15:29:23 +01:00
IOBYTE b6faa11fbf Fixed #9056 ("using namespace" inside namespace causes "SymbolDatabase bailout;) (#1753)
Fixed the bailout warning and one of the varid bugs.

The trailing return type still has a varid.
2019-03-24 17:31:34 +01:00
Daniel Marjamäki e0f1418228 Fixed #9034 (Tokenizer::setVarId: function call parameter is not variable declaration) 2019-03-24 07:06:21 +01:00
Daniel Marjamäki d82c792c1b astyle formatting 2019-03-23 19:00:03 +01:00
Daniel Marjamäki a9082c902a Fixed #9058 (crash on invalid code in FwdAnalysis::checkRecursive) 2019-03-23 18:27:41 +01:00
IOBYTE 40af889df0 Fixed #9053 (simplifyTypedef: wrong simplification of '(const d)' when 'd' is a array) (#1751)
* Fixed #9053 (simplifyTypedef: wrong simplification of '(const d)' when 'd' is a array)

* fix whitespace
2019-03-23 10:45:38 +01:00
Rikard Falkeborn 794f65bac1 Handle prefixed strings and characters in Token (#1742)
This makes it possible to call getStrLength() and similar functions
before the tokenizer is called.
2019-03-18 06:18:25 +01:00
Daniel Marjamäki a2a216bbe3 SymbolDatabase: Improved handling of 'normal' non simplified token list 2019-03-15 19:00:42 +01:00
Rikard Falkeborn 6a3dd9a185 Handle concatenated string and char literals
This handles concatenated strings and characters from simplecpp.
Previously, L'c' would be preprocessed to the tokens  "L" and "'c'".
cppcheck would then remove the "L" token and set "'c'" to be a wide
character literal. Now, it needs to remove the prefix instead.

When doing this, add handling of utf32 encoded literals (U) and UTF-8
encoded literals (u8).
2019-03-10 10:38:50 +01:00
Daniel Marjamäki 75ce67f4b8 Fixed #9027 (cppcheck on Centos 7 - segmentation fault below CheckCondition::multiCondition2) 2019-03-08 19:27:20 +01:00