Bug 403083 - Build is broken with trunk Clang
Summary: Build is broken with trunk Clang
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: Sergio Martins
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-10 20:04 UTC by Eugene Zelenko
Modified: 2019-01-13 18:37 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 Eugene Zelenko 2019-01-10 20:04:37 UTC
src/checks/manuallevel/qrequiredresult-candidates.cpp:48:17: error: no member named
      'hasUnusedResultAttr' in 'clang::CXXMethodDecl'
Comment 1 Sergio Martins 2019-01-11 20:04:54 UTC
Git commit 07a54ffa240a9727095dc956b91987a08ddbc11a by Sergio Martins.
Committed on 11/01/2019 at 20:02.
Pushed by smartins into branch 'master'.

Try to fix build with clang trunk

I don't have trunk, but this should work.
Maybe some header missing. Reporter to test.

M  +23   -0    src/SourceCompatibilityHelpers.h
M  +1    -1    src/checks/manuallevel/qrequiredresult-candidates.cpp

https://commits.kde.org/clazy/07a54ffa240a9727095dc956b91987a08ddbc11a
Comment 2 Sergio Martins 2019-01-11 20:05:29 UTC
Please check if this works, if not, try to figure our what's the missing include or so :)
Comment 3 Eugene Zelenko 2019-01-12 02:08:42 UTC
Next changes must be made in SourceCompatibilityHelpers.h to compile Clazy:

#include <clang/AST/Attr.h>

By the word, headers should be sorted alphabetically.

-if (const EnumDecl *ED = ET->getDecl()) {
+if (const clang::EnumDecl *ED = ET->getDecl()) {

-return clang::getAttr<clang::WarnUnusedResultAttr>() != nullptr;
+return func->getAttr<clang::WarnUnusedResultAttr>() != nullptr;
Comment 4 Sergio Martins 2019-01-13 18:37:11 UTC
Git commit 86dc9018a0d49ab1f22ff40c1ecae446f07b1ece by Sergio Martins.
Committed on 13/01/2019 at 18:31.
Pushed by smartins into branch 'master'.

Finish fixing build with trunk

Eugene tested

M  +5    -4    src/SourceCompatibilityHelpers.h

https://commits.kde.org/clazy/86dc9018a0d49ab1f22ff40c1ecae446f07b1ece