Skip to content

Fix GCC 15 Build Error - Incomplete Type in std::unique_ptr#1025

Merged
mfisher31 merged 1 commit intokushview:mainfrom
bzeiss:fedora-build-fixes
Dec 31, 2025
Merged

Fix GCC 15 Build Error - Incomplete Type in std::unique_ptr#1025
mfisher31 merged 1 commit intokushview:mainfrom
bzeiss:fedora-build-fixes

Conversation

@bzeiss
Copy link
Copy Markdown
Contributor

@bzeiss bzeiss commented Dec 31, 2025

1. What Has Been Changed

Added #include <element/ui/content.hpp> to include/element/application.hpp to provide the complete definition of ContentFactory before its use with std::unique_ptr.

2. Why It Has Been Changed / Points Addressed

Issue: Build failure on Fedora 43 with GCC 15:

error: invalid application of 'sizeof' to incomplete type 'element::ContentFactory'

Root Cause: The Application::createContentFactory() method returns std::unique_ptr<ContentFactory> initialized with nullptr. When constructing this unique_ptr, the compiler instantiates std::default_delete<ContentFactory>, which requires the complete type definition. Previously, only a forward declaration was available at that point.

Standard Compliance: GCC 15 enforces the C++ standard requirement more strictly than older compilers. The standard requires complete types for std::unique_ptr deleters, though some compilers were more lenient.

3. Test Recommendations / Test Ideas

  • Build on GCC 15+ (Fedora 43, Arch with latest GCC) - confirmed
  • Build on older GCC versions (GCC 9, 10, 11, 13)
  • Build on Clang (Linux, macOS)
  • Build on MSVC (Windows)
  • Verify all plugin formats still build correctly
  • Run existing test suite to confirm no behavioral changes

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Dec 31, 2025

CLA assistant check
All committers have signed the CLA.

@bzeiss bzeiss marked this pull request as ready for review December 31, 2025 14:08
@mfisher31
Copy link
Copy Markdown
Member

Thanks, surprised the forward declare wasn't working since the ContentFactory isn't actually used in the header. I'll take it!!! Thanks again.

@mfisher31 mfisher31 merged commit ee7e127 into kushview:main Dec 31, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants