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

include/sol/optional_implementation.hpp:2194:10: error: no member named 'construct' in 'optional<type-parameter-0-0 &>' #1657

Open
skhaz opened this issue Dec 15, 2024 · 3 comments

Comments

@skhaz
Copy link

skhaz commented Dec 15, 2024

(carimbo) λ /opt/workspace/carimbolabs/carimbo/ main* cmake --build build --parallel 8
[  2%] Building CXX object CMakeFiles/carimbo.dir/cmake_pch.hxx.pch
In file included from <built-in>:1:
In file included from /opt/workspace/carimbolabs/carimbo/build/CMakeFiles/carimbo.dir/cmake_pch.hxx:5:
In file included from /opt/workspace/carimbolabs/carimbo/src/anchor.hpp:3:
In file included from /opt/workspace/carimbolabs/carimbo/src/common.hpp:30:
In file included from /Users/me/.conan2/p/sol2f5e2ff06954f4/p/include/sol/sol.hpp:52:
In file included from /Users/me/.conan2/p/sol2f5e2ff06954f4/p/include/sol/stack.hpp:27:
In file included from /Users/me/.conan2/p/sol2f5e2ff06954f4/p/include/sol/trampoline.hpp:27:
In file included from /Users/me/.conan2/p/sol2f5e2ff06954f4/p/include/sol/types.hpp:28:
In file included from /Users/me/.conan2/p/sol2f5e2ff06954f4/p/include/sol/optional.hpp:33:
/Users/me/.conan2/p/sol2f5e2ff06954f4/p/include/sol/optional_implementation.hpp:2194:10: error: no member named 'construct' in 'optional<type-parameter-0-0 &>'
 2194 |                         this->construct(std::forward<Args>(args)...);
      |                         ~~~~  ^
1 error generated.
@skhaz skhaz closed this as completed Dec 16, 2024
@skhaz skhaz reopened this Jan 29, 2025
@skhaz
Copy link
Author

skhaz commented Jan 29, 2025

Temporary workaround

for file in /home/runner/.conan2/p/sol2*/p/include/sol/optional_implementation.hpp; do
  if [[ -f "$file" ]]; then
    sed -i 's/this->construct(std::forward<Args>(args)...);/this->emplace(std::forward<Args>(args)...);/' "$file"
  fi
done

@Shucharjer
Copy link

void foo() { std::cout << "hello world\n"; }

TEST_CASE("a simple case) {
    sol::state lua;
    lua.set_function("foo", foo);
    lua.script("foo()");
}

Then we could get same error.

Another thing is I was able to run this kind of code when using Clang 18.1.7.
But I encountered a bug that caused the code (also a template) that should have been able to compile to report an error,
I updated my Clang to 19.1.5, solved my error, meeting this error.
I think this might have to do with compiler doing stricter template argument checking.
What's your compiler? Version?

@skhaz
Copy link
Author

skhaz commented Feb 6, 2025

It only happens on emsdk/3.1.72 which ships it owns version of llvm/clang.

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