You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Generated automatically using the command :# c++2py tmp.hpp -N test_namespacefromcpp2py.wrap_generatorimport*# The modulemodule=module_(full_name="tmp", doc=r"", app_name="tmp")
# Imports# Add here all includesmodule.add_include("tmp.hpp")
# Add here anything to add in the C++ code at the start, e.g. namespace usingmodule.add_preamble("""#include <cpp2py/converters/pair.hpp>using namespace test_namespace;""")
# The class test_classc=class_(
py_type="TestClass", # name of the python classc_type="test_namespace::test_class", # name of the C++ classdoc=r"""""", # doc of the C++ classhdf5=False,
)
c.add_method("""std::pair<return_t,double> test_function_bad ()""",
doc=r"""""")
c.add_method("""test_namespace::test_class::return_t test_function_good ()""",
doc=r"""""")
module.add_class(c)
module.generate_code()
Here return_t is not correctly qualified as part of the return type in test_function_bad(). This leads to a "use of undeclared identifier" error when compiling. Contrast to the correct behaviour in test_function_good().
I'm guessing that c++2py would need to recursively step into the compound return type to check that everything is fully qualified?
[PS: I'm using the c++2py bundled with TRIQS 2.2.x]
The text was updated successfully, but these errors were encountered:
Hi,
I ran across a problem where a locally defined type was not fully qualified when it was part of a compound return type.
Here a minimal example
test.hpp
:If we run
c++2py
on this:Here
return_t
is not correctly qualified as part of the return type intest_function_bad()
. This leads to a "use of undeclared identifier" error when compiling. Contrast to the correct behaviour intest_function_good()
.I'm guessing that c++2py would need to recursively step into the compound return type to check that everything is fully qualified?
[PS: I'm using the c++2py bundled with TRIQS 2.2.x]
The text was updated successfully, but these errors were encountered: