Skip to content

Commit

Permalink
C++: do not use fully qualified names in error template parameters
Browse files Browse the repository at this point in the history
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"));
    }
}
```
  • Loading branch information
Mingun committed Oct 4, 2024
1 parent 6f73836 commit e236c71
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ class CppCompiler(
case UndecidedEndiannessError => "kaitai::undecided_endianness_error"
case ConversionError => "std::invalid_argument"
case validationErr: ValidationError =>
val cppType = kaitaiType2NativeType(validationErr.dt, true)
val cppType = kaitaiType2NativeType(validationErr.dt)
val cppErrName = validationErr match {
case _: ValidationNotEqualError => "validation_not_equal_error"
case _: ValidationLessThanError => "validation_less_than_error"
Expand Down

0 comments on commit e236c71

Please sign in to comment.