AnyarInc / Ascent

A fast and flexible C++ simulation engine and differential equation solver.
Apache License 2.0
123 stars 15 forks source link

"module" is a keyword in C++ 20 #4

Closed mwalcott3 closed 2 years ago

mwalcott3 commented 4 years ago

Pretty straightforward but all variables with the name "module" need to be replaced with with something else. If it is used as a member variable then there may be breaking changes.

ma740988 commented 3 years ago

I had to #include in unit_test/src/main.cpp to get the code to compile. See error below. I'm running on Fedora 34 with gcc 11.1.1

[user@fedora Ascent-0.6.0]$ mkdir Build [user@fedora Ascent-0.6.0]$ cd Build/ [user@fedora Build]$ cmake .. -- The CXX compiler identification is GNU 11.1.1 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /home/user/Downloads/Ascent-0.6.0/Build [user@fedora Build]$ make Scanning dependencies of target ascent_test [ 8%] Building CXX object unit_tests/CMakeFiles/ascent_test.dir/src/main.cpp.o /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:39:9: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type 39 std::shared_ptr<asc::Timing> sim{}; ^~~~~~ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:21:1: note: ‘std::shared_ptr’ is defined in header ‘’; did you forget to ‘#include ’? 20 #include "ascent/timing/Timing.h" +++ +#include 21 /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp: In member function ‘virtual void AiryMod::operator()()’: /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:50:14: error: ‘sim’ was not declared in this scope; did you mean ‘sin’? 50 b_d = -sim->t*a; ^~~ sin /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp: In function ‘std::vector airy_test_mod(double)’: /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:98:23: error: ‘make_shared’ is not a member of ‘std’ 98 auto system = std::make_shared(); ^~~ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:98:23: note: ‘std::make_shared’ is defined in header ‘’; did you forget to ‘#include ’? /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:98:42: error: expected primary-expression before ‘>’ token 98 auto system = std::make_shared(); ^ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:98:44: error: expected primary-expression before ‘)’ token 98 auto system = std::make_shared(); ^ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:99:23: error: ‘make_shared’ is not a member of ‘std’ 99 system->sim = std::make_shared<asc::Timing>(); ^~~ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:99:23: note: ‘std::make_shared’ is defined in header ‘’; did you forget to ‘#include ’? /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:99:53: error: expected primary-expression before ‘>’ token 99 system->sim = std::make_shared<asc::Timing>(); ^~ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:99:56: error: expected primary-expression before ‘)’ token 99 system->sim = std::make_shared<asc::Timing>(); ^ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:114:33: error: could not convert ‘{, }’ from ‘’ to ‘std::vector’ 114 return{ system->a, system->b }; ^
/home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp: In function ‘std::pair<double, double> exponential_test_mod(double)’: /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:140:23: error: ‘make_shared’ is not a member of ‘std’ 140 auto system = std::make_shared(); ^~~ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:140:23: note: ‘std::make_shared’ is defined in header ‘’; did you forget to ‘#include ’? /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:140:49: error: expected primary-expression before ‘>’ token 140 auto system = std::make_shared(); ^ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:140:51: error: expected primary-expression before ‘)’ token 140 auto system = std::make_shared(); ^ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:141:20: error: ‘make_shared’ is not a member of ‘std’ 141 auto sim = std::make_shared<asc::Timing>(); ^~~ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:141:20: note: ‘std::make_shared’ is defined in header ‘’; did you forget to ‘#include ’? /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:141:50: error: expected primary-expression before ‘>’ token 141 auto sim = std::make_shared<asc::Timing>(); ^~ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:141:53: error: expected primary-expression before ‘)’ token 141 auto sim = std::make_shared<asc::Timing>(); ^ /home/user/Downloads/Ascent-0.6.0/unit_tests/src/main.cpp:155:34: error: could not convert ‘{, }’ from ‘’ to ‘std::pair<double, double>’ 155 return{ system->value, sim->t }; ^

make[2]: [unit_tests/CMakeFiles/ascent_test.dir/build.make:82: unit_tests/CMakeFiles/ascent_test.dir/src/main.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:1020: unit_tests/CMakeFiles/ascent_test.dir/all] Error 2 make: *** [Makefile:182: all] Error 2 [user@fedora Build]$

stephenberry commented 2 years ago

Fixed