standardese / cppast

Library to parse and work with the C++ AST
Other
1.7k stars 164 forks source link

Clang complains about unqualified move on function_parser.cpp #161

Closed CarlosNihelton closed 1 year ago

CarlosNihelton commented 1 year ago

Hello, again! When I noticed #160 I switched to clang++ in hopes that was a compiler error. I guess array bound checking in clang is not yet at the same level of GCC. Not sure. But then clang complained about this unqualified move:

https://github.com/foonathan/cppast/blob/main/src/libclang/function_parser.cpp#L657-L658

Notice that the condition is present on the current main branch.

Input flags: cmake -S. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_FLAGS="-frecord-gcc-switches" -DLLVM_CONFIG_BINARY=/usr/lib/llvm-15/bin/llvm-config -DCMAKE_CXX_COMPILER=clang++

Output:

cmake --build build --target standardese_tool
[36/83] Building CXX object external/cppast/src/CMakeFiles/cppast.dir/libclang/function_parser.cpp.o
FAILED: external/cppast/src/CMakeFiles/cppast.dir/libclang/function_parser.cpp.o
/usr/bin/clang++ -DCPPAST_CLANG_BINARY=\"/usr/lib/llvm-15/bin/clang\" -DCPPAST_CLANG_VERSION_STRING=\"15.0.6\" -DCPPAST_VERSION_MAJOR=\"0\" -DCPPAST_VERSION_MINOR=\"0\" -DCPPAST_VERSION_STRING=\"0.0\" -DTYPE_SAFE_ARITHMETIC_POLICY=1 -DTYPE_SAFE_ENABLE_ASSERTIONS=0 -DTYPE_SAFE_ENABLE_PRECONDITION_CHECKS=1 -DTYPE_SAFE_ENABLE_WRAPPER=1 -Dcppast_EXPORTS -I/home/cnihelton/Dev/2_Tools/standardese/external/cppast/src/../include -I/home/cnihelton/Dev/2_Tools/standardese/external/cppast/src/SYSTEM -I/home/cnihelton/Dev/2_Tools/standardese/build/_deps/type_safe-src/include -I/home/cnihelton/Dev/2_Tools/standardese/build/_deps/type_safe-src/external/debug_assert -I/home/cnihelton/Dev/2_Tools/standardese/external/cppast/external/tpl -I/usr/lib/llvm-15/include -frecord-gcc-switches -O2 -g -DNDEBUG -fPIC -pedantic-errors -Werror -Wall -Wextra -Wconversion -Wsign-conversion -MD -MT external/cppast/src/CMakeFiles/cppast.dir/libclang/function_parser.cpp.o -MF external/cppast/src/CMakeFiles/cppast.dir/libclang/function_parser.cpp.o.d -o external/cppast/src/CMakeFiles/cppast.dir/libclang/function_parser.cpp.o -c /home/cnihelton/Dev/2_Tools/standardese/external/cppast/src/libclang/function_parser.cpp
/home/cnihelton/Dev/2_Tools/standardese/external/cppast/src/libclang/function_parser.cpp:659:36: error: unqualified call to 'std::move' [-Werror,-Wunqualified-std-cast-call]
        builder.noexcept_condition(move(suffix.noexcept_condition));
                                   ^
                                   std::

I fixed adding the std:: namespace to that call and got it compiled till the end.