You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
A large codebase that is successfully compiled in many projects sometimes triggers a DXASSERT when specializing a template type - with no reason being apparent.
Steps to Reproduce
// bug.hlsl - a very artificial example that illustrates the issue
float a;
#include "a.h" // include file doesn't exist - this should produce an fatal error diagnostic
void b() {};
int3 c(int X)
{
return X.xxx; // assert triggered if include file a.h doesn't exist, compilation succeeds if it does
}
// dxc -T lib_6_8 bug.hlsl
Actual Behavior
An investigation revealed the DXASSERT was only triggered if there was some error detected earlier in the compilation - e.g. an include file is not found.
Clang suppresses template specialization if a fatal error has been reported in order to avoid the risk of a cascade of secondary error diagnostics from a failed specialization.
The DXASSERTs only check for a failed specialization, without allowing for the failure being due to an earlier unrelated fatal error - this has the unintended result of hiding the fatal error, and providing no indication of what the problem is.
The DXASSERTs should not trigger if a fatal error has been registered.
Environment
DXC version :libdxcompiler.so: 1.8(dev;4588-f6d17595)
Host Operating System : Any
The text was updated successfully, but these errors were encountered:
Description
A large codebase that is successfully compiled in many projects sometimes triggers a DXASSERT when specializing a template type - with no reason being apparent.
Steps to Reproduce
// bug.hlsl - a very artificial example that illustrates the issue
float a;
#include "a.h" // include file doesn't exist - this should produce an fatal error diagnostic
void b() {};
int3 c(int X)
{
return X.xxx; // assert triggered if include file a.h doesn't exist, compilation succeeds if it does
}
// dxc -T lib_6_8 bug.hlsl
Actual Behavior
An investigation revealed the DXASSERT was only triggered if there was some error detected earlier in the compilation - e.g. an include file is not found.
Clang suppresses template specialization if a fatal error has been reported in order to avoid the risk of a cascade of secondary error diagnostics from a failed specialization.
The DXASSERTs only check for a failed specialization, without allowing for the failure being due to an earlier unrelated fatal error - this has the unintended result of hiding the fatal error, and providing no indication of what the problem is.
The DXASSERTs should not trigger if a fatal error has been registered.
Environment
The text was updated successfully, but these errors were encountered: