Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("//cpp/libclang/integration_test:test_rules.bzl", "cpp_parser_integration_test")

cc_library(
name = "forward_declared_interface_merge",
srcs = glob(["*.cpp"]),
visibility = ["//cpp/libclang:__subpackages__"],
)

cpp_parser_integration_test(
name = "test_forward_declared_interface_merge",
expected_output = ["expected.json"],
target = ":forward_declared_interface_merge",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
class IThing
{
public:
virtual ~IThing() = default;
virtual void run() = 0;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
class IThing;

void use_thing(IThing *thing) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"types": {
"IThing": {
"id": "IThing",
"name": "IThing",
"enclosing_namespace_id": null,
"stereotypes": [],
"entity_type": "Interface",
"type_aliases": [],
"variables": [],
"methods": [
{
"name": "~IThing",
"return_type": null,
"visibility": "public",
"parameters": [],
"template_parameters": null,
"modifiers": [
"Virtual",
"Destructor"
],
"source_location": {
"file": "cpp/libclang/integration_test/cases/forward_declared_interface_merge/a_full_definition.cpp",
"line": 16
}
},
{
"name": "run",
"return_type": "void",
"visibility": "public",
"parameters": [],
"template_parameters": null,
"modifiers": [
"Virtual",
"Abstract"
],
"source_location": {
"file": "cpp/libclang/integration_test/cases/forward_declared_interface_merge/a_full_definition.cpp",
"line": 17
}
}
],
"template_parameters": null,
"enum_literals": [],
"relationships": [],
"source_location": {
"file": "cpp/libclang/integration_test/cases/forward_declared_interface_merge/a_full_definition.cpp",
"line": 13
}
}
},
"free_function_declarations": [
{
"name": "use_thing",
"enclosing_namespace_id": null,
"return_type": "void",
"parameters": [
{
"name": "thing",
"param_type": "IThing *",
"is_variadic": false
}
],
"template_parameters": null,
"source_location": {
"file": "cpp/libclang/integration_test/cases/forward_declared_interface_merge/b_forward_declaration.cpp",
"line": 15
}
}
],
"functions": [
{
"id": {
"scope": "Global",
"name": "use_thing"
},
"kind": "Free",
"return_type": {
"Builtin": "void"
},
"body": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// *******************************************************************************
// Copyright (c) 2026 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License Version 2.0 which is available at
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
// *******************************************************************************

use test_framework::run_parser_case;

#[test]
fn test_forward_declared_interface_merge() {
run_parser_case();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("//cpp/libclang/integration_test:test_rules.bzl", "cpp_parser_integration_test")

cc_library(
name = "overload_signedness_identity",
srcs = ["functions.cpp"],
hdrs = ["functions.hpp"],
visibility = ["//cpp/libclang:__subpackages__"],
)

cpp_parser_integration_test(
name = "test_overload_signedness_identity",
expected_output = ["expected.json"],
target = ":overload_signedness_identity",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{
"types": {},
"free_function_declarations": [
{
"name": "fixed_width",
"enclosing_namespace_id": null,
"return_type": "void",
"parameters": [
{
"name": "",
"param_type": "std::int32_t",
"is_variadic": false
}
],
"template_parameters": null,
"source_location": {
"file": "cpp/libclang/integration_test/function_cases/overload_signedness_identity/functions.hpp",
"line": 19
}
},
{
"name": "fixed_width",
"enclosing_namespace_id": null,
"return_type": "void",
"parameters": [
{
"name": "",
"param_type": "std::uint32_t",
"is_variadic": false
}
],
"template_parameters": null,
"source_location": {
"file": "cpp/libclang/integration_test/function_cases/overload_signedness_identity/functions.hpp",
"line": 20
}
},
{
"name": "size_vs_long",
"enclosing_namespace_id": null,
"return_type": "void",
"parameters": [
{
"name": "",
"param_type": "long",
"is_variadic": false
}
],
"template_parameters": null,
"source_location": {
"file": "cpp/libclang/integration_test/function_cases/overload_signedness_identity/functions.hpp",
"line": 21
}
},
{
"name": "size_vs_long",
"enclosing_namespace_id": null,
"return_type": "void",
"parameters": [
{
"name": "",
"param_type": "std::size_t",
"is_variadic": false
}
],
"template_parameters": null,
"source_location": {
"file": "cpp/libclang/integration_test/function_cases/overload_signedness_identity/functions.hpp",
"line": 22
}
}
],
"functions": [
{
"id": {
"scope": "Global",
"name": "fixed_width"
},
"kind": "Free",
"return_type": {
"Builtin": "void"
},
"body": []
},
{
"id": {
"scope": "Global",
"name": "fixed_width"
},
"kind": "Free",
"return_type": {
"Builtin": "void"
},
"body": []
},
{
"id": {
"scope": "Global",
"name": "size_vs_long"
},
"kind": "Free",
"return_type": {
"Builtin": "void"
},
"body": []
},
{
"id": {
"scope": "Global",
"name": "size_vs_long"
},
"kind": "Free",
"return_type": {
"Builtin": "void"
},
"body": []
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

#include "functions.hpp"

void fixed_width(std::int32_t value) {}
void fixed_width(std::uint32_t value) {}
void size_vs_long(long value) {}
void size_vs_long(std::size_t value) {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/

#pragma once

#include <cstddef>
#include <cstdint>

void fixed_width(std::int32_t);
void fixed_width(std::uint32_t);
void size_vs_long(long);
void size_vs_long(std::size_t);
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// *******************************************************************************
// Copyright (c) 2026 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache License Version 2.0 which is available at
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
// *******************************************************************************

use test_framework::run_parser_case;

#[test]
fn test_overload_signedness_identity() {
run_parser_case();
}
Loading
Loading