Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix cpp20 source location test failure resulting from newer compiler#1326

Merged
kennykerr merged 3 commits intomicrosoft:mastermicrosoft/cppwinrt:masterfrom
dmachaj:user/dmachaj/fix-cpp20-test-casedmachaj/cppwinrt:user/dmachaj/fix-cpp20-test-caseCopy head branch name to clipboard
Jun 22, 2023
Merged

Fix cpp20 source location test failure resulting from newer compiler#1326
kennykerr merged 3 commits intomicrosoft:mastermicrosoft/cppwinrt:masterfrom
dmachaj:user/dmachaj/fix-cpp20-test-casedmachaj/cppwinrt:user/dmachaj/fix-cpp20-test-caseCopy head branch name to clipboard

Conversation

@dmachaj
Copy link
Contributor

@dmachaj dmachaj commented Jun 22, 2023

What's this all about?
Fix a test case failure caused by changing compiler behavior in a newer compiler version. The signature that MSVC provides for source_location has changed recently.

Instead of chasing the full decorated name, with each compiler having a slight variation, we now match just the meaningful substring that we care about "FailOnLine15". This should now be stable across compilers and across compiler versions.

Fixes: #1325

kennykerr
kennykerr previously approved these changes Jun 22, 2023
Copy link
Collaborator

@kennykerr kennykerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sylveon
Copy link
Contributor

sylveon commented Jun 22, 2023

Would it make more sense to validate that functionNameSv contains the name of the function instead of using a strict ==

@dmachaj
Copy link
Contributor Author

dmachaj commented Jun 22, 2023

Would it make more sense to validate that functionNameSv contains the name of the function instead of using a strict ==

That's a good point. That should still provide the validation we need while also being far more stable. Great suggestion 👍

test/test_cpp20/custom_error.cpp Outdated Show resolved Hide resolved
@kennykerr kennykerr merged commit d3bb275 into microsoft:master Jun 22, 2023
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.

Bug: cpp20 source location test case failure

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.