Skip to content

remove template id from constructor/destructor#68

Merged
generalmimon merged 1 commit into
kaitai-io:masterfrom
toge:remove-template-id
Oct 27, 2023
Merged

remove template id from constructor/destructor#68
generalmimon merged 1 commit into
kaitai-io:masterfrom
toge:remove-template-id

Conversation

@toge

@toge toge commented Oct 26, 2023

Copy link
Copy Markdown
Contributor

In 0.10.1, I met compilation errors on gcc 13:

In file included from kaitai/kaitaistream.cpp:2:
kaitai/exceptions.h:118:35: error: expected unqualified-id before ‘const’
  118 |     validation_not_equal_error<T>(const T& expected, const T& actual, kstream* io, const std::string src_path):
      |                                   ^~~~~
kaitai/exceptions.h:118:35: error: expected ‘)’ before ‘const’
  118 |     validation_not_equal_error<T>(const T& expected, const T& actual, kstream* io, const std::string src_path):
      |                                  ~^~~~~
      |                                   )
kaitai/exceptions.h:127:13: error: template-id not allowed for destructor
  127 |     virtual ~validation_not_equal_error<T>() KS_NOEXCEPT {};
      |             ^
...

They are caused by <T> in constructor/destructor.
I want to remove it.

I confirmed gcc/clang/MSVC work fine after deleteing <T>.

@toge toge changed the title remote template id from constructor/destructor remove template id from constructor/destructor Oct 26, 2023
@generalmimon

Copy link
Copy Markdown
Member

Reproduced on gcc 11.4, gcc 12.3 and gcc 13.2, but only with the -std=c++20 flag. Not reproduced on gcc 10.5 or clang 17.0.1.

generalmimon added a commit that referenced this pull request Oct 27, 2023
Should reproduce the problem reported in
#68

@generalmimon generalmimon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@toge Thanks!

@generalmimon
generalmimon merged commit c3a3af8 into kaitai-io:master Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants