Skip to content

Reliably diagnose stack allocations in C++/WinRT breaks the Xaml compiler#343

Merged
kennykerr merged 1 commit into
masterfrom
kennykerr-detection
Apr 23, 2019
Merged

Reliably diagnose stack allocations in C++/WinRT breaks the Xaml compiler#343
kennykerr merged 1 commit into
masterfrom
kennykerr-detection

Conversation

@kennykerr

Copy link
Copy Markdown
Contributor

The Xaml compiler has a bug where it generates std::shared_ptr<T> instead of winrt::com_ptr<T> for WinRT types. This has always been wrong because it breaks the lifetime guarantee of the implementation. The newly introduced diagnostics in C++/WinRT correctly flags this invalid use with a compiler error. Unfortunately, fixing the Xaml compiler may take some time so we need an opt-out for projects using the Xaml compiler until a fix is available. Now projects can define WINRT_NO_MAKE_DETECTION to turn off the detection of direct allocations.

@kennykerr kennykerr merged commit 92eaf47 into master Apr 23, 2019
@kennykerr kennykerr deleted the kennykerr-detection branch April 23, 2019 19:49
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.

2 participants