diff --git a/src/indexer.cc b/src/indexer.cc index e0294c50..19b3ea7a 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -1009,6 +1009,8 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { AddDeclTypeUsages(db, decl_cursor, decl->semanticContainer, decl->lexicalContainer); + func->is_constructor = decl->entityInfo->kind == CXIdxEntity_CXXConstructor; + // Add parameter list if we haven't seen this function before. // // note: If the function has no parameters, this block will be rerun @@ -1110,8 +1112,8 @@ void indexDeclaration(CXClientData client_data, const CXIdxDeclInfo* decl) { clang_getOverriddenCursors(decl->cursor, &overridden, &num_overridden); - // FIXME if it ever shows up. Methods should only ever have 1 base - // type, though. + // FIXME: this happens for destructors when there are multiple + // parent classes. if (num_overridden > 1) std::cerr << "[indexer]: warning: multiple base overrides for " << func->def.detailed_name << std::endl; @@ -1311,10 +1313,6 @@ void indexEntityReference(CXClientData client_data, clang::Cursor cursor(ref->cursor); - // std::cerr << "REF kind=" << ref->referencedEntity->kind << " at " << - // db->id_cache.Resolve(cursor, false).ToPrettyString(&db->id_cache) << - // std::endl; - switch (ref->referencedEntity->kind) { case CXIdxEntity_CXXNamespaceAlias: case CXIdxEntity_CXXNamespace: { diff --git a/src/indexer.h b/src/indexer.h index 84aea149..888cb2f1 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -329,6 +329,8 @@ struct IndexFunc { std::vector param_spellings; }; + // True iff this is a constructor. + bool is_constructor = false; // Type description for each parameter. This is stored in the sharable // section (instead of the def) because it is while indexing cross-refs for // constructors, which means the def may not yet be available if the function diff --git a/src/serializer.cc b/src/serializer.cc index f788670f..2cb6ebfa 100644 --- a/src/serializer.cc +++ b/src/serializer.cc @@ -86,6 +86,7 @@ void Reflect(TVisitor& visitor, IndexFunc& value) { REFLECT_MEMBER2("usr", value.def.usr); REFLECT_MEMBER2("short_name", value.def.short_name); REFLECT_MEMBER2("detailed_name", value.def.detailed_name); + REFLECT_MEMBER2("is_constructor", value.is_constructor); REFLECT_MEMBER2("parameter_type_descriptions", value.parameter_type_descriptions); REFLECT_MEMBER2("declarations", value.declarations); REFLECT_MEMBER2("definition_spelling", value.def.definition_spelling); diff --git a/tests/constructors/constructor.cc b/tests/constructors/constructor.cc index 121331a3..41361a97 100644 --- a/tests/constructors/constructor.cc +++ b/tests/constructors/constructor.cc @@ -27,6 +27,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Foo#", "short_name": "Foo", "detailed_name": "void Foo::Foo()", + "is_constructor": true, "definition_spelling": "3:3-3:6", "definition_extent": "3:3-3:11", "declaring_type": 0, @@ -36,6 +37,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "6:6-6:9", "definition_extent": "6:1-9:2", "callees": ["~0@7:7-7:8", "0@8:17-8:20"] diff --git a/tests/constructors/destructor.cc b/tests/constructors/destructor.cc index 68b1dae8..899a6d35 100644 --- a/tests/constructors/destructor.cc +++ b/tests/constructors/destructor.cc @@ -32,6 +32,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Foo#", "short_name": "Foo", "detailed_name": "void Foo::Foo()", + "is_constructor": true, "definition_spelling": "3:3-3:6", "definition_extent": "3:3-3:11", "declaring_type": 0, @@ -41,6 +42,7 @@ OUTPUT: "usr": "c:@S@Foo@F@~Foo#", "short_name": "~Foo", "detailed_name": "void Foo::~Foo() noexcept", + "is_constructor": false, "definition_spelling": "4:3-4:7", "definition_extent": "4:3-4:12", "declaring_type": 0 @@ -49,6 +51,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "7:6-7:9", "definition_extent": "7:1-9:2", "callees": ["~0@8:7-8:8"] diff --git a/tests/constructors/implicit_constructor.cc b/tests/constructors/implicit_constructor.cc index 6bb4a860..0502e281 100644 --- a/tests/constructors/implicit_constructor.cc +++ b/tests/constructors/implicit_constructor.cc @@ -26,6 +26,7 @@ OUTPUT: "usr": "c:@S@Type@F@Type#", "short_name": "Type", "detailed_name": "void Type::Type()", + "is_constructor": true, "definition_spelling": "2:3-2:7", "definition_extent": "2:3-2:12", "declaring_type": 0, @@ -35,6 +36,7 @@ OUTPUT: "usr": "c:@F@Make#", "short_name": "Make", "detailed_name": "void Make()", + "is_constructor": false, "definition_spelling": "5:6-5:10", "definition_extent": "5:1-8:2", "callees": ["~0@6:8-6:11"] diff --git a/tests/constructors/invalid_reference.cc b/tests/constructors/invalid_reference.cc index fb000dfe..eb54b268 100644 --- a/tests/constructors/invalid_reference.cc +++ b/tests/constructors/invalid_reference.cc @@ -21,6 +21,7 @@ OUTPUT: "usr": "c:@S@Foo@FT@>1#TFoo#v#", "short_name": "Foo", "detailed_name": "void Foo::Foo()", + "is_constructor": true, "definition_spelling": "4:6-4:9", "definition_extent": "4:1-4:11", "declaring_type": 0 diff --git a/tests/constructors/make_functions.cc b/tests/constructors/make_functions.cc new file mode 100644 index 00000000..89ed1b6b --- /dev/null +++ b/tests/constructors/make_functions.cc @@ -0,0 +1,157 @@ +template +T* MakeUnique(Args&&... args) { + return nullptr; +} + +template +T* maKE_NoRefs(Args... args) { + return nullptr; +} + +struct Bar {}; +class Foobar { + public: + Foobar() {} + Foobar(int) {} + Foobar(int&&, Bar*, bool*) {} + Foobar(int, Bar*, bool*) {} +}; +void caller22() { + MakeUnique(); + MakeUnique(1); + MakeUnique(1, new Bar(), nullptr); + maKE_NoRefs(1, new Bar(), nullptr); +} + +// TODO: Eliminate the extra entries in the "types" array here. They come from +// the template function definitions. + +/* +OUTPUT: +{ + "types": [{ + "id": 0, + "usr": "c:make_functions.cc@10", + "uses": ["2:1-2:2"] + }, { + "id": 1, + "usr": "c:make_functions.cc@22", + "uses": ["2:15-2:19"] + }, { + "id": 2, + "usr": "c:make_functions.cc@108", + "uses": ["7:1-7:2"] + }, { + "id": 3, + "usr": "c:make_functions.cc@120", + "uses": ["7:16-7:20"] + }, { + "id": 4, + "usr": "c:@S@Bar", + "short_name": "Bar", + "detailed_name": "Bar", + "definition_spelling": "11:8-11:11", + "definition_extent": "11:1-11:14", + "uses": ["11:8-11:11", "16:17-16:20", "17:15-17:18", "22:29-22:32", "23:30-23:33"] + }, { + "id": 5, + "usr": "c:@S@Foobar", + "short_name": "Foobar", + "detailed_name": "Foobar", + "definition_spelling": "12:7-12:13", + "definition_extent": "12:1-18:2", + "funcs": [2, 3, 4, 5], + "uses": ["12:7-12:13", "14:3-14:9", "15:3-15:9", "16:3-16:9", "17:3-17:9", "20:14-20:20", "21:14-21:20", "22:14-22:20", "23:15-23:21"] + }], + "funcs": [{ + "id": 0, + "usr": "c:@FT@>2#T#pTMakeUnique#P&&t0.1#*t0.0#", + "short_name": "MakeUnique", + "detailed_name": "T *MakeUnique(Args &&...)", + "is_constructor": false, + "parameter_type_descriptions": ["Args &&..."], + "definition_spelling": "2:4-2:14", + "definition_extent": "2:1-4:2", + "callers": ["6@20:3-20:13", "6@21:3-21:13", "6@22:3-22:13"] + }, { + "id": 1, + "usr": "c:@FT@>2#T#pTmaKE_NoRefs#Pt0.1#*t0.0#", + "short_name": "maKE_NoRefs", + "detailed_name": "T *maKE_NoRefs(Args...)", + "is_constructor": false, + "parameter_type_descriptions": ["Args..."], + "definition_spelling": "7:4-7:15", + "definition_extent": "7:1-9:2", + "callers": ["6@23:3-23:14"] + }, { + "id": 2, + "usr": "c:@S@Foobar@F@Foobar#", + "short_name": "Foobar", + "detailed_name": "void Foobar::Foobar()", + "is_constructor": true, + "definition_spelling": "14:3-14:9", + "definition_extent": "14:3-14:14", + "declaring_type": 5 + }, { + "id": 3, + "usr": "c:@S@Foobar@F@Foobar#I#", + "short_name": "Foobar", + "detailed_name": "void Foobar::Foobar(int)", + "is_constructor": true, + "parameter_type_descriptions": ["int"], + "definition_spelling": "15:3-15:9", + "definition_extent": "15:3-15:17", + "declaring_type": 5 + }, { + "id": 4, + "usr": "c:@S@Foobar@F@Foobar#&&I#*$@S@Bar#*b#", + "short_name": "Foobar", + "detailed_name": "void Foobar::Foobar(int &&, Bar *, bool *)", + "is_constructor": true, + "parameter_type_descriptions": ["int &&", "Bar *", "bool *"], + "definition_spelling": "16:3-16:9", + "definition_extent": "16:3-16:32", + "declaring_type": 5 + }, { + "id": 5, + "usr": "c:@S@Foobar@F@Foobar#I#*$@S@Bar#*b#", + "short_name": "Foobar", + "detailed_name": "void Foobar::Foobar(int, Bar *, bool *)", + "is_constructor": true, + "parameter_type_descriptions": ["int", "Bar *", "bool *"], + "definition_spelling": "17:3-17:9", + "definition_extent": "17:3-17:30", + "declaring_type": 5 + }, { + "id": 6, + "usr": "c:@F@caller22#", + "short_name": "caller22", + "detailed_name": "void caller22()", + "is_constructor": false, + "definition_spelling": "19:6-19:14", + "definition_extent": "19:1-24:2", + "callees": ["0@20:3-20:13", "0@21:3-21:13", "0@22:3-22:13", "1@23:3-23:14"] + }], + "vars": [{ + "id": 0, + "usr": "c:make_functions.cc@55@FT@>2#T#pTMakeUnique#P&&t0.1#*t0.0#@args", + "short_name": "args", + "detailed_name": "Args &&... args", + "definition_spelling": "2:25-2:29", + "definition_extent": "2:15-2:29", + "is_local": true, + "is_macro": false, + "uses": ["2:25-2:29"] + }, { + "id": 1, + "usr": "c:make_functions.cc@154@FT@>2#T#pTmaKE_NoRefs#Pt0.1#*t0.0#@args", + "short_name": "args", + "detailed_name": "Args... args", + "definition_spelling": "7:24-7:28", + "definition_extent": "7:16-7:28", + "is_local": true, + "is_macro": false, + "uses": ["7:24-7:28"] + }] +} +*/ diff --git a/tests/declaration_vs_definition/func.cc b/tests/declaration_vs_definition/func.cc index 2af68de7..403bdc86 100644 --- a/tests/declaration_vs_definition/func.cc +++ b/tests/declaration_vs_definition/func.cc @@ -12,6 +12,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "declarations": [{ "spelling": "1:6-1:9", "extent": "1:1-1:11", diff --git a/tests/declaration_vs_definition/func_associated_function_params.cc b/tests/declaration_vs_definition/func_associated_function_params.cc index cf734b5c..d5a1fca6 100644 --- a/tests/declaration_vs_definition/func_associated_function_params.cc +++ b/tests/declaration_vs_definition/func_associated_function_params.cc @@ -12,6 +12,7 @@ OUTPUT: "usr": "c:@F@foo#I#I#", "short_name": "foo", "detailed_name": "int foo(int, int)", + "is_constructor": false, "parameter_type_descriptions": ["int", "int"], "declarations": [{ "spelling": "1:5-1:8", diff --git a/tests/declaration_vs_definition/method.cc b/tests/declaration_vs_definition/method.cc index 61fb0a19..501e6fba 100644 --- a/tests/declaration_vs_definition/method.cc +++ b/tests/declaration_vs_definition/method.cc @@ -24,6 +24,7 @@ OUTPUT: "usr": "c:@S@Foo@F@declonly#", "short_name": "declonly", "detailed_name": "void Foo::declonly()", + "is_constructor": false, "declarations": [{ "spelling": "2:8-2:16", "extent": "2:3-2:18", @@ -35,6 +36,7 @@ OUTPUT: "usr": "c:@S@Foo@F@purevirtual#", "short_name": "purevirtual", "detailed_name": "void Foo::purevirtual()", + "is_constructor": false, "declarations": [{ "spelling": "3:16-3:27", "extent": "3:3-3:33", @@ -46,6 +48,7 @@ OUTPUT: "usr": "c:@S@Foo@F@def#", "short_name": "def", "detailed_name": "void Foo::def()", + "is_constructor": false, "declarations": [{ "spelling": "4:8-4:11", "extent": "4:3-4:13", diff --git a/tests/function_declaration.cc b/tests/function_declaration.cc index 5fc294de..909d2bce 100644 --- a/tests/function_declaration.cc +++ b/tests/function_declaration.cc @@ -8,6 +8,7 @@ OUTPUT: "usr": "c:@F@foo#I#I#", "short_name": "foo", "detailed_name": "void foo(int, int)", + "is_constructor": false, "parameter_type_descriptions": ["int", "int"], "declarations": [{ "spelling": "1:6-1:9", diff --git a/tests/function_declaration_definition.cc b/tests/function_declaration_definition.cc index daaf1a76..d38c5022 100644 --- a/tests/function_declaration_definition.cc +++ b/tests/function_declaration_definition.cc @@ -10,6 +10,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "declarations": [{ "spelling": "1:6-1:9", "extent": "1:1-1:11", diff --git a/tests/function_definition.cc b/tests/function_definition.cc index 4def754f..405a7357 100644 --- a/tests/function_definition.cc +++ b/tests/function_definition.cc @@ -8,6 +8,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "1:6-1:9", "definition_extent": "1:1-1:14" }] diff --git a/tests/inheritance/function_override.cc b/tests/inheritance/function_override.cc index 26709c7d..840939a0 100644 --- a/tests/inheritance/function_override.cc +++ b/tests/inheritance/function_override.cc @@ -34,6 +34,7 @@ OUTPUT: "usr": "c:@S@Root@F@foo#", "short_name": "foo", "detailed_name": "void Root::foo()", + "is_constructor": false, "declarations": [{ "spelling": "2:16-2:19", "extent": "2:3-2:21", @@ -46,6 +47,7 @@ OUTPUT: "usr": "c:@S@Derived@F@foo#", "short_name": "foo", "detailed_name": "void Derived::foo()", + "is_constructor": false, "definition_spelling": "5:8-5:11", "definition_extent": "5:3-5:25", "declaring_type": 1, diff --git a/tests/inheritance/interface_pure_virtual.cc b/tests/inheritance/interface_pure_virtual.cc index be3f3041..b991b6cb 100644 --- a/tests/inheritance/interface_pure_virtual.cc +++ b/tests/inheritance/interface_pure_virtual.cc @@ -20,6 +20,7 @@ OUTPUT: "usr": "c:@S@IFoo@F@foo#", "short_name": "foo", "detailed_name": "void IFoo::foo()", + "is_constructor": false, "definition_spelling": "2:16-2:19", "definition_extent": "2:3-2:28", "declaring_type": 0 diff --git a/tests/macros/complex.cc b/tests/macros/complex.cc index c0447a62..20bfddbf 100644 --- a/tests/macros/complex.cc +++ b/tests/macros/complex.cc @@ -19,6 +19,7 @@ OUTPUT: "usr": "c:@F@make1#", "short_name": "make1", "detailed_name": "int make1()", + "is_constructor": false, "definition_spelling": "6:5-6:10", "definition_extent": "6:1-8:2", "callers": ["1@12:5-12:10"] @@ -27,6 +28,7 @@ OUTPUT: "usr": "c:@F@a#", "short_name": "a", "detailed_name": "int a()", + "is_constructor": false, "declarations": [{ "spelling": "12:1-12:20", "extent": "12:1-12:20", diff --git a/tests/macros/foo.cc b/tests/macros/foo.cc index 287595d6..f0518d5d 100644 --- a/tests/macros/foo.cc +++ b/tests/macros/foo.cc @@ -25,6 +25,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Foo#&&$@S@Foo#", "short_name": "Foo", "detailed_name": "void Foo::Foo(Foo &&)", + "is_constructor": true, "parameter_type_descriptions": ["Foo &&"], "definition_spelling": "5:12-5:15", "definition_extent": "5:12-5:16", diff --git a/tests/method_declaration.cc b/tests/method_declaration.cc index 4f3c5326..dd325e0d 100644 --- a/tests/method_declaration.cc +++ b/tests/method_declaration.cc @@ -24,6 +24,7 @@ OUTPUT: "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "detailed_name": "void Foo::foo()", + "is_constructor": false, "declarations": [{ "spelling": "2:8-2:11", "extent": "2:3-2:13", diff --git a/tests/method_definition.cc b/tests/method_definition.cc index 51e874aa..fd51b1b6 100644 --- a/tests/method_definition.cc +++ b/tests/method_definition.cc @@ -22,6 +22,7 @@ OUTPUT: "usr": "c:@S@Foo@F@foo#1", "short_name": "foo", "detailed_name": "void Foo::foo() const", + "is_constructor": false, "declarations": [{ "spelling": "2:8-2:11", "extent": "2:3-2:19", diff --git a/tests/method_inline_declaration.cc b/tests/method_inline_declaration.cc index 290c2fb6..92210c5b 100644 --- a/tests/method_inline_declaration.cc +++ b/tests/method_inline_declaration.cc @@ -20,6 +20,7 @@ OUTPUT: "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "detailed_name": "void Foo::foo()", + "is_constructor": false, "definition_spelling": "2:8-2:11", "definition_extent": "2:3-2:16", "declaring_type": 0 diff --git a/tests/multi_file/impl.cc b/tests/multi_file/impl.cc index ac61efc8..ab2a930d 100644 --- a/tests/multi_file/impl.cc +++ b/tests/multi_file/impl.cc @@ -58,6 +58,7 @@ OUTPUT: header.h "usr": "c:@FT@>1#TFoo1#v#", "short_name": "Foo1", "detailed_name": "void Foo1()", + "is_constructor": false, "definition_spelling": "10:6-10:10", "definition_extent": "10:1-10:15" }], @@ -131,12 +132,14 @@ OUTPUT: impl.cc "usr": "c:@F@Impl#", "short_name": "Impl", "detailed_name": "void Impl()", + "is_constructor": false, "definition_spelling": "3:6-3:10", "definition_extent": "3:1-5:2", "callees": ["1@4:3-4:7"] }, { "id": 1, "usr": "c:@FT@>1#TFoo1#v#", + "is_constructor": false, "callers": ["0@4:3-4:7"] }] } diff --git a/tests/multi_file/simple_impl.cc b/tests/multi_file/simple_impl.cc index a9220aeb..05d3e25d 100644 --- a/tests/multi_file/simple_impl.cc +++ b/tests/multi_file/simple_impl.cc @@ -13,6 +13,7 @@ OUTPUT: simple_header.h "usr": "c:@F@header#", "short_name": "header", "detailed_name": "void header()", + "is_constructor": false, "declarations": [{ "spelling": "3:6-3:12", "extent": "3:1-3:14", @@ -32,12 +33,14 @@ OUTPUT: simple_impl.cc "usr": "c:@F@impl#", "short_name": "impl", "detailed_name": "void impl()", + "is_constructor": false, "definition_spelling": "3:6-3:10", "definition_extent": "3:1-5:2", "callees": ["1@4:3-4:9"] }, { "id": 1, "usr": "c:@F@header#", + "is_constructor": false, "callers": ["0@4:3-4:9"] }] } diff --git a/tests/multi_file/static.cc b/tests/multi_file/static.cc index 068c29a8..e9158c52 100644 --- a/tests/multi_file/static.cc +++ b/tests/multi_file/static.cc @@ -21,6 +21,7 @@ OUTPUT: static.h "usr": "c:@S@Buffer@F@CreateSharedBuffer#S", "short_name": "CreateSharedBuffer", "detailed_name": "void Buffer::CreateSharedBuffer()", + "is_constructor": false, "declarations": [{ "spelling": "4:15-4:33", "extent": "4:3-4:35", @@ -47,6 +48,7 @@ OUTPUT: static.cc "usr": "c:@S@Buffer@F@CreateSharedBuffer#S", "short_name": "CreateSharedBuffer", "detailed_name": "void Buffer::CreateSharedBuffer()", + "is_constructor": false, "definition_spelling": "3:14-3:32", "definition_extent": "3:1-3:37", "declaring_type": 0 diff --git a/tests/namespaces/anonymous_function.cc b/tests/namespaces/anonymous_function.cc index 9f11720f..5ba8a540 100644 --- a/tests/namespaces/anonymous_function.cc +++ b/tests/namespaces/anonymous_function.cc @@ -10,6 +10,7 @@ OUTPUT: "usr": "c:anonymous_function.cc@aN@F@foo#", "short_name": "foo", "detailed_name": "void ::foo()", + "is_constructor": false, "declarations": [{ "spelling": "2:6-2:9", "extent": "2:1-2:11", diff --git a/tests/namespaces/function_declaration.cc b/tests/namespaces/function_declaration.cc index e2983161..1bf282cd 100644 --- a/tests/namespaces/function_declaration.cc +++ b/tests/namespaces/function_declaration.cc @@ -10,6 +10,7 @@ OUTPUT: "usr": "c:@N@hello@F@foo#I#I#", "short_name": "foo", "detailed_name": "void hello::foo(int, int)", + "is_constructor": false, "parameter_type_descriptions": ["int", "int"], "declarations": [{ "spelling": "2:6-2:9", diff --git a/tests/namespaces/function_definition.cc b/tests/namespaces/function_definition.cc index fea89dbc..661a958f 100644 --- a/tests/namespaces/function_definition.cc +++ b/tests/namespaces/function_definition.cc @@ -10,6 +10,7 @@ OUTPUT: "usr": "c:@N@hello@F@foo#", "short_name": "foo", "detailed_name": "void hello::foo()", + "is_constructor": false, "definition_spelling": "2:6-2:9", "definition_extent": "2:1-2:14" }] diff --git a/tests/namespaces/method_declaration.cc b/tests/namespaces/method_declaration.cc index 2695780e..3b1fd2d0 100644 --- a/tests/namespaces/method_declaration.cc +++ b/tests/namespaces/method_declaration.cc @@ -22,6 +22,7 @@ OUTPUT: "usr": "c:@N@hello@S@Foo@F@foo#", "short_name": "foo", "detailed_name": "void hello::Foo::foo()", + "is_constructor": false, "declarations": [{ "spelling": "3:8-3:11", "extent": "3:3-3:13", diff --git a/tests/namespaces/method_definition.cc b/tests/namespaces/method_definition.cc index 0eae147a..0ed78390 100644 --- a/tests/namespaces/method_definition.cc +++ b/tests/namespaces/method_definition.cc @@ -24,6 +24,7 @@ OUTPUT: "usr": "c:@N@hello@S@Foo@F@foo#", "short_name": "foo", "detailed_name": "void hello::Foo::foo()", + "is_constructor": false, "declarations": [{ "spelling": "3:8-3:11", "extent": "3:3-3:13", diff --git a/tests/namespaces/method_inline_declaration.cc b/tests/namespaces/method_inline_declaration.cc index ab6e5c5b..4d4f48ca 100644 --- a/tests/namespaces/method_inline_declaration.cc +++ b/tests/namespaces/method_inline_declaration.cc @@ -22,6 +22,7 @@ OUTPUT: "usr": "c:@N@hello@S@Foo@F@foo#", "short_name": "foo", "detailed_name": "void hello::Foo::foo()", + "is_constructor": false, "definition_spelling": "3:8-3:11", "definition_extent": "3:3-3:16", "declaring_type": 0 diff --git a/tests/namespaces/namespace_alias.cc b/tests/namespaces/namespace_alias.cc index b1957afc..82b9ed7d 100644 --- a/tests/namespaces/namespace_alias.cc +++ b/tests/namespaces/namespace_alias.cc @@ -21,6 +21,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "11:6-11:9", "definition_extent": "11:1-14:2" }], diff --git a/tests/namespaces/namespace_reference.cc b/tests/namespaces/namespace_reference.cc index ebe706f3..d7cddaed 100644 --- a/tests/namespaces/namespace_reference.cc +++ b/tests/namespaces/namespace_reference.cc @@ -17,6 +17,7 @@ OUTPUT: "usr": "c:@N@ns@F@Accept#I#", "short_name": "Accept", "detailed_name": "void ns::Accept(int)", + "is_constructor": false, "parameter_type_descriptions": ["int"], "definition_spelling": "3:8-3:14", "definition_extent": "3:3-3:24", @@ -26,6 +27,7 @@ OUTPUT: "usr": "c:@F@Runner#", "short_name": "Runner", "detailed_name": "void Runner()", + "is_constructor": false, "definition_spelling": "6:6-6:12", "definition_extent": "6:1-10:2", "callees": ["0@7:7-7:13", "0@9:3-9:9"] diff --git a/tests/outline/outline2.cc b/tests/outline/outline2.cc index e2116840..4ee7bf33 100644 --- a/tests/outline/outline2.cc +++ b/tests/outline/outline2.cc @@ -47,6 +47,7 @@ OUTPUT: "usr": "c:@F@LoadCompilationEntriesFromDirectory#&1$@N@std@S@basic_string>#C#$@N@std@S@char_traits>#C#$@N@std@S@allocator>#C#", "short_name": "LoadCompilationEntriesFromDirectory", "detailed_name": "std::vector LoadCompilationEntriesFromDirectory(const std::string &)", + "is_constructor": false, "parameter_type_descriptions": ["const std::string &"], "declarations": [{ "spelling": "12:31-12:66", diff --git a/tests/outline/static_function_in_type.cc b/tests/outline/static_function_in_type.cc new file mode 100644 index 00000000..ccdb1a34 --- /dev/null +++ b/tests/outline/static_function_in_type.cc @@ -0,0 +1,85 @@ +#include "static_function_in_type.h" + +namespace ns { +// static +void Foo::Register(Manager* m) { +} +} + +/* +OUTPUT: static_function_in_type.h +{ + "dependencies": ["C:/Users/jacob/Desktop/cquery/tests/outline/static_function_in_type.cc"], + "types": [{ + "id": 0, + "usr": "c:@N@ns@S@Manager", + "uses": ["3:7-3:14", "6:24-6:31"] + }, { + "id": 1, + "usr": "c:@N@ns@S@Foo", + "short_name": "Foo", + "detailed_name": "ns::Foo", + "definition_spelling": "5:8-5:11", + "definition_extent": "5:1-7:2", + "funcs": [0], + "uses": ["5:8-5:11"] + }], + "funcs": [{ + "id": 0, + "usr": "c:@N@ns@S@Foo@F@Register#*$@N@ns@S@Manager#S", + "short_name": "Register", + "detailed_name": "void ns::Foo::Register(ns::Manager *)", + "is_constructor": false, + "parameter_type_descriptions": ["ns::Manager *"], + "declarations": [{ + "spelling": "6:15-6:23", + "extent": "6:3-6:33", + "content": "static void Register(Manager*)", + "param_spellings": ["6:32-6:32"] + }], + "declaring_type": 1 + }] +} +OUTPUT: static_function_in_type.cc +{ + "includes": [{ + "line": 1, + "resolved_path": "C:/Users/jacob/Desktop/cquery/tests/outline/static_function_in_type.h" + }], + "dependencies": ["C:/Users/jacob/Desktop/cquery/tests/outline/static_function_in_type.h"], + "types": [{ + "id": 0, + "usr": "c:@N@ns@S@Foo", + "funcs": [0], + "uses": ["5:6-5:9"] + }, { + "id": 1, + "usr": "c:@N@ns@S@Manager", + "instances": [0], + "uses": ["5:20-5:27"] + }], + "funcs": [{ + "id": 0, + "usr": "c:@N@ns@S@Foo@F@Register#*$@N@ns@S@Manager#S", + "short_name": "Register", + "detailed_name": "void ns::Foo::Register(ns::Manager *)", + "is_constructor": false, + "parameter_type_descriptions": ["ns::Manager *"], + "definition_spelling": "5:11-5:19", + "definition_extent": "5:1-6:2", + "declaring_type": 0 + }], + "vars": [{ + "id": 0, + "usr": "c:static_function_in_type.cc@86@N@ns@S@Foo@F@Register#*$@N@ns@S@Manager#S@m", + "short_name": "m", + "detailed_name": "ns::Manager * m", + "definition_spelling": "5:29-5:30", + "definition_extent": "5:20-5:30", + "variable_type": 1, + "is_local": true, + "is_macro": false, + "uses": ["5:29-5:30"] + }] +} +*/ \ No newline at end of file diff --git a/tests/outline/static_function_in_type.h b/tests/outline/static_function_in_type.h new file mode 100644 index 00000000..013aa70e --- /dev/null +++ b/tests/outline/static_function_in_type.h @@ -0,0 +1,9 @@ +namespace ns { + +class Manager; + +struct Foo { + static void Register(Manager*); +}; + +} // namespace ns \ No newline at end of file diff --git a/tests/templates/func_specialized_template_param.cc b/tests/templates/func_specialized_template_param.cc index 03af763b..645befca 100644 --- a/tests/templates/func_specialized_template_param.cc +++ b/tests/templates/func_specialized_template_param.cc @@ -33,6 +33,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Bar#&$@S@Template>#d#", "short_name": "Bar", "detailed_name": "void Foo::Bar(Template &)", + "is_constructor": false, "parameter_type_descriptions": ["Template &"], "declarations": [{ "spelling": "5:8-5:11", diff --git a/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc b/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc index 811949a1..92f20bf9 100644 --- a/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc +++ b/tests/templates/namespace_template_class_template_func_usage_folded_into_one.cc @@ -29,6 +29,7 @@ OUTPUT: "usr": "c:@N@ns@ST>1#T@Foo@FT@>1#Tfoo#I#S", "short_name": "foo", "detailed_name": "int ns::Foo::foo()", + "is_constructor": false, "definition_spelling": "5:16-5:19", "definition_extent": "5:5-7:6", "declaring_type": 0, diff --git a/tests/templates/specialized_func_definition.cc b/tests/templates/specialized_func_definition.cc index a57a2b40..f29c48ec 100644 --- a/tests/templates/specialized_func_definition.cc +++ b/tests/templates/specialized_func_definition.cc @@ -30,6 +30,7 @@ OUTPUT: "usr": "c:@ST>1#T@Template@F@Foo#", "short_name": "Foo", "detailed_name": "void Template::Foo()", + "is_constructor": false, "declarations": [{ "spelling": "3:8-3:11", "extent": "3:3-3:13", diff --git a/tests/templates/template_class_func_usage_folded_into_one.cc b/tests/templates/template_class_func_usage_folded_into_one.cc index 7030c299..4d4c380a 100644 --- a/tests/templates/template_class_func_usage_folded_into_one.cc +++ b/tests/templates/template_class_func_usage_folded_into_one.cc @@ -26,6 +26,7 @@ OUTPUT: "usr": "c:@ST>1#T@Foo@F@foo#S", "short_name": "foo", "detailed_name": "int Foo::foo()", + "is_constructor": false, "definition_spelling": "3:14-3:17", "definition_extent": "3:3-5:4", "declaring_type": 0, diff --git a/tests/templates/template_class_template_func_usage_folded_into_one.cc b/tests/templates/template_class_template_func_usage_folded_into_one.cc index a43d1544..0637b2d0 100644 --- a/tests/templates/template_class_template_func_usage_folded_into_one.cc +++ b/tests/templates/template_class_template_func_usage_folded_into_one.cc @@ -27,6 +27,7 @@ OUTPUT: "usr": "c:@ST>1#T@Foo@FT@>1#Tfoo#I#S", "short_name": "foo", "detailed_name": "int Foo::foo()", + "is_constructor": false, "definition_spelling": "4:14-4:17", "definition_extent": "4:3-6:4", "declaring_type": 0, diff --git a/tests/templates/template_func_usage_folded_into_one.cc b/tests/templates/template_func_usage_folded_into_one.cc index 10426ddb..e1653d66 100644 --- a/tests/templates/template_func_usage_folded_into_one.cc +++ b/tests/templates/template_func_usage_folded_into_one.cc @@ -17,6 +17,7 @@ OUTPUT: "usr": "c:template_func_usage_folded_into_one.cc@FT@>1#Tfoo#I#", "short_name": "foo", "detailed_name": "int foo()", + "is_constructor": false, "definition_spelling": "2:12-2:15", "definition_extent": "2:1-4:2", "callers": ["-1@6:9-6:12", "-1@7:9-7:12"] diff --git a/tests/unions/union_usage.cc b/tests/unions/union_usage.cc index e2c94225..16268688 100644 --- a/tests/unions/union_usage.cc +++ b/tests/unions/union_usage.cc @@ -30,6 +30,7 @@ OUTPUT: "usr": "c:@F@act#*$@U@Foo#", "short_name": "act", "detailed_name": "void act(Foo *)", + "is_constructor": false, "parameter_type_descriptions": ["Foo *"], "definition_spelling": "8:6-8:9", "definition_extent": "8:1-10:2" diff --git a/tests/usage/func_called_from_constructor.cc b/tests/usage/func_called_from_constructor.cc index 2dc9ac29..5cb8e254 100644 --- a/tests/usage/func_called_from_constructor.cc +++ b/tests/usage/func_called_from_constructor.cc @@ -26,6 +26,7 @@ OUTPUT: "usr": "c:@F@called#", "short_name": "called", "detailed_name": "void called()", + "is_constructor": false, "definition_spelling": "1:6-1:12", "definition_extent": "1:1-1:17", "callers": ["1@8:3-8:9"] @@ -34,6 +35,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Foo#", "short_name": "Foo", "detailed_name": "void Foo::Foo()", + "is_constructor": true, "declarations": [{ "spelling": "4:3-4:6", "extent": "4:3-4:8", diff --git a/tests/usage/func_called_from_macro_argument.cc b/tests/usage/func_called_from_macro_argument.cc index 9b0a294e..f7f1e69c 100644 --- a/tests/usage/func_called_from_macro_argument.cc +++ b/tests/usage/func_called_from_macro_argument.cc @@ -14,6 +14,7 @@ OUTPUT: "usr": "c:@F@called#b#b#", "short_name": "called", "detailed_name": "bool called(bool, bool)", + "is_constructor": false, "parameter_type_descriptions": ["bool", "bool"], "declarations": [{ "spelling": "3:6-3:12", @@ -27,6 +28,7 @@ OUTPUT: "usr": "c:@F@caller#", "short_name": "caller", "detailed_name": "void caller()", + "is_constructor": false, "definition_spelling": "5:6-5:12", "definition_extent": "5:1-7:2", "callees": ["0@6:14-6:20"] diff --git a/tests/usage/func_called_from_template.cc b/tests/usage/func_called_from_template.cc index 3d859dbc..bf9caa49 100644 --- a/tests/usage/func_called_from_template.cc +++ b/tests/usage/func_called_from_template.cc @@ -19,6 +19,7 @@ OUTPUT: "usr": "c:@F@called#", "short_name": "called", "detailed_name": "void called()", + "is_constructor": false, "declarations": [{ "spelling": "1:6-1:12", "extent": "1:1-1:14", @@ -30,6 +31,7 @@ OUTPUT: "usr": "c:@FT@>1#Tcaller#v#", "short_name": "caller", "detailed_name": "void caller()", + "is_constructor": false, "definition_spelling": "4:6-4:12", "definition_extent": "4:1-6:2", "callers": ["2@9:3-9:9"], @@ -39,6 +41,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "8:6-8:9", "definition_extent": "8:1-10:2", "callees": ["1@9:3-9:9"] diff --git a/tests/usage/func_called_implicit_ctor.cc b/tests/usage/func_called_implicit_ctor.cc index f6988508..2c4e9063 100644 --- a/tests/usage/func_called_implicit_ctor.cc +++ b/tests/usage/func_called_implicit_ctor.cc @@ -26,6 +26,7 @@ OUTPUT: "usr": "c:@S@Wrapper@F@Wrapper#I#", "short_name": "Wrapper", "detailed_name": "void Wrapper::Wrapper(int)", + "is_constructor": true, "parameter_type_descriptions": ["int"], "declarations": [{ "spelling": "2:3-2:10", @@ -40,6 +41,7 @@ OUTPUT: "usr": "c:@F@called#", "short_name": "called", "detailed_name": "int called()", + "is_constructor": false, "definition_spelling": "5:5-5:11", "definition_extent": "5:1-5:27", "callers": ["2@8:10-8:16"] @@ -48,6 +50,7 @@ OUTPUT: "usr": "c:@F@caller#", "short_name": "caller", "detailed_name": "Wrapper caller()", + "is_constructor": false, "definition_spelling": "7:9-7:15", "definition_extent": "7:1-9:2", "callees": ["~0@8:10-8:16", "1@8:10-8:16"] diff --git a/tests/usage/func_usage_addr_func.cc b/tests/usage/func_usage_addr_func.cc index 4c7963d9..abbb49fd 100644 --- a/tests/usage/func_usage_addr_func.cc +++ b/tests/usage/func_usage_addr_func.cc @@ -15,6 +15,7 @@ OUTPUT: "usr": "c:@F@consume#*v#", "short_name": "consume", "detailed_name": "void consume(void *)", + "is_constructor": false, "parameter_type_descriptions": ["void *"], "definition_spelling": "1:6-1:13", "definition_extent": "1:1-1:23", @@ -24,6 +25,7 @@ OUTPUT: "usr": "c:@F@used#", "short_name": "used", "detailed_name": "void used()", + "is_constructor": false, "definition_spelling": "3:6-3:10", "definition_extent": "3:1-3:15", "callers": ["2@6:13-6:17", "2@7:12-7:16"] @@ -32,6 +34,7 @@ OUTPUT: "usr": "c:@F@user#", "short_name": "user", "detailed_name": "void user()", + "is_constructor": false, "definition_spelling": "5:6-5:10", "definition_extent": "5:1-8:2", "callees": ["1@6:13-6:17", "0@7:3-7:10", "1@7:12-7:16"] diff --git a/tests/usage/func_usage_addr_method.cc b/tests/usage/func_usage_addr_method.cc index 933b3597..4c3b1f07 100644 --- a/tests/usage/func_usage_addr_method.cc +++ b/tests/usage/func_usage_addr_method.cc @@ -25,6 +25,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Used#", "short_name": "Used", "detailed_name": "void Foo::Used()", + "is_constructor": false, "declarations": [{ "spelling": "2:8-2:12", "extent": "2:3-2:14", @@ -37,6 +38,7 @@ OUTPUT: "usr": "c:@F@user#", "short_name": "user", "detailed_name": "void user()", + "is_constructor": false, "definition_spelling": "5:6-5:10", "definition_extent": "5:1-7:2", "callees": ["0@6:18-6:22"] diff --git a/tests/usage/func_usage_call_func.cc b/tests/usage/func_usage_call_func.cc index ece26390..8405b25c 100644 --- a/tests/usage/func_usage_call_func.cc +++ b/tests/usage/func_usage_call_func.cc @@ -11,6 +11,7 @@ OUTPUT: "usr": "c:@F@called#", "short_name": "called", "detailed_name": "void called()", + "is_constructor": false, "definition_spelling": "1:6-1:12", "definition_extent": "1:1-1:17", "callers": ["1@3:3-3:9"] @@ -19,6 +20,7 @@ OUTPUT: "usr": "c:@F@caller#", "short_name": "caller", "detailed_name": "void caller()", + "is_constructor": false, "definition_spelling": "2:6-2:12", "definition_extent": "2:1-4:2", "callees": ["0@3:3-3:9"] diff --git a/tests/usage/func_usage_call_method.cc b/tests/usage/func_usage_call_method.cc index 7a8ec497..a9b32860 100644 --- a/tests/usage/func_usage_call_method.cc +++ b/tests/usage/func_usage_call_method.cc @@ -26,6 +26,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Used#", "short_name": "Used", "detailed_name": "void Foo::Used()", + "is_constructor": false, "declarations": [{ "spelling": "2:8-2:12", "extent": "2:3-2:14", @@ -38,6 +39,7 @@ OUTPUT: "usr": "c:@F@user#", "short_name": "user", "detailed_name": "void user()", + "is_constructor": false, "definition_spelling": "5:6-5:10", "definition_extent": "5:1-8:2", "callees": ["0@7:6-7:10"] diff --git a/tests/usage/func_usage_class_inline_var_def.cc b/tests/usage/func_usage_class_inline_var_def.cc index 46b54419..dbb32cde 100644 --- a/tests/usage/func_usage_class_inline_var_def.cc +++ b/tests/usage/func_usage_class_inline_var_def.cc @@ -24,6 +24,7 @@ OUTPUT: "usr": "c:func_usage_class_inline_var_def.cc@F@helper#", "short_name": "helper", "detailed_name": "int helper()", + "is_constructor": false, "definition_spelling": "1:12-1:18", "definition_extent": "1:1-3:2", "callers": ["-1@6:11-6:17"] diff --git a/tests/usage/func_usage_forward_decl_func.cc b/tests/usage/func_usage_forward_decl_func.cc index d9ab35e3..6f2a561a 100644 --- a/tests/usage/func_usage_forward_decl_func.cc +++ b/tests/usage/func_usage_forward_decl_func.cc @@ -11,6 +11,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "declarations": [{ "spelling": "1:6-1:9", "extent": "1:1-1:11", @@ -22,6 +23,7 @@ OUTPUT: "usr": "c:@F@usage#", "short_name": "usage", "detailed_name": "void usage()", + "is_constructor": false, "definition_spelling": "3:6-3:11", "definition_extent": "3:1-5:2", "callees": ["0@4:3-4:6"] diff --git a/tests/usage/func_usage_forward_decl_method.cc b/tests/usage/func_usage_forward_decl_method.cc index 15f81a82..d5858a7b 100644 --- a/tests/usage/func_usage_forward_decl_method.cc +++ b/tests/usage/func_usage_forward_decl_method.cc @@ -25,6 +25,7 @@ OUTPUT: "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "detailed_name": "void Foo::foo()", + "is_constructor": false, "declarations": [{ "spelling": "2:8-2:11", "extent": "2:3-2:13", @@ -37,6 +38,7 @@ OUTPUT: "usr": "c:@F@usage#", "short_name": "usage", "detailed_name": "void usage()", + "is_constructor": false, "definition_spelling": "5:6-5:11", "definition_extent": "5:1-8:2", "callees": ["0@7:6-7:9"] diff --git a/tests/usage/func_usage_template_func.cc b/tests/usage/func_usage_template_func.cc index d428ad59..39c8cffd 100644 --- a/tests/usage/func_usage_template_func.cc +++ b/tests/usage/func_usage_template_func.cc @@ -14,6 +14,7 @@ OUTPUT: "usr": "c:@FT@>1#Taccept#t0.0#v#", "short_name": "accept", "detailed_name": "void accept(T)", + "is_constructor": false, "parameter_type_descriptions": ["T"], "declarations": [{ "spelling": "2:6-2:12", @@ -27,6 +28,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "4:6-4:9", "definition_extent": "4:1-7:2", "callees": ["0@5:3-5:9", "0@6:3-6:9"] diff --git a/tests/usage/type_usage_as_template_parameter.cc b/tests/usage/type_usage_as_template_parameter.cc index b770f933..f0afaaa5 100644 --- a/tests/usage/type_usage_as_template_parameter.cc +++ b/tests/usage/type_usage_as_template_parameter.cc @@ -32,6 +32,7 @@ OUTPUT: "usr": "c:@F@return_type#", "short_name": "return_type", "detailed_name": "unique_ptr *return_type()", + "is_constructor": false, "definition_spelling": "9:16-9:27", "definition_extent": "9:1-12:2" }], diff --git a/tests/usage/type_usage_as_template_parameter_complex.cc b/tests/usage/type_usage_as_template_parameter_complex.cc index c15e4a49..3bc77bca 100644 --- a/tests/usage/type_usage_as_template_parameter_complex.cc +++ b/tests/usage/type_usage_as_template_parameter_complex.cc @@ -110,6 +110,7 @@ OUTPUT: "usr": "c:@F@as_return_type#*$@S@unique_ptr>#$@S@S1#$@S@S2#", "short_name": "as_return_type", "detailed_name": "unique_ptr, S2> *as_return_type(unique_ptr *)", + "is_constructor": false, "parameter_type_descriptions": ["unique_ptr *"], "definition_spelling": "33:37-33:51", "definition_extent": "33:1-33:92" @@ -118,6 +119,7 @@ OUTPUT: "usr": "c:@F@no_return_type#I#", "short_name": "no_return_type", "detailed_name": "void no_return_type(int)", + "is_constructor": false, "parameter_type_descriptions": ["int"], "definition_spelling": "40:6-40:20", "definition_extent": "40:1-40:28" @@ -126,6 +128,7 @@ OUTPUT: "usr": "c:@F@empty#", "short_name": "empty", "detailed_name": "void empty()", + "is_constructor": false, "definition_spelling": "53:6-53:11", "definition_extent": "53:1-55:2" }, { @@ -133,6 +136,7 @@ OUTPUT: "usr": "c:@S@Foo@F@foo#", "short_name": "foo", "detailed_name": "unique_ptr *Foo::foo()", + "is_constructor": false, "declarations": [{ "spelling": "65:23-65:26", "extent": "65:3-65:28", diff --git a/tests/usage/type_usage_declare_local.cc b/tests/usage/type_usage_declare_local.cc index 1d238623..71e9a5bb 100644 --- a/tests/usage/type_usage_declare_local.cc +++ b/tests/usage/type_usage_declare_local.cc @@ -29,6 +29,7 @@ OUTPUT: "usr": "c:@F@Foo#", "short_name": "Foo", "detailed_name": "void Foo()", + "is_constructor": false, "definition_spelling": "4:6-4:9", "definition_extent": "4:1-7:2" }], diff --git a/tests/usage/type_usage_declare_param.cc b/tests/usage/type_usage_declare_param.cc index 29f83601..54f1b658 100644 --- a/tests/usage/type_usage_declare_param.cc +++ b/tests/usage/type_usage_declare_param.cc @@ -26,6 +26,7 @@ OUTPUT: "usr": "c:@F@foo#*$@S@ForwardType#$@S@ImplementedType#", "short_name": "foo", "detailed_name": "void foo(ForwardType *, ImplementedType)", + "is_constructor": false, "parameter_type_descriptions": ["ForwardType *", "ImplementedType"], "definition_spelling": "4:6-4:9", "definition_extent": "4:1-4:47" diff --git a/tests/usage/type_usage_declare_param_prototype.cc b/tests/usage/type_usage_declare_param_prototype.cc index 56c0fcd3..db77490f 100644 --- a/tests/usage/type_usage_declare_param_prototype.cc +++ b/tests/usage/type_usage_declare_param_prototype.cc @@ -22,6 +22,7 @@ OUTPUT: "usr": "c:@F@foo#*$@S@Foo#S0_#", "short_name": "foo", "detailed_name": "void foo(Foo *, Foo *)", + "is_constructor": false, "parameter_type_descriptions": ["Foo *", "Foo *"], "declarations": [{ "spelling": "3:6-3:9", diff --git a/tests/usage/type_usage_declare_param_unnamed.cc b/tests/usage/type_usage_declare_param_unnamed.cc index 0d334ddb..6e6f7760 100644 --- a/tests/usage/type_usage_declare_param_unnamed.cc +++ b/tests/usage/type_usage_declare_param_unnamed.cc @@ -13,6 +13,7 @@ OUTPUT: "usr": "c:@F@foo#*$@S@ForwardType#", "short_name": "foo", "detailed_name": "void foo(ForwardType *)", + "is_constructor": false, "parameter_type_descriptions": ["ForwardType *"], "definition_spelling": "2:6-2:9", "definition_extent": "2:1-2:26" diff --git a/tests/usage/type_usage_declare_qualifiers.cc b/tests/usage/type_usage_declare_qualifiers.cc index adaa09e9..b1da3b65 100644 --- a/tests/usage/type_usage_declare_qualifiers.cc +++ b/tests/usage/type_usage_declare_qualifiers.cc @@ -24,6 +24,7 @@ OUTPUT: "usr": "c:@F@foo#&$@S@Type#&1S1_#", "short_name": "foo", "detailed_name": "void foo(Type &, const Type &)", + "is_constructor": false, "parameter_type_descriptions": ["Type &", "const Type &"], "definition_spelling": "3:6-3:9", "definition_extent": "3:1-8:2" diff --git a/tests/usage/type_usage_on_return_type.cc b/tests/usage/type_usage_on_return_type.cc index 97bab517..1c3fde8b 100644 --- a/tests/usage/type_usage_on_return_type.cc +++ b/tests/usage/type_usage_on_return_type.cc @@ -39,6 +39,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "Type *foo()", + "is_constructor": false, "declarations": [{ "spelling": "3:7-3:10", "extent": "3:1-3:12", @@ -55,6 +56,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Get#I#", "short_name": "Get", "detailed_name": "Type *Foo::Get(int)", + "is_constructor": false, "parameter_type_descriptions": ["int"], "declarations": [{ "spelling": "8:9-8:12", @@ -70,6 +72,7 @@ OUTPUT: "usr": "c:@S@Foo@F@Empty#", "short_name": "Empty", "detailed_name": "void Foo::Empty()", + "is_constructor": false, "declarations": [{ "spelling": "9:8-9:13", "extent": "9:3-9:15", @@ -83,6 +86,7 @@ OUTPUT: "usr": "c:@F@external#", "short_name": "external", "detailed_name": "const Type &external()", + "is_constructor": false, "declarations": [{ "spelling": "15:20-15:28", "extent": "15:1-15:30", @@ -93,6 +97,7 @@ OUTPUT: "usr": "c:type_usage_on_return_type.cc@F@bar#", "short_name": "bar", "detailed_name": "Type *bar()", + "is_constructor": false, "declarations": [{ "spelling": "17:14-17:17", "extent": "17:1-17:19", diff --git a/tests/usage/type_usage_typedef_and_using.cc b/tests/usage/type_usage_typedef_and_using.cc index 4dbb034b..3dbb4b38 100644 --- a/tests/usage/type_usage_typedef_and_using.cc +++ b/tests/usage/type_usage_typedef_and_using.cc @@ -57,6 +57,7 @@ OUTPUT: "usr": "c:@F@accept#*$@S@Foo#", "short_name": "accept", "detailed_name": "void accept(Foo *)", + "is_constructor": false, "parameter_type_descriptions": ["Foo *"], "definition_spelling": "7:6-7:12", "definition_extent": "7:1-7:21" @@ -65,6 +66,7 @@ OUTPUT: "usr": "c:@F@accept1#**$@S@Foo#", "short_name": "accept1", "detailed_name": "void accept1(Foo1 *)", + "is_constructor": false, "parameter_type_descriptions": ["Foo1 *"], "definition_spelling": "8:6-8:13", "definition_extent": "8:1-8:23" @@ -73,6 +75,7 @@ OUTPUT: "usr": "c:@F@accept2#*$@S@Foo#", "short_name": "accept2", "detailed_name": "void accept2(Foo2 *)", + "is_constructor": false, "parameter_type_descriptions": ["Foo2 *"], "definition_spelling": "9:6-9:13", "definition_extent": "9:1-9:23" @@ -81,6 +84,7 @@ OUTPUT: "usr": "c:@F@accept3#**$@S@Foo#", "short_name": "accept3", "detailed_name": "void accept3(Foo3 *)", + "is_constructor": false, "parameter_type_descriptions": ["Foo3 *"], "definition_spelling": "10:6-10:13", "definition_extent": "10:1-10:23" diff --git a/tests/usage/type_usage_various.cc b/tests/usage/type_usage_various.cc index 36cdfeb2..3d9ac837 100644 --- a/tests/usage/type_usage_various.cc +++ b/tests/usage/type_usage_various.cc @@ -28,6 +28,7 @@ OUTPUT: "usr": "c:@S@Foo@F@make#", "short_name": "make", "detailed_name": "Foo *Foo::make()", + "is_constructor": false, "declarations": [{ "spelling": "2:8-2:12", "extent": "2:3-2:14", diff --git a/tests/usage/usage_inside_of_call.cc b/tests/usage/usage_inside_of_call.cc index 1bbe82b4..12b13857 100644 --- a/tests/usage/usage_inside_of_call.cc +++ b/tests/usage/usage_inside_of_call.cc @@ -32,6 +32,7 @@ OUTPUT: "usr": "c:@F@called#I#", "short_name": "called", "detailed_name": "void called(int)", + "is_constructor": false, "parameter_type_descriptions": ["int"], "declarations": [{ "spelling": "1:6-1:12", @@ -45,6 +46,7 @@ OUTPUT: "usr": "c:@F@gen#", "short_name": "gen", "detailed_name": "int gen()", + "is_constructor": false, "declarations": [{ "spelling": "3:5-3:8", "extent": "3:1-3:10", @@ -56,6 +58,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "12:6-12:9", "definition_extent": "12:1-15:2", "callees": ["0@14:3-14:9", "1@14:14-14:17"] diff --git a/tests/usage/usage_inside_of_call_simple.cc b/tests/usage/usage_inside_of_call_simple.cc index 7c7bfee5..fc843650 100644 --- a/tests/usage/usage_inside_of_call_simple.cc +++ b/tests/usage/usage_inside_of_call_simple.cc @@ -14,6 +14,7 @@ OUTPUT: "usr": "c:@F@called#I#", "short_name": "called", "detailed_name": "void called(int)", + "is_constructor": false, "parameter_type_descriptions": ["int"], "declarations": [{ "spelling": "1:6-1:12", @@ -27,6 +28,7 @@ OUTPUT: "usr": "c:@F@gen#", "short_name": "gen", "detailed_name": "int gen()", + "is_constructor": false, "definition_spelling": "3:5-3:8", "definition_extent": "3:1-3:24", "callers": ["2@6:10-6:13", "2@6:18-6:21"] @@ -35,6 +37,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "5:6-5:9", "definition_extent": "5:1-7:2", "callees": ["0@6:3-6:9", "1@6:10-6:13", "1@6:18-6:21"] diff --git a/tests/usage/var_usage_call_function.cc b/tests/usage/var_usage_call_function.cc index c5334e15..dac6bb05 100644 --- a/tests/usage/var_usage_call_function.cc +++ b/tests/usage/var_usage_call_function.cc @@ -15,6 +15,7 @@ OUTPUT: "usr": "c:@F@called#", "short_name": "called", "detailed_name": "void called()", + "is_constructor": false, "definition_spelling": "1:6-1:12", "definition_extent": "1:1-1:17", "callers": ["1@4:13-4:19", "1@7:3-7:9"] @@ -23,6 +24,7 @@ OUTPUT: "usr": "c:@F@caller#", "short_name": "caller", "detailed_name": "void caller()", + "is_constructor": false, "definition_spelling": "3:6-3:12", "definition_extent": "3:1-8:2", "callees": ["0@4:13-4:19", "0@7:3-7:9"] diff --git a/tests/usage/var_usage_class_member.cc b/tests/usage/var_usage_class_member.cc index 25e926a5..9324615d 100644 --- a/tests/usage/var_usage_class_member.cc +++ b/tests/usage/var_usage_class_member.cc @@ -36,6 +36,7 @@ OUTPUT: "usr": "c:@F@accept#I#", "short_name": "accept", "detailed_name": "void accept(int)", + "is_constructor": false, "parameter_type_descriptions": ["int"], "declarations": [{ "spelling": "7:6-7:12", @@ -49,6 +50,7 @@ OUTPUT: "usr": "c:@F@accept#*I#", "short_name": "accept", "detailed_name": "void accept(int *)", + "is_constructor": false, "parameter_type_descriptions": ["int *"], "declarations": [{ "spelling": "8:6-8:12", @@ -62,6 +64,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "10:6-10:9", "definition_extent": "10:1-18:2", "callees": ["0@14:3-14:9", "0@15:3-15:9", "1@16:3-16:9", "0@17:3-17:9"] diff --git a/tests/usage/var_usage_class_member_static.cc b/tests/usage/var_usage_class_member_static.cc index 8d3241d9..02deaa50 100644 --- a/tests/usage/var_usage_class_member_static.cc +++ b/tests/usage/var_usage_class_member_static.cc @@ -25,6 +25,7 @@ OUTPUT: "usr": "c:@F@accept#I#", "short_name": "accept", "detailed_name": "void accept(int)", + "is_constructor": false, "parameter_type_descriptions": ["int"], "declarations": [{ "spelling": "5:6-5:12", @@ -38,6 +39,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "7:6-7:9", "definition_extent": "7:1-9:2", "callees": ["0@8:3-8:9"] diff --git a/tests/usage/var_usage_extern.cc b/tests/usage/var_usage_extern.cc index d2cb9865..82d7f2fb 100644 --- a/tests/usage/var_usage_extern.cc +++ b/tests/usage/var_usage_extern.cc @@ -11,6 +11,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "3:6-3:9", "definition_extent": "3:1-5:2" }], diff --git a/tests/usage/var_usage_func_parameter.cc b/tests/usage/var_usage_func_parameter.cc index 13680cba..f7cff35a 100644 --- a/tests/usage/var_usage_func_parameter.cc +++ b/tests/usage/var_usage_func_parameter.cc @@ -9,6 +9,7 @@ OUTPUT: "usr": "c:@F@foo#I#", "short_name": "foo", "detailed_name": "void foo(int)", + "is_constructor": false, "parameter_type_descriptions": ["int"], "definition_spelling": "1:6-1:9", "definition_extent": "1:1-3:2" diff --git a/tests/usage/var_usage_local.cc b/tests/usage/var_usage_local.cc index e403c2a0..d9051fda 100644 --- a/tests/usage/var_usage_local.cc +++ b/tests/usage/var_usage_local.cc @@ -10,6 +10,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "1:6-1:9", "definition_extent": "1:1-4:2" }], diff --git a/tests/usage/var_usage_shadowed_local.cc b/tests/usage/var_usage_shadowed_local.cc index 8cfe84af..1efa5379 100644 --- a/tests/usage/var_usage_shadowed_local.cc +++ b/tests/usage/var_usage_shadowed_local.cc @@ -15,6 +15,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "1:6-1:9", "definition_extent": "1:1-9:2" }], diff --git a/tests/usage/var_usage_shadowed_parameter.cc b/tests/usage/var_usage_shadowed_parameter.cc index 37049aef..34672854 100644 --- a/tests/usage/var_usage_shadowed_parameter.cc +++ b/tests/usage/var_usage_shadowed_parameter.cc @@ -15,6 +15,7 @@ OUTPUT: "usr": "c:@F@foo#I#", "short_name": "foo", "detailed_name": "void foo(int)", + "is_constructor": false, "parameter_type_descriptions": ["int"], "definition_spelling": "1:6-1:9", "definition_extent": "1:1-8:2" diff --git a/tests/usage/var_usage_static.cc b/tests/usage/var_usage_static.cc index cef9e9d4..d95ee0a6 100644 --- a/tests/usage/var_usage_static.cc +++ b/tests/usage/var_usage_static.cc @@ -12,6 +12,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "3:6-3:9", "definition_extent": "3:1-5:2" }], diff --git a/tests/vars/deduce_auto_type.cc b/tests/vars/deduce_auto_type.cc index 8434a21b..5317fd92 100644 --- a/tests/vars/deduce_auto_type.cc +++ b/tests/vars/deduce_auto_type.cc @@ -22,6 +22,7 @@ OUTPUT: "usr": "c:@F@f#", "short_name": "f", "detailed_name": "void f()", + "is_constructor": false, "definition_spelling": "2:6-2:7", "definition_extent": "2:1-5:2" }], diff --git a/tests/vars/function_local.cc b/tests/vars/function_local.cc index 618ced76..32d652d5 100644 --- a/tests/vars/function_local.cc +++ b/tests/vars/function_local.cc @@ -18,6 +18,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "3:6-3:9", "definition_extent": "3:1-5:2" }], diff --git a/tests/vars/function_param.cc b/tests/vars/function_param.cc index a4f5b0f1..b94e9068 100644 --- a/tests/vars/function_param.cc +++ b/tests/vars/function_param.cc @@ -16,6 +16,7 @@ OUTPUT: "usr": "c:@F@foo#*$@S@Foo#S0_#", "short_name": "foo", "detailed_name": "void foo(Foo *, Foo *)", + "is_constructor": false, "parameter_type_descriptions": ["Foo *", "Foo *"], "definition_spelling": "3:6-3:9", "definition_extent": "3:1-3:30" diff --git a/tests/vars/function_param_unnamed.cc b/tests/vars/function_param_unnamed.cc index 3973d51a..cf7da7d6 100644 --- a/tests/vars/function_param_unnamed.cc +++ b/tests/vars/function_param_unnamed.cc @@ -7,6 +7,7 @@ OUTPUT: "usr": "c:@F@foo#I#I#", "short_name": "foo", "detailed_name": "void foo(int, int)", + "is_constructor": false, "parameter_type_descriptions": ["int", "int"], "definition_spelling": "1:6-1:9", "definition_extent": "1:1-1:22" diff --git a/tests/vars/function_shadow_local.cc b/tests/vars/function_shadow_local.cc index e5a0675e..26b2d2ba 100644 --- a/tests/vars/function_shadow_local.cc +++ b/tests/vars/function_shadow_local.cc @@ -15,6 +15,7 @@ OUTPUT: "usr": "c:@F@foo#", "short_name": "foo", "detailed_name": "void foo()", + "is_constructor": false, "definition_spelling": "1:6-1:9", "definition_extent": "1:1-9:2" }], diff --git a/tests/vars/function_shadow_param.cc b/tests/vars/function_shadow_param.cc index 187f0467..bc936fdc 100644 --- a/tests/vars/function_shadow_param.cc +++ b/tests/vars/function_shadow_param.cc @@ -9,6 +9,7 @@ OUTPUT: "usr": "c:@F@foo#I#", "short_name": "foo", "detailed_name": "void foo(int)", + "is_constructor": false, "parameter_type_descriptions": ["int"], "definition_spelling": "1:6-1:9", "definition_extent": "1:1-3:2" diff --git a/tests/vars/type_instance_on_using_type.cc b/tests/vars/type_instance_on_using_type.cc index fbf6897d..2a591395 100644 --- a/tests/vars/type_instance_on_using_type.cc +++ b/tests/vars/type_instance_on_using_type.cc @@ -33,6 +33,7 @@ OUTPUT: "usr": "c:@F@Foo#", "short_name": "Foo", "detailed_name": "void Foo()", + "is_constructor": false, "definition_spelling": "3:6-3:9", "definition_extent": "3:1-5:2" }],