Crafter.Build/tests/IncrementalInterfaceChange/fixture/lib/Widget.cppm

19 lines
820 B
Text
Raw Normal View History

// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
export module Widget;
import std;
// The test rewrites this struct to add a member. Adding one changes the class
// layout while leaving every signature and mangled name untouched, so nothing
// downstream fails to link — a consumer object left over from before the change
// keeps the old sizeof and quietly disagrees with the library.
export struct Widget {
std::string a;
};
// Deliberately out-of-line, in the library's own implementation unit, so the
// value reflects the layout the *library* was compiled against rather than the
// caller's. An inline body would be instantiated from the (rebuilt) BMI in the
// consumer and would agree with it by construction.
export std::size_t WidgetSizeInLibrary();