Syntactically, they do have an initializer, but they are not
initializations.
Change-Id: I0556b279ce2d173868585cbce085b803c1cff285
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
To be able to do this, the parser needs to store the decl specifier list
in FunctionDeclaratorAST objects, the same way it is done for
FunctionDefinitionAST.
Task-number: QTCREATORBUG-24894
Change-Id: I475fb08b1f14c63f3050d72dff200c1b08df5789
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... to the function type.
This fixes the issue for function *definitions*. For function
*declarations*, we need to amend the parser.
Task-number: QTCREATORBUG-24894
Change-Id: I02043d8b974c2c64dcd739c7e05ce44fd277b5d3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Static member functions cannot modify the object and therefore must not
be reported as writable references.
Note that this does not have an effect yet, as the function type lacks
information about the "static" specifier.
Task-number: QTCREATORBUG-24894
Change-Id: Ib04a17864a0ca5b7610579a2f5efbcfde257e08a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... from those without one, and display the former like write accesses.
Task-number: QTCREATORBUG-24894
Change-Id: I5e2d83b2a3ec4735054441c346687f97eeb039fb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
... when trying to find out the usage type of a function argument.
Otherwise, we potentially ignore functions which have additional
overloads with a shorter parameter list than is required for the call.
Change-Id: I02bf2cb359ea9d506e2644388234dc28fa072445
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
That is, find out whether a certain access was a read, a write, a
declaration or something else, and report the result to upper layers.
Follow-up patches can make this information visible to users.
Task-number: QTCREATORBUG-12734
Task-number: QTCREATORBUG-19373
Change-Id: Iee79e39dd1eb5a986a7e27846991e0e01b2c3a2f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Code snippet:
template<class T> struct MyStruct { int value; };
int main() {
auto s = MyStruct<int>();
s.value; // "value" is not found
}
This fixes find usages for unique_ptr declared as auto like this:
auto ptr = std::unique_ptr<MyStruct>(new MyStruct());
ptr->value;
Also fixes in-place constructors:
std::unique_ptr<MyStruct>(new MyStruct())->value;
Fixes: QTCREATORBUG-15364
Change-Id: I8d452a77fe85e63665ec8d4c4afbcf8aad063121
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Code snippet:
void bar(); // call find usages for bar from here
void foo(int bar); // bar from here should not be in results
Add test for member function false positives, that is part of
QTCREATORBUG-2176. That was already fixed before.
Fixes: QTCREATORBUG-2176
Change-Id: I9a079caa83bbaea1edb7ba6aeb151d4d4c77952f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Catch test functions defined with function-like macros.
To speed-up semantic analysis, find usages does not expand function-like
macros.
Semantic fails with "expected a function declarator" on such functions
and skips function body.
To avoid that, we create dummy function type specifically for this case
Change-Id: Ie2f2464ee57aa4dc86eed07b8b699458f95c0266
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Fix parser to not fail on TemplateId without parentheses, for example:
int i = foo<int> + foo<char>;
This fixes std::pair structure parsing in MSVC headers and find Usages
to work with pair->first and pair->second.
Change-Id: Ic300ea99d44a749705430d5eb47b2744715af995
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
These changes target Find Usages feature to work with shared_ptr.
Improve libs/3rdparty/cplusplus and plugins/cplusplus:
parse __declspec() attribute,
call to variadic function template without specified template arguments,
if constexpr,
c++11 attributes [[value]],
function templates with default parameters,
resolve order for function vs template with default parameter,
template operator->() with default arguments,
template specialization with numeric values,
find best partial specialization,
fix partial specialization for non-first specialized argument
Fixes: QTCREATORBUG-7866
Fixes: QTCREATORBUG-20781
Fixes: QTCREATORBUG-22857
Fixes: QTCREATORBUG-17825
Change-Id: I31a080f7729edfb2ee9650f1aff48daeba5a673b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Nikolai Kosjar <pinaceae.pinus@gmail.com>
Recently tons of warnings show up for presumably "problematic"
singned <-> unsigned and size conversions.
The Qt side uses 'int', and that's the biggest 'integration surface'
for us, so instead of establishing some internal boundary between
signed and unsigned areas, push that boundary out of creator core code,
and use 'int' everywhere.
Because it reduces friction further, also do it in libcplusplus.
Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Based on Tobias Hunger's work from a few months ago.
The CMake configuration needs libclang and Qt paths specified as
CMAKE_PREFIX_PATH.
Auto tests are run with "ctest". At the moment the pass rate is 87%.
Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Note: Since not all autotests are able to run from an installed location,
we need to be able to start them from the build directory, which
in turn forces us to set a destination directory for libraries and plugins,
so they will be found at run-time.
Change-Id: Idcf7e1333dfa6e9dbf745391b78c035f842ccc5a
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
When the cursor is on the name of declaration of a templated function,
then since f93758b8e1 the scope returned
by Document::findScopeAt is the scope of the template declaration.
Before it was the parent scope of the template declaration.
The check in FindUsages::checkCandidates did not check all combinations
of template(-child symbol) scopes for the searched symbol and its
occurrences.
Task-number: QTCREATORBUG-9749
Change-Id: Idc84a2ba718721ce54683a67635a93352784ddd1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Fix find usages for template class(class name and template parameters)
or template function(template parameters).
Fixed:
* marking
* find usages
* follow symbol
Change-Id: I22fdbc11260cbd8ee9aafdd76aaeee0f4f49f9fd
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
If type is not found we try to find 'using' declaration for this type.
Task-number: QTCREATORBUG-7903
Change-Id: I569db9e1a8504a5da3115ebbed2e823d5924f6ca
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
... and adjust INCLUDEPATH accordingly.
while i'm at messing with include statements, also re-order the include
blocks according to policy and sort them within bigger blocks.
Change-Id: I7762abfd7c4ecf59432b99db2f424e4fa25733a5
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>