Bug 425822 - 1.7 version does not compile with LLVM/clang-11.x
Summary: 1.7 version does not compile with LLVM/clang-11.x
Status: RESOLVED FIXED
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-26 09:15 UTC by Tomasz Paweł Gajc
Modified: 2020-11-24 12:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Paweł Gajc 2020-08-26 09:15:59 UTC
SUMMARY
1.7 version does not compile with LLVM/clang-11.x

STEPS TO REPRODUCE
1. set LLVM/clang-11.x as default compiler
2. try to compile clazy-1.7
3. observe error

OBSERVED RESULT
Full logs can be found here https://abf.openmandriva.org/build_lists/817596

[1/107] Building CXX object CMakeFiles/ClazyPlugin.dir/src/checks/manuallevel/tr-non-literal.cpp.o
FAILED: CMakeFiles/ClazyPlugin.dir/src/checks/manuallevel/tr-non-literal.cpp.o 
/usr/bin/clang++ -DCLAZY_DISABLE_AST_MATCHERS -DClazyPlugin_EXPORTS -DHAVE_CLANG_CONFIG_H -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I. -I../ -I../src -Os -fomit-frame-pointer -g1 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -m64 -mtune=generic -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fno-exceptions -fno-rtti -fPIC -Os -fomit-frame-pointer -g1 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-all --param=ssp-buffer-size=4 -m64 -mtune=generic -MD -MT CMakeFiles/ClazyPlugin.dir/src/checks/manuallevel/tr-non-literal.cpp.o -MF CMakeFiles/ClazyPlugin.dir/src/checks/manuallevel/tr-non-literal.cpp.o.d -o CMakeFiles/ClazyPlugin.dir/src/checks/manuallevel/tr-non-literal.cpp.o -c ../src/checks/manuallevel/tr-non-literal.cpp
In file included from ../src/checks/manuallevel/tr-non-literal.cpp:23:
In file included from ../src/checks/manuallevel/tr-non-literal.h:26:
In file included from ../src/checkbase.h:28:
In file included from ../src/clazy_stl.h:26:
In file included from /usr/include/clang/AST/Stmt.h:16:
In file included from /usr/include/clang/AST/DeclGroup.h:16:
In file included from /usr/include/llvm/Support/TrailingObjects.h:50:
In file included from /usr/include/llvm/Support/Alignment.h:24:
In file included from /usr/include/llvm/ADT/Optional.h:20:
/usr/include/llvm/Support/type_traits.h:31:28: error: no template named 'remove_reference_t' in namespace 'std'; did you mean 'remove_reference'?
  using UnderlyingT = std::remove_reference_t<T>;
                      ~~~~~^
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/10.2.0/../../../../include/c++/10.2.0/type_traits:1593:12: note: 'remove_reference' declared here
    struct remove_reference
           ^

EXPECTED RESULT
No errors

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: OpenMandriva Lx Cooker
(available in About System)
KDE Plasma Version: 5.19.4
KDE Frameworks Version: 5.73
Qt Version: 5.15.0

ADDITIONAL INFORMATION
Comment 1 Sergio Martins 2020-10-14 14:48:04 UTC
commit 1f2f7f47bc9a5bce6e3eaabbef8743f0617bc015 (HEAD -> master, origin/master)
Author: Sergio Martins <smartins@kde.org>
Date:   Wed Oct 14 15:47:13 2020 +0100

    Fix build with llvm-11
Comment 2 Tomasz Paweł Gajc 2020-11-24 11:30:30 UTC
Hi, ive added your commit to clazy-1.8 build. Still same error:
https://abf.openmandriva.org/build_lists/917634
/usr/include/llvm/Support/type_traits.h:31:28: error: no template named 'remove_reference_t' in namespace 'std'; did you mean 'remove_reference'?
  using UnderlyingT = std::remove_reference_t<T>;
                      ~~~~~^

https://github.com/OpenMandrivaAssociation/clazy/commit/0a749bf7fd51cce3006737bba22a0fa5acd727a6
Comment 3 Sergio Martins 2020-11-24 11:47:45 UTC
if you copy that compiler invocation line, but replace -std=c++11 with -std=c++14 , does it work ?
Comment 4 Tomasz Paweł Gajc 2020-11-24 12:45:53 UTC
Sorry for the noise.
After proper update to 1.8 version things are compiling without errors.