Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows compile error #585

Open
rafaelBauer opened this issue Aug 3, 2023 · 1 comment
Open

Windows compile error #585

rafaelBauer opened this issue Aug 3, 2023 · 1 comment

Comments

@rafaelBauer
Copy link

Expected Behavior

Previously it was compiling in Windows using clang-cl 13.

Actual Behavior

Failing with message:
'boost::sml::back::policies::thread_safe<std::recursive_mutex>::create_lock()::lock_guard::~lock_guard()::lock_guard::lock_' is not a member of class 'lock_guard' ~lock_guard() { lock_.unlock(); }

Steps to Reproduce the Problem

Compile with clang-cl 13

Specifications

  • Version: master
  • Platform: Windows clang-cl
  • Subsystem:
@Alex0vSky
Copy link

Alex0vSky commented Oct 13, 2023

So that we can solve the problem, we need to look at the source code that causes the error and the compilation options.

If the source code is not provided, the issue may be closed soon - a minimally reproducible example has not been provided in full.

Yes, it can be just

#include "sml.hpp"
void main() {}

If we look deeper, then maybe here error:

    struct lock_guard {
      constexpr explicit lock_guard(TLock &lock) : lock_{lock} { lock_.lock(); }
      ~lock_guard() { lock_.unlock(); }
      TLock &lock_;
    };

and solution is declare member lock_ before using it.

    struct lock_guard {
      TLock &lock_;
      constexpr explicit lock_guard(TLock &lock) : lock_{lock} { lock_.lock(); }
      ~lock_guard() { lock_.unlock(); }
    };

But declare before use rule not required inside a class SO

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

No branches or pull requests

2 participants