Commit Graph

130 Commits

Author SHA1 Message Date
IOBYTE b222953bae template simplifier: only constant fold template instantiation arguments (#1721)
* template simplifier: only constant fold template instantiation arguments

* Fix travis build.
2019-03-03 07:40:55 +01:00
IOBYTE b78b3c6ab1 Fixed #9005 (Syntax error on valid C++) (#1716) 2019-03-01 08:18:53 +01:00
Armin Müller f4b5b156d7 Typos found by running "codespell" (#1715) 2019-03-01 01:01:39 +01:00
IOBYTE 98bf112352 template simplifier: fix recursive variable templates (#1711) 2019-02-28 08:30:04 +01:00
IOBYTE 9d75b718d3 template simplifier: remove use of simplifyTokenList2 in tests (#1705) 2019-02-27 07:06:34 +01:00
IOBYTE bf85767829 template simplifier: make sure all instantiations are found and expan… (#1696)
* template simplifier: make sure all instantiations are found and expanded in #5097

* template simplifier: check output on another test

* template simplifier: add output to another test
2019-02-26 06:41:04 +01:00
IOBYTE 3f257d6310 template simplifier: instantiate template class when something inside… (#1695)
* template simplifier: instantiate template class when something inside class instantiated.

* template simplifier: add output to another test that now works
2019-02-25 21:01:34 +01:00
IOBYTE 41d87d6306 template simplifier: check output of a few crash and hang checks that now generate correct output (#1689) 2019-02-24 10:31:49 +01:00
IOBYTE 8bd5b3eccf Fixed #8962 ("(debug) Unknown type 'T'" with template typename parame… (#1671)
* Fixed #8962 ("(debug) Unknown type 'T'" with template typename parameter)

Only simple one parameter template functions with one function parameter
are supported.

* Added TODO test case for FIXME.
2019-02-14 11:48:59 +01:00
IOBYTE 155e4ce912 Fixed #8971 ("(debug) Unknown type 'x'." using alias in class members) (#1653)
* Fixed #8971 ("(debug) Unknown type 'x'." using alias in class members)

* template simplifier: partial fix for #8972

Add support for multi-token default template parameters.

* template simplifier: fix for #8971

Remove typename outside of templates.
2019-02-09 08:34:59 +01:00
Daniel Marjamäki bd7790fd8c Update copyright year 2019-02-09 07:24:06 +01:00
IOBYTE 7025254c26 Fixed #8969 (syntax error: template) (#1647)
Fixed template detection to handle multi-token template parameters.
2019-02-07 08:50:49 +01:00
IOBYTE 1faae52d06 Fixed #8960 ("(debug) Unknown type 'x'." with alias in template class alias) (#1643)
* Fixed #8960 ("(debug) Unknown type 'x'." with alias in template class alias)

This commit adds non-template type alias support to the template
simplifier.  Only relatively simple type aliases are supported at this
time. More complex types will be added later.

--debug-warnings will show unsupported type aliases.

Type alias support will be removed from the symbol database in the
future.  Type alias tests have been removed from the symbol database
tests.

* Add the changes.

* Fix codacy warning.

* Fix travis warnings.
2019-02-05 08:52:23 +01:00
IOBYTE d08aa666f6 template simplifier: fix crash on windows (#1639)
* template simplifier: fix crash on windows

Use right token when searching for template type alias to delete.

* template simplifier: fix a cppcheck warning
2019-02-01 06:59:49 +01:00
IOBYTE 98fc6d1d32 Fixed #8959 ("(debug) Unknown type 'x'" with using/alias) (#1635)
* Fixed #8959 ("(debug) Unknown type 'x'" with using/alias)

* fix cppcheck warning
2019-01-31 23:57:37 +01:00
IOBYTE 68bbe15116 template simplifier: fix missing instantiation (#1627) 2019-01-26 07:08:54 +01:00
IOBYTE cb1a1df0fa template simplifier: fix out of line member function scope and use more full name matching (#1617) 2019-01-24 07:21:22 +01:00
IOBYTE ec8bc785a2 template simplifier: add support for using namespace when instantiating templates (#1615) 2019-01-23 08:53:01 +01:00
IOBYTE 1acbdde302 Fixed #7417 ("syntax error" in valid code containing explicitly specialised variable template) (#1604) 2019-01-18 21:12:39 +01:00
Daniel Marjamäki 8dd641b8be Use OVERRIDE in test 2019-01-12 15:45:25 +01:00
practicalswift 0a1b3a9d6f Fix typos (#1568) 2019-01-06 17:15:57 +01:00
IOBYTE 32a5d66e5b Fixed #8927 (SIGSEGV below TemplateSimplifier::expandTemplate) (#1564) 2019-01-05 11:14:09 +01:00
IOBYTE 3b9828a132 template simplifier: fix crash on daca c++-annotations project (#1556)
Fix scope info bug on derived template class which caused a use after
free crash when deleting a template forward declaration in a different
scope.
2019-01-02 07:15:45 +01:00
IOBYTE c37b807613 template simplifier: also check if instantiated template is not specialized (#1551) 2018-12-31 21:29:53 +01:00
IOBYTE 9dc8faa3b6 template simplifier: fix location of forward declaration for explicit specializations (#1550) 2018-12-31 17:19:34 +01:00
IOBYTE da91ce2016 Fixed #6183 (TemplateSimplifier: Does not handle methods) (#1546)
* Fixed #6183 (TemplateSimplifier: Does not handle methods)

* Fix function lookup.
2018-12-29 11:19:53 +01:00
Daniel Marjamäki 162576146e Revert "Fixed #6183 (TemplateSimplifier: Does not handle methods) (#1540)"
This reverts commit 7875555b03.
2018-12-24 20:10:00 +01:00
IOBYTE 7875555b03 Fixed #6183 (TemplateSimplifier: Does not handle methods) (#1540) 2018-12-24 07:25:11 +01:00
IOBYTE 48c960f56c template simplifier: better detection of template functions (#1539)
* template simplifier: better detection of template functions

* fix comment
2018-12-22 10:05:10 +01:00
IOBYTE d528934139 template simplifier: also remove forward declarations when removing expanded templates (#1536) 2018-12-20 20:55:27 +01:00
IOBYTE c31331d085 template simplifier: fix explicit instantiation with types starting with const and ending in * and &. (#1530) 2018-12-19 21:59:59 +01:00
IOBYTE 2090866cd0 template simplifier: remove explicit instantiations after instantiation (#1523)
* template simplifier: remove explicit instantiations after instantiation

* Fix use after free crash in clang test suite.
2018-12-17 05:58:48 +01:00
IOBYTE a1c275436f Fix #8902 (Crash in TemplateSimplifier) (#1521) 2018-12-15 07:52:47 +01:00
IOBYTE a90c56ad76 Fixed #8880 (Regression: syntax error for valid C++ template code) (#1509) 2018-12-06 21:47:48 +01:00
IOBYTE 3d024f3f6d template simplifier: fix function forward declaration bug for constructor with initializer list. (#1497) 2018-11-29 06:24:28 +01:00
IOBYTE f2660ed203 template simplifier: fix instantiated template names in forward declarations (#1495)
This now handles the revised example code in #8603.
2018-11-27 06:17:04 +01:00
IOBYTE e20079a5d9 template simplifier: fix 3 function forward declaration bugs (#1493)
* fix support for multi token types
* fix support for const member functions
* fix duplicate template parameters sometimes being inserted
2018-11-26 06:23:12 +01:00
IOBYTE 358f0c473d Modify template simplifier to add forward declarations of some templa… (#1489)
* Modify template simplifier to add forward declarations of some template functions so symbol database can make sense of the expanded templates.

* Fix travis.
2018-11-23 11:36:09 +01:00
IOBYTE 69e6e11844 Fix a template simplifier namespace bug in #7145 (#1473)
* Fix a template simplifier namespace bug in #7145

* Refactor template simplifier to only call getTemplateDeclarations once per loop.
2018-11-10 16:41:14 +01:00
IOBYTE 17a8a4898d Fix another template simplifier namespace bug. (#1467)
* Fix another template simplifier namespace bug.

* Add missing forward declarations caused by token bug.
2018-11-07 21:25:42 +01:00
IOBYTE 9b67e680ae Fix template simplifier namespace support. (#1464) 2018-11-05 19:55:21 +01:00
Daniel Marjamäki 3798feecad TemplateSimplifier : Remove 'class|struct' in template arguments 2018-11-02 14:49:40 +01:00
IOBYTE adbbadec7f Fixed #8798 (template simplifier: wrong simpifications for namespaces) (#1452) 2018-10-26 14:20:13 +02:00
IOBYTE 0763fdbfad Copy template default argument values from forward declaration to declaration. (#1447)
It is possible to define default template parameter values in forward
declarations and not define any in the actual declaration.  Cppcheck
ignores forward declarations and only uses the default values in the
actual declaration so default values in forward declarations are copied
to the actual declaration when necessary.
2018-10-24 14:38:59 +02:00
IOBYTE 290563b964 Fix specialized template regression. (#1425)
* Fix specialized template regression.

Only check for instantiation of template being processed rather than
count of all instantiations.

* Add 2 more tests.
2018-10-15 19:35:26 +02:00
IOBYTE 0a30768b59 Fixed #8693 (Template specialization: Constructor detected as normal … (#1418)
* Fixed #8693 (Template specialization: Constructor detected as normal function (functionStatic error))

Refactor template simplifier to remove the existing full specialization
function expandSpecialized and allow full specializations to use the
existing function expandTemplate.  The function expandTemplate was
modified to either expand the template like it originally did by copying
it or to modify the template in place.  Both instantiated and
uninstantiated full specializations are modified in place.  This also
fixes #8692 and probably other related tickets as well.

The function simplifyTemplates now tries twice to simplify templates so
more templates can be simplified.  We should try as many times as
necessary to find all possible templates.  We can't do that now because
uninstantiated templates are left unchanged.  It is relatively straight
forward to have the new code also expand in place uninstantiated
templates with their symbolic types but namespaces are not handled
properly (ticket #8671) and it would introduce regressions.

* Fix travis warnings.
2018-10-14 16:57:07 +02:00
IOBYTE 33b74a04ab Add union support to template simplifier. (#1398) 2018-09-26 06:23:12 +02:00
Simon Martin 6bde2445a6 Ticket #8632: Parenthesize ternary operator operands containing < to avoid wrongly thinking a template instantiation is met. (#1389) 2018-09-23 10:27:38 +02:00
IOBYTE e9a44f70b2 Remove out of line member functions of instantiated template classes. (#1377)
* Remove out of line member functions of instantiated template classes.
2018-09-14 14:16:34 +02:00
IOBYTE 7224ee27d9 Fixed #8122 (simplifyTemplates: constructor outside template class not simplified properly) (#1361) 2018-09-02 17:49:13 +02:00