[HLSL] Template parameter elision creates confusing Diagnostics for mismatched vector (matrix) templates #112410
Labels
clang:diagnostics
New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
HLSL
HLSL Language Support
Because HLSL vector types (and soon matrices) are defined as templates, some of the diagnostics will treat them as user-defined templates that don't match in all the particulars instead of printing them as types in their diagnostic messages.
These take the form of eliding the template elements that match, which makes it unclear what HLSL types they refer to or even that they refer to HLSL types. Two examples:
This can be seen in this test and will manifest in several of the new matrix tests.
The elision could be removed, but that would change behavior elsewhere. Perhaps a preferrable solution would be to direct these diagnostic prints to places where the types get printed instead of the more generic template outputs. These don't involve TypePrinter at all, rather the output comes from the TemplateDiff class in ASTDiagnostics.c
llvm-project/clang/lib/AST/ASTDiagnostic.cpp
Line 2029 in fe7f5f9
The text was updated successfully, but these errors were encountered: