-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Amend template specialization DXASSERT conditions
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.
- Loading branch information
Tim Corringham
committed
May 13, 2024
1 parent
01007bc
commit 7f66c33
Showing
2 changed files
with
43 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// RUN: %dxc -T lib_6_8 -verify %s | ||
|
||
// Clang suppresses template specialization if a fatal error has been | ||
// registered (this reduces the risk of a cascade of secondary errors). | ||
// However, DXC DXASSERTs if a template specialization fails - which | ||
// prevents the error diagnostic being generated. | ||
// We check here that a DXASSERT is no longer raised if a fatal error | ||
// has been registered, and that the error diagnostic is generated. | ||
|
||
float a; | ||
|
||
// the include file doesn't exist - this should produce a fatal error diagnostic | ||
// expected-error@+1 {{'a.h' file not found}} | ||
#include "a.h" | ||
|
||
void b() {}; | ||
|
||
int3 c(int X) { | ||
// DXASSERT was triggered if include file a.h doesn't exist, and the error | ||
// diagnostic was not produced. | ||
return X.xxx; | ||
} |