Skip to content

fix(share_plus): remove extra qualification that breaks Windows C++20 builds - #4010

Open
ChandraChaan wants to merge 1 commit into
fluttercommunity:mainfrom
ChandraChaan:fix/share-plus-windows-cpp20
Open

ChandraChaan wants to merge 1 commit into
fluttercommunity:mainfrom
ChandraChaan:fix/share-plus-windows-cpp20

Conversation

@ChandraChaan

Copy link
Copy Markdown

Description

share_plus_windows_plugin.h declares a member with its class name in front of it:

static std::wstring SharePlusWindowsPlugin::Utf16FromUtf8(std::string string);

An extra qualification on a member declaration isn't valid C++. MSVC used to accept it in permissive mode, but apps that compile with /std:c++20 (which turns on /permissive-) fail with error C4596: 'Utf16FromUtf8': illegal qualified name in member declaration, so share_plus can't be built in those projects at all.

This removes the qualification. The definition in share_plus_plugin.cpp and every call site are unchanged, so there's no behaviour change. I checked the rest of the plugins' Windows headers and this was the only occurrence.

I verified the before and after with clang++ -std=c++20 -fsyntax-only on a reduced example: it reports "extra qualification on member" for the old line and accepts the new one. I don't have a Windows machine to run a full MSVC build, so a CI run on Windows would be welcome.

Related Issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

  • No, this is not a breaking change.

@ChandraChaan

Copy link
Copy Markdown
Author

The ios_integration_test job was cancelled after about 30 minutes while running the integration tests, before any result. This change only touches a Windows C++ header, and the same job was also cancelled on several other recent share_plus runs (including a dependabot update and a release branch). Could a maintainer re-run it when convenient? Thanks!

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.

[Compile+SharePlus]: Illegal qualified name

1 participant