From f4f8ea0dcf9454a0e1270e6e27052075bf7a3143 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 7 Aug 2024 18:37:15 -0400 Subject: [PATCH] Internals: Change cast fileline to point to cast operator --- src/verilog.y | 2 +- test_regress/t/t_cast_class_incompat_bad.out | 8 ++++---- test_regress/t/t_math_wide_bad.out | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/verilog.y b/src/verilog.y index cbed89c0d..70ed8cf30 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -5012,7 +5012,7 @@ expr: // IEEE: part of expression/constant_expression/ // // IEEE: cast/constant_cast // // expanded from casting_type | simple_type yP_TICK '(' expr ')' - { $$ = new AstCast{$1->fileline(), $4, VFlagChildDType{}, $1}; } + { $$ = new AstCast{$2, $4, VFlagChildDType{}, $1}; } | yTYPE__ETC '(' exprOrDataType ')' yP_TICK '(' expr ')' { $$ = new AstCast{$1, $7, VFlagChildDType{}, new AstRefDType{$1, AstRefDType::FlagTypeOfExpr{}, $3}}; } diff --git a/test_regress/t/t_cast_class_incompat_bad.out b/test_regress/t/t_cast_class_incompat_bad.out index f783fac40..fe3419c77 100644 --- a/test_regress/t/t_cast_class_incompat_bad.out +++ b/test_regress/t/t_cast_class_incompat_bad.out @@ -1,10 +1,10 @@ -%Error: t/t_cast_class_incompat_bad.v:26:16: Dynamic, not static cast, required to cast 'class{}BaseExtended' from 'class{}Base' +%Error: t/t_cast_class_incompat_bad.v:26:28: Dynamic, not static cast, required to cast 'class{}BaseExtended' from 'class{}Base' : ... note: In instance 't' : ... Suggest dynamic $cast 26 | cls_ab = BaseExtended'(cls_a); - | ^~~~~~~~~~~~ -%Error: t/t_cast_class_incompat_bad.v:27:15: Incompatible types to static cast to 'class{}Other' from 'class{}BaseExtended' + | ^ +%Error: t/t_cast_class_incompat_bad.v:27:20: Incompatible types to static cast to 'class{}Other' from 'class{}BaseExtended' : ... note: In instance 't' 27 | other = Other'(cls_ab); - | ^~~~~ + | ^ %Error: Exiting due to diff --git a/test_regress/t/t_math_wide_bad.out b/test_regress/t/t_math_wide_bad.out index 21b4f05ec..a95cc5a0d 100644 --- a/test_regress/t/t_math_wide_bad.out +++ b/test_regress/t/t_math_wide_bad.out @@ -1,6 +1,6 @@ -%Error-UNSUPPORTED: t/t_math_wide_bad.v:23:15: Unsupported: operator ISTORD operator of 64 bits exceeds hardcoded limit VL_MULS_MAX_WORDS in verilatedos.h +%Error-UNSUPPORTED: t/t_math_wide_bad.v:23:19: Unsupported: operator ISTORD operator of 64 bits exceeds hardcoded limit VL_MULS_MAX_WORDS in verilatedos.h 23 | assign r = real'(a); - | ^~~~ + | ^ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest %Error-UNSUPPORTED: t/t_math_wide_bad.v:22:18: Unsupported: operator POWSS operator of 5472 bits exceeds hardcoded limit VL_MULS_MAX_WORDS in verilatedos.h 22 | assign z2 = a ** 3;