Bug 355632 - Compilation error on llvm < 3.6
Summary: Compilation error on llvm < 3.6
Status: RESOLVED NOT A BUG
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: 2015-11-20 09:35 UTC by Ivan Čukić
Modified: 2015-11-21 22:49 UTC (History)
1 user (show)

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


Attachments
Fix (891 bytes, patch)
2015-11-20 09:35 UTC, Ivan Čukić
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Čukić 2015-11-20 09:35:19 UTC
Created attachment 95615 [details]
Fix

InPlace is declared in a #if-endif, but used in a few places outside the ifs.

#if LLVM_VERSION_MAJOR == 3 && LLVM_VERSION_MINOR <= 6
    bool InPlace;
#endif

I've attached a fix that defines a SUPPORTS_IN_PLACE macro and uses it wherever InPlace is mentioned.
Comment 1 Sergio Martins 2015-11-20 11:00:47 UTC
Are you on llvm 3.5 ?
Comment 2 Ivan Čukić 2015-11-20 19:21:10 UTC
Yes, well, I was. I updated to 3.8 (trunk) after reporting this.

Anyhow - either ifdef all, or none and require a newer llvm - this way, it is confusing :)
Comment 3 Sergio Martins 2015-11-20 19:35:10 UTC
Git commit ef683ba410b2a6f20609700ca6915a28a434f1b4 by Sergio Martins.
Committed on 20/11/2015 at 19:34.
Pushed by smartins into branch 'master'.

Add comments to clarify why we define the InPlace member

M  +2    -0    Lazy.cpp

http://commits.kde.org/clazy/ef683ba410b2a6f20609700ca6915a28a434f1b4
Comment 4 Sergio Martins 2015-11-20 19:38:21 UTC
I think there's a misunderstanding.

bool InPlace is already defined with clang >= 3.7, only <= 3.6 doesn't have it.
Your patch would make "InPlace = inplace;" never run on clang 3.7
Comment 5 Sergio Martins 2015-11-21 10:14:58 UTC
Git commit 158738cb366383e8ef09703c509c0318cdd3f736 by Sergio Martins.
Committed on 21/11/2015 at 10:14.
Pushed by smartins into branch 'master'.

Unbreak build on clang 3.6

Forgot to comment comment

M  +1    -1    Lazy.cpp

http://commits.kde.org/clazy/158738cb366383e8ef09703c509c0318cdd3f736
Comment 6 Ivan Čukić 2015-11-21 22:49:10 UTC
Ok, I thought it was vice-versa. I'm closing since I'm unable to test with the original llvm version I had.