This mainly reverts
commit 81721f6781
C++: Fix resolving of recursive typedef
commit 2070431d8c
C++: Fix resolving of partial specialization
and some bits of other changes due to dependencies. It also reverts
commit e0594fc9b9
C++: Fix expensive lookup for boost
which attempted to solve the upcoming problems.
Task-number: QTCREATORBUG-14741
Task-number: QTCREATORBUG-14889
Task-number: QTCREATORBUG-14962
Change-Id: I3f9e1f97199e5199b71da394fc27051c7709bd1f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
With this patch, CheckSymbols takes about 200ms for processing the boost/proto
hello world example [1]. Before, it needed about 11 seconds (timer in
CheckSymbols::run). Same goes for including <boost/fusion/include/zip.hpp>.
The custom ProcessedSet object was added to support "completion for typedefs
for templates in namespaces", but apparently that's not needed anymore, as the
added test proves.
[1] http://www.boost.org/doc/libs/1_58_0/doc/html/proto/users_guide.html#boost_proto.users_guide.getting_started.hello_world
Task-numer: QTCREATORBUG-14889
Task-numer: QTCREATORBUG-14741
Change-Id: I90454e8970a9d04033d56beeb0c6d7a0d4e6cc62
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
If no template is found, findSpecialization will crash
Task-number: QTCREATORBUG-14748
Change-Id: I94b970e6eb994f0a8d85a4b996e52fcff0affef3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Since the cache is now more reliable, some workarounds and optimizations
in the instantiation process are not needed anymore.
Also avoid instantiation of base classes when expandTemplates is
disabled.
As a bonus, we now resolve decltype of template function for a type that is not
referenced anywhere but in the decltype.
Change-Id: Idf42ba7280992db477c9aa62bb1815b27174594d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Defined in section 14.7.2 of the standard.
Fixes completion for std::string.
The following explicit instantiation appears in bits/basic_string.tcc:
extern template class basic_string<char>;
This is wrongfully considered a specialization for a forward declaration
(like `template<> class basic_string<char>` is).
Introduce a new Symbol type for explicit instantiations.
Use-case:
template<class T>
struct Foo { T bar; };
template class Foo<int>;
void func()
{
Foo<int> foo;
foo.bar; // bar not highlighted
}
Change-Id: I9e35c8c32f6b78fc87b4f4f1fc903b42cfbd2c2b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This fixes std::vector, although it doesn't really resolve numeric
template arguments. It just picks the first specialization.
Use-case:
class Foo {};
template<class T1 = Foo> class Temp;
template<> class Temp<Foo> { int var; };
void func()
{
Temp<> t;
t.var; // var not highlighted
}
Task-number: QTCREATORBUG-8922
Change-Id: I593515beb3a6d901b6088db8bc1b8e16c39083d3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* If a template type is specialized as a pointer, accept only pointers (of any
type)
* Same for references and arrays
* Only if the specialized type is not part of the template, match it
against the input.
Fixes resolving of partial specialization with pointers.
Use-cases:
// 1
struct b {};
struct a : b {};
template<class X, class Y> struct s { float f; };
template<class X> struct s<X, b*> { int i; };
template<class X> struct s<X, a*> { char j; };
void f()
{
s<int, a*> var;
var.j; // j not highlighted
}
// 2
template <typename T> struct Temp { T variable; };
template <typename T> struct Temp<T &> { T reference; };
void func()
{
Temp<int&> templ;
templ.reference; // reference not highlighted
}
// 3
class false_type {};
class true_type {};
template<class T1, class T2> class and_type { false_type f; };
template<> class and_type<true_type, true_type> { true_type t; };
void func2()
{
and_type<true_type, false_type> a;
a.f; // f not highlighted
}
Task-number: QTCREATORBUG-14036
Change-Id: Idee5e3f41d15c0772318d3837cbcd442cb80293a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
addNestedType should never accept null scope.
Change-Id: I6e4a86d0c7595af11079915faffdd8d213e92bd2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
The last nail for std::unique_ptr (GCC variant, MSVC still doesn't work).
Use-case:
template<typename T>
static T f();
struct Foo { int bar; };
void fun()
{
decltype(f<Foo>()) s;
s.bar; // bar not highlighted
}
Task-number: QTCREATORBUG-14483
Task-number: QTCREATORBUG-8937
Change-Id: I5bab757400b070cf9dbb688a44fd8eafe95ddc61
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
There's no reason to keep the Template after it is instantiated.
Change-Id: I91210ae11b3420bb038168fe951b52d28ccc132e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
typedef for QSharedPointer<CreateBindings>
Change-Id: Idf7a9984bb90da82407abd4b7dec9f40926beac8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Missed a spot in ad4cb444fb
Task-number: QTCREATORBUG-14141
Change-Id: I1a6a25ce3e9c2a680e1b8eebec01a17749cdb026
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Was readded by mistake when the type was pimpled.
Change-Id: I4150b783a1b54dda6070a49f78bcb8b0fcb9f414
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
... except the global namespace and blocks
Change-Id: I0696b4997c28b5105a000bae2a9a4fa1a56eb6d3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Makes it easier to add features to ClassOrNamespace without rebuilding half of
the project.
Change-Id: I7ac646e8ad08fc8da6f7ed43ff184fb17edbd6b7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
It is only used in LookupContext.cpp
Change-Id: I7b1b4a634fea8560102f2c17afcaacd2773de98a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This avoids unnecessary detaches of the Qt container data.
The mismatches where detected by defining QT_STRICT_ITERATORS;
however, this define violates the ODR (causing linker errors),
and therefore is not added permanently.
Change-Id: Idd336a9c8b394214a820437ef1b92d2101f6101c
GPush-Base: 62b0848b9c
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
In the struct _Wrap_alloc (see test code) the rebind struct has
_Wrap_alloc as parent. However, within rebind the typedef of type
_Wrap_alloc has rebind as parent.
We will refactor that in master by introducing a "parent iterator"
class checking for cycles, so the client code looks less noisy.
Task-number: QTCREATORBUG-13703
Change-Id: I7b6cf819ea869139d2403e15ba085d8fba19763e
Reviewed-by: Cristian Adam <cristian.adam@gmail.com>
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Take 2
Task-number: QTCREATORBUG-13757
Change-Id: I9c2558bf01121e53710db984a99d37c2c6cafaf4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Breaks loading of qtcreator project.
This reverts commit 4c6ad5e305.
Change-Id: I7c4cdaf57eed16d7643d05b9456e03d5120259b3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>