Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amend template specialization DXASSERT conditions #6617

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tcorringham
Copy link
Collaborator

Clang suppresses template specialization if a fatal error has been reported in order to reduce the risk of a cascade of secondary error diagnostics.

However, DXC DXASSERTs if template specialization fails - even if that is due to an unrelated fatal error - which has the unintended result of hiding the fatal error and hence providing no indication of what the problem is.

The DXASSERT conditions have been amended so they are no longer raised if a fatal error has been registered.

Clang suppresses template specialization if a fatal error has been
reported in order to reduce the risk of a cascade of secondary error
diagnostics.

However, DXC DXASSERTs if template specialization fails - even if that
is due to an unrelated fatal error - which has the unintended result of
hiding the fatal error and hence providing no indication of what the
problem is.

The DXASSERT conditions have been amended so they are no longer raised
if a fatal error has been registered.
@tcorringham tcorringham requested a review from a team as a code owner May 13, 2024 18:57
@tcorringham tcorringham self-assigned this May 13, 2024
Copy link
Collaborator

@llvm-beanz llvm-beanz left a comment

Choose a reason for hiding this comment

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

This is all a grotesque misuse of asserts. We shouldn't be asserting for things that can actually fail.

My gut feeling here is that if we're going to spend the time fixing this we should actually refactor the code so that we propagate the error condition and gracefully exit early.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

None yet

2 participants