[clang] Improve packoffset error message (PR #173077)
Helena Kotas via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 19 10:47:44 PST 2025
================
@@ -1943,8 +1943,8 @@ void SemaHLSL::handlePackOffsetAttr(Decl *D, const ParsedAttr &AL) {
// Check Component is valid for T.
if (Component) {
unsigned Size = getASTContext().getTypeSize(T);
- if (IsAggregateTy || Size > 128) {
- Diag(AL.getLoc(), diag::err_hlsl_packoffset_cross_reg_boundary);
+ if (IsAggregateTy) {
+ Diag(AL.getLoc(), diag::err_hlsl_invalid_register_or_packoffset);
----------------
hekota wrote:
I've updated the description. The `Size > 128` case is handled in the `else` branch on line 1951.
https://github.com/llvm/llvm-project/pull/173077
More information about the cfe-commits
mailing list