1. 13 Jan, 2016 1 commit
  2. 19 Nov, 2015 1 commit
    • Nikolai Kosjar's avatar
      C++: Revert lookup to 3.4.2 · 0498fb68
      Nikolai Kosjar authored
      ...which was least buggy.
      
      The bugs fixed by the changes we revert here (highlighting/completion
      for code involving templates) were minor compared to ones we currently
      have. Those bugs will be addressed by the clang code model anyway.
      
      Relevant commits were collected via:
      
        $ cd ${QTC}/src/libs/cplusplus
        $ git log \
         --no-merges \
         --format=oneline \
         v3.4.2..HEAD \
         -- LookupContext.* ResolveExpression.* TypeResolver.* TypeOfExpression.* \
            ../../plugins/cpptools/cppcompletion_test.cpp
      
      From this list the following were skipped due to irrelevance:
      
        88c5b47e # CppTools: Minor cleanup in completion tests
        e5255a1f # CppTools: Add a test for ObjC not replacing dot with arrow
        5b12c8d6 # CppTools: Support ObjC in member access operator tests
        9fef4fb9 # CPlusPlus: Fix warnings about overriding visit(...) methods
      
      There were only minor conflicts while reverting those.
      
      This changes touches so many files because there were quite some
      cleanups and renames after the 3.4.2 release.
      
      Task-number: QTCREATORBUG-14889
      Task-number: QTCREATORBUG-15211
      Task-number: QTCREATORBUG-15213
      Task-number: QTCREATORBUG-15257
      Task-number: QTCREATORBUG-15264
      Task-number: QTCREATORBUG-15291
      Task-number: QTCREATORBUG-15329
      Change-Id: I01f759f8f35ecb4228928a4f22086e279c1a5435
      Reviewed-by: default avatarMarco Bubke <marco.bubke@theqtcompany.com>
      0498fb68
  3. 20 Oct, 2015 1 commit
  4. 28 Sep, 2015 1 commit
    • Nikolai Kosjar's avatar
      C++: Comment out a flaky test · e241444b
      Nikolai Kosjar authored
      The test relied on logic that was reverted with change
      915f68de.
      
      LookupScopePrivate::findSpecialization() gets a "TemplateNameIdTable
      &specializations" with a non-deterministic order. Without the extra
      logic, the very first entry will be chosen as the found specialization.
      
      The non-deterministic order comes from the TemplateNameId::Compare,
      which calls std::lexicographical_compare() with the template arguments,
      which are FullySpecifiedTypes. The result of
      FullySpecifiedType::operator<() might depend on a pointer comparison.
      
      Change-Id: I8d69d1bb5831145b1c21a5ea848c0043f17ec415
      Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
      e241444b
  5. 23 Sep, 2015 2 commits
  6. 10 Sep, 2015 1 commit
  7. 31 Aug, 2015 1 commit
  8. 21 Aug, 2015 1 commit
  9. 01 Jul, 2015 1 commit
    • Orgad Shaneh's avatar
      C++: Cleanup LookupContext · 7bed5cd3
      Orgad Shaneh authored
      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: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      7bed5cd3
  10. 29 Jun, 2015 3 commits
  11. 09 Jun, 2015 2 commits
    • Orgad Shaneh's avatar
      C++: Support default template argument lookup for specialization · 97d3d9ac
      Orgad Shaneh authored
      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: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      97d3d9ac
    • Orgad Shaneh's avatar
      C++: Improve accuracy in findSpecialization · 997ab425
      Orgad Shaneh authored
      * 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: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      997ab425
  12. 04 Jun, 2015 2 commits
  13. 02 Jun, 2015 1 commit
    • Orgad Shaneh's avatar
      C++: Fix lookup for instantiation of using · b67ebf9f
      Orgad Shaneh authored
      Yet another std::vector issue...
      
      Use-cases:
      // Case 1
      template<typename T>
      using type = T;
      
      // Case 2
      struct Parent {
          template<typename T>
          using type = T;
      };
      
      // Case 3
      template<typename T>
      struct ParentT {
          template<typename DT>
          using type = DT;
      };
      
      struct Foo { int bar; };
      
      void func()
      {
          type<Foo> p1;
          Parent::type<Foo> p2;
          ParentT<Foo>::type<Foo> p3;
          // bar not highlighted
          p1.bar;
          p2.bar;
          p3.bar;
      }
      
      Task-number: QTCREATORBUG-14480
      Change-Id: I9ab08ea7360a432c48eb4b85aa0d63e08d2464c1
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      b67ebf9f
  14. 01 Jun, 2015 1 commit
  15. 22 May, 2015 1 commit
  16. 20 May, 2015 2 commits
  17. 15 May, 2015 2 commits
  18. 28 Apr, 2015 1 commit
    • Orgad Shaneh's avatar
      C++: Fix specialization resolution for nested types · ad4cb444
      Orgad Shaneh authored
      Use-cases:
      
      template<typename T>
      struct Traits { typedef typename T::pointer pointer; };
      
      template<typename _Tp>
      struct Traits<_Tp*> { typedef _Tp *pointer; };
      
      struct Foo { int bar; };
      
      // 1
      template<typename T>
      class Temp
      {
      protected:
         typedef Traits<T> TraitsT;
      
      public:
         typedef typename TraitsT::pointer pointer;
         pointer p;
      };
      
      void func()
      {
         Temp<Foo *> t;
         t.p-> // complete
      }
      
      // 2
      class Temp2
      {
      protected:
         typedef Foo *FooPtr;
         typedef Traits<FooPtr> TraitsT;
      
      public:
         typedef typename TraitsT::pointer pointer;
         pointer p;
      };
      
      void func2()
      {
         Temp2 t;
         t.p-> // complete
      }
      
      Task-number: QTCREATORBUG-14141
      Change-Id: Id3459671117c0c81bcde7c9714b42750634c0225
      Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
      ad4cb444
  19. 24 Apr, 2015 2 commits
  20. 23 Apr, 2015 1 commit
  21. 13 Apr, 2015 1 commit
  22. 11 Apr, 2015 1 commit
  23. 01 Apr, 2015 2 commits
  24. 25 Mar, 2015 1 commit
  25. 24 Mar, 2015 1 commit
  26. 13 Mar, 2015 1 commit
  27. 05 Mar, 2015 1 commit
  28. 27 Feb, 2015 1 commit
  29. 26 Feb, 2015 3 commits