Skip to content

Commit 227324c

Browse files
committed
C++: do not use fully qualified names in error template parameters
The definition of variables does not use them, so here it is also unnecessary. For C++11 changes this code: ``` m_one_cat = std::unique_ptr<cat_t>(new cat_t(m__io, this, m__root)); m_one_cat->_read(); { // Definition: cat_t* one_cat() { return m_one_cat.get(); } std::unique_ptr<cat_t> _ = one_cat(); if (!(1 == 1)) { throw kaitai::validation_expr_error<std::unique_ptr<debug_array_user_t::cat_t>>(one_cat(), _io(), std::string("/seq/0")); } } ``` to this: ``` m_one_cat = std::unique_ptr<cat_t>(new cat_t(m__io, this, m__root)); m_one_cat->_read(); { // Definition: cat_t* one_cat() { return m_one_cat.get(); } std::unique_ptr<cat_t> _ = one_cat(); if (!(1 == 1)) { throw kaitai::validation_expr_error<std::unique_ptr<cat_t>>(one_cat(), _io(), std::string("/seq/0")); } } ```
1 parent 804ee53 commit 227324c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared/src/main/scala/io/kaitai/struct/languages/CppCompiler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ class CppCompiler(
10531053
case UndecidedEndiannessError => "kaitai::undecided_endianness_error"
10541054
case ConversionError => "std::invalid_argument"
10551055
case validationErr: ValidationError =>
1056-
val cppType = kaitaiType2NativeType(validationErr.dt, true)
1056+
val cppType = kaitaiType2NativeType(validationErr.dt)
10571057
val cppErrName = validationErr match {
10581058
case _: ValidationNotEqualError => "validation_not_equal_error"
10591059
case _: ValidationLessThanError => "validation_less_than_error"

0 commit comments

Comments
 (0)