From 97d3d9ac0946f3be0e036b70401352e3ddaeb8fc Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 7 Jun 2015 11:47:50 +0300 Subject: C++: Support default template argument lookup for specialization 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 Temp; template<> class Temp { int var; }; void func() { Temp<> t; t.var; // var not highlighted } Task-number: QTCREATORBUG-8922 Change-Id: I593515beb3a6d901b6088db8bc1b8e16c39083d3 Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/cppcompletion_test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/plugins/cpptools/cppcompletion_test.cpp') diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp index 563a6b9a1c..3bf0904c65 100644 --- a/src/plugins/cpptools/cppcompletion_test.cpp +++ b/src/plugins/cpptools/cppcompletion_test.cpp @@ -2689,6 +2689,19 @@ void CppToolsPlugin::test_completion_data() << QLatin1String("f") << QLatin1String("and_type")); + QTest::newRow("specialization_with_default_value") << _( + "class Foo {};\n" + "template class Temp;\n" + "template<> class Temp { int var; };\n" + "void func()\n" + "{\n" + " Temp<> t;\n" + " @\n" + "}\n" + ) << _("t.") << (QStringList() + << QLatin1String("var") + << QLatin1String("Temp")); + QTest::newRow("auto_declaration_in_if_condition") << _( "struct Foo { int bar; };\n" "void fun() {\n" -- cgit v1.2.1