Skip to content

Wrong template parameter in destructor #21

@ricab

Description

@ricab

Originally posted by @jasonivey in #17 (comment)

There are two errors/warnings which seem to conflict:

  • GCC 11 with C++20 enabled gives the error:
    scope_guard/scope_guard.hpp:152:36: error: template-id not allowed for destructor
      152 | sg::detail::scope_guard<Callback>::~scope_guard<Callback>() noexcept
            |                                    ^
    
  • Clang 12/13/14 triggers the warning -Wdtor-name:
    warning: ISO C++ requires the name after ‘::~’ to be found in the same scope as the name before ‘::~’
    
    Note: this was (incorrectly) fixed with pull request Make it work with clang 12.0.5 #10 right before the last release

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions