[cfe-users] clang-tidy bug?

2019-10-27 Thread Robert Ankeney via cfe-users
For the following code (wrong.cpp): bool check(bool isValid) { bool retVal = false; if (( isValid == true )) { retVal = true; } return retVal; } when I run: clang-tidy -checks=modernize-use-default-member-init wrong.cpp I get: 4 warnings and 1 error generated. E

Re: [cfe-users] clang-tidy bug?

2019-10-28 Thread David Blaikie via cfe-users
they added the extra parentheses. - Dave On Sun, Oct 27, 2019 at 11:32 AM Robert Ankeney via cfe-users < cfe-users@lists.llvm.org> wrote: > For the following code (wrong.cpp): > > bool check(bool isValid) > { > bool retVal = false; > > if (( isValid

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-30 Thread David Blaikie via cfe-users
I ran the test & understand it a bit better now - so the abort is part of the code, when the test fails, the test harness uses abort to fail. So this isn't "clang causes abort" (it didn't select a bad instruction, etc) this is "clang causes test failure" - this could be any number of things in ter

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-30 Thread David Blaikie via cfe-users
On Wed, Oct 30, 2019 at 2:29 PM Hans Åberg wrote: > Indeed, very hard to figure out. If it is some hidden undefined behavior > causing it, the UBSan should have caught it, but it does not. Right - but especially with numerics (especially floating point) there's loads of room for valid but diffe

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-30 Thread David Blaikie via cfe-users
On Wed, Oct 30, 2019 at 4:25 PM Hans Åberg wrote: > > > On 30 Oct 2019, at 23:50, David Blaikie wrote: > > > >> On Wed, Oct 30, 2019 at 2:29 PM Hans Åberg wrote: > >> Indeed, very hard to figure out. If it is some hidden undefined > behavior causing it, the UBSan should have caught it, but it d

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-30 Thread David Blaikie via cfe-users
On Wed, Oct 30, 2019 at 5:36 PM Hans Åberg wrote: > > > > On 31 Oct 2019, at 00:28, David Blaikie wrote: > > > > > > > > On Wed, Oct 30, 2019 at 4:25 PM Hans Åberg wrote: > > > >> I believe that GMP is just using integer types, and then uses that to > make multiprecision integers, rational numb

Re: [cfe-users] clang-tidy bug?

2019-10-30 Thread David Blaikie via cfe-users
The use of extra () to suppress the >> assignment-in-conditional warning (-Wparentheses) has been around for quite >> a while, so it's possible that the user intended assignment rather than >> comparison when they added the extra parentheses. >> >> - Dave >> &

[cfe-users] Clang compilation options to solve the comaptible issue?

2019-10-31 Thread Guofeng Zhang via cfe-users
Hi, I just stat using clang 8 not long ago. I need to compile our old c++ source without changing it. It is compiled with Visual Studio before. Now I want to migrate to clang as the compiler. The following code segement can be compiled by clang: 1) for (int i = 0 ; i < 6 ; i++ ) {

Re: [cfe-users] clang-tidy bug?

2019-10-31 Thread Aaron Ballman via cfe-users
;>> possible suggestions. >>> >>> But the existence of the suggestion (without the application of it) to the >>> user seems right to me. The use of extra () to suppress the >>> assignment-in-conditional warning (-Wparentheses) has been around for quite

Re: [cfe-users] clang-tidy bug?

2019-10-31 Thread David Blaikie via cfe-users
you objecting to the suggestion, or that it was automatically > applied? I would think it'd be a bug to apply any fixit/hint if there are > multiple possible suggestions. > >>> > >>> But the existence of the suggestion (without the application of it) to >

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-31 Thread David Blaikie via cfe-users
On Thu, Oct 31, 2019 at 2:30 AM Hans Åberg wrote: > > > On 31 Oct 2019, at 01:53, David Blaikie wrote: > > > >> Yes, but assuming that the GMP adheres to the C standard, there should > be no difference in the arithmetical values produced. > > > > Not necessarily - C (well, I don't know the C sta

Re: [cfe-users] clang-tidy bug?

2019-10-31 Thread Aaron Ballman via cfe-users
t;> >>> >> >>> Are you objecting to the suggestion, or that it was automatically >> >>> applied? I would think it'd be a bug to apply any fixit/hint if there >> >>> are multiple possible suggestions. >> >>&

Re: [cfe-users] clang-tidy bug?

2019-10-31 Thread David Blaikie via cfe-users
n the command line you gave didn't seem to modify the > file for me, did it modify the file for you? > >> >>> > >> >>> Are you objecting to the suggestion, or that it was automatically > applied? I would think it'd be a bug to apply any fixit/hi

Re: [cfe-users] clang-tidy bug?

2019-10-31 Thread Aaron Ballman via cfe-users
if conditionals. If anything, I would think a suggestion of "if >> >> >> (true == isValid)" would be more appropriate. >> >> >> >> >> >> Thanks for the feedback! >> >> >> Robert >> >> >> >>

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-31 Thread David Blaikie via cfe-users
On Thu, Oct 31, 2019 at 12:00 PM Hans Åberg wrote: > > > On 31 Oct 2019, at 18:40, David Blaikie wrote: > > > >> Right, but that is something one would avoid when computing > arithmetical results. > > > > One would try to, yes - but that's sort of what the whole discussion is > resolving around:

Re: [cfe-users] Clang9 UBSan and GMP

2019-10-31 Thread David Blaikie via cfe-users
On Thu, Oct 31, 2019 at 1:51 PM Hans Åberg wrote: > > > On 31 Oct 2019, at 21:40, David Blaikie wrote: > > > >> On Thu, Oct 31, 2019 at 12:00 PM Hans Åberg wrote: > >> > >> > On 31 Oct 2019, at 18:40, David Blaikie wrote: > >> > > >> >> Right, but that is something one would avoid when computi

[cfe-users] does clang support option like MSVC's /Zc:forScope-

2019-10-31 Thread Guofeng Zhang via cfe-users
Hi, In early versions of C++, the scope of a variable defined in a for loop header extended to the end of the block containing the loop. Is there way for clang to compile this old source? Thanks, Guofeng ___ cfe-users mailing list cfe-users@lists.llvm

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-01 Thread Hans Åberg via cfe-users
> On 31 Oct 2019, at 18:40, David Blaikie wrote: > >> Right, but that is something one would avoid when computing arithmetical >> results. > > One would try to, yes - but that's sort of what the whole discussion is > resolving around: Is the code correct? I don't know. I wouldn't assume it is

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-01 Thread Hans Åberg via cfe-users
> On 31 Oct 2019, at 21:40, David Blaikie wrote: > >> On Thu, Oct 31, 2019 at 12:00 PM Hans Åberg wrote: >> >> > On 31 Oct 2019, at 18:40, David Blaikie wrote: >> > >> >> Right, but that is something one would avoid when computing arithmetical >> >> results. >> > >> > One would try to, yes

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-01 Thread Hans Åberg via cfe-users
Indeed, very hard to figure out. If it is some hidden undefined behavior causing it, the UBSan should have caught it, but it does not. The link that Matthew gave says that the GMP developers experienced a number of such issues with Clang. One can though turn off the optimizer, and the tests pass

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-01 Thread Hans Åberg via cfe-users
> On 31 Oct 2019, at 01:53, David Blaikie wrote: > >> Yes, but assuming that the GMP adheres to the C standard, there should be no >> difference in the arithmetical values produced. > > Not necessarily - C (well, I don't know the C standard as well as I know the > C++ standard, admittedly) do

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-01 Thread Hans Åberg via cfe-users
> On 31 Oct 2019, at 00:28, David Blaikie wrote: > > > > On Wed, Oct 30, 2019 at 4:25 PM Hans Åberg wrote: > >> I believe that GMP is just using integer types, and then uses that to make >> multiprecision integers, rational numbers, and floating point numbers. At >> least MPFR uses only t

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-01 Thread Hans Åberg via cfe-users
> On 30 Oct 2019, at 23:50, David Blaikie wrote: > >> On Wed, Oct 30, 2019 at 2:29 PM Hans Åberg wrote: >> Indeed, very hard to figure out. If it is some hidden undefined behavior >> causing it, the UBSan should have caught it, but it does not. >> > Right - but especially with numerics (espec

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-01 Thread Hans Åberg via cfe-users
> On 31 Oct 2019, at 22:07, David Blaikie wrote: > >> On Thu, Oct 31, 2019 at 1:51 PM Hans Åberg wrote: >> >> > On 31 Oct 2019, at 21:40, David Blaikie wrote: >> > >> >> On Thu, Oct 31, 2019 at 12:00 PM Hans Åberg wrote: >> >> >> >> > On 31 Oct 2019, at 18:40, David Blaikie wrote: >> >> >

[cfe-users] clang-format single line if

2019-11-01 Thread Michael Pozulp via cfe-users
If I build clang-format from tip of master and run it using this .clang-format file AllowShortIfStatementsOnASingleLine: Always it will change this single line if statement if (x) { x++; } into this three line if statement if (x) { x++; } How do I keep it as one line? If I delete

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-01 Thread Matthew Fernandez via cfe-users
> On Oct 31, 2019, at 14:30, Hans Åberg via cfe-users > wrote: > >> >> On 31 Oct 2019, at 22:07, David Blaikie wrote: >> >>> On Thu, Oct 31, 2019 at 1:51 PM Hans Åberg wrote: >>> >>>> On 31 Oct 2019, at 21:40, David Blaikie wrote:

Re: [cfe-users] Clang compilation options to solve the comaptible issue?

2019-11-03 Thread Richard Smith via cfe-users
On Thu, 31 Oct 2019 at 01:45, Guofeng Zhang via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > > I just stat using clang 8 not long ago. I need to compile our old c++ > source without changing it. It is compiled with Visual Studio before. Now I > want to migrate to

[cfe-users] Why is clang defining NULL as __null ??

2019-11-04 Thread pendyala syam via cfe-users
I have a .cpp file which has usage of *NULL* at several places. When I try to compile this cpp file for Android/x86 platform using clang++ on Windows machine + standalone tool chain, I am running into "expected expression" error at the places where *NULL* is used. I find the definition of *NULL* in

Re: [cfe-users] Why is clang defining NULL as __null ??

2019-11-04 Thread David Blaikie via cfe-users
what flags you might be passing, or why else it might be having trouble with __null, unfortunately. On Mon, Nov 4, 2019 at 9:15 AM pendyala syam via cfe-users < cfe-users@lists.llvm.org> wrote: > I have a .cpp file which has usage of *NULL* at several places. When I > try to compile

[cfe-users] Recipe for cross compiling from x86 to AArch64?

2019-11-06 Thread Itaru Kitayama via cfe-users
Hi, Following instructions written at: https://llvm.org/docs/HowToCrossCompileLLVM.html ends up with: [ 57%] Building arm_neon.h... /bin/sh: ../../../../bin/clang-tblgen: cannot execute binary file make[2]: *** [tools/clang/lib/Headers/arm_neon.h] Error 126 make[1]: *** [tools/clang/lib/Headers/C

Re: [cfe-users] [cfe-dev] clang-format single line if

2019-11-06 Thread Michael Pozulp via cfe-users
Done. https://bugs.llvm.org/show_bug.cgi?id=43913 On Mon, Nov 4, 2019 at 3:36 AM MyDeveloper Day wrote: > Could I ask you to log a defect over in https://bugs.llvm.org to this > effect, The examples using AllowShortIfStatementsOnASingleLine don't > include braces > > MyDeveloperDay > > On Sun,

Re: [cfe-users] [cfe-dev] clang-format single line if

2019-11-06 Thread MyDeveloper Day via cfe-users
Could I ask you to log a defect over in https://bugs.llvm.org to this effect, The examples using AllowShortIfStatementsOnASingleLine don't include braces MyDeveloperDay On Sun, Nov 3, 2019 at 8:51 PM Michael Pozulp via cfe-dev < cfe-...@lists.llvm.org> wrote: > If I build clang-format from tip

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-06 Thread Hans Åberg via cfe-users
> On 2 Nov 2019, at 02:36, Matthew Fernandez > wrote: > >> Both GCC and Clang can be conveniently installed using MacPorts. The Apple >> inhouse clang is weird. > > I haven’t followed the rest of this thread closely, but do you have a > reference for the GMP developers abandoning Clang on ma

[cfe-users] Support for specific Java versions

2019-11-06 Thread Ahmet Bilgin via cfe-users
Hi, currently I'm looking for a Java SourceCode formatter which can be integrated into the Eclipse-IDE and also run as standalone application. The development department of my company needs a fixed source code formatting, as we experienced formatter changes during every Eclipse-IDE update. We

Re: [cfe-users] Clang compilation options to solve the comaptible issue?

2019-11-06 Thread Guofeng Zhang via cfe-users
I just saw the mail today. It archived by gmail in the Sent folder. Thanks for the helpful response. On Mon, Nov 4, 2019 at 1:48 AM Richard Smith wrote: > On Thu, 31 Oct 2019 at 01:45, Guofeng Zhang via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> Hi, >> >&

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-07 Thread Hans Wennborg via cfe-users
scratch. Maybe the fix is to reinstate that code, or also comment out or remove the code that accesses scratch? Thanks, Hans On Sat, Oct 26, 2019 at 12:14 AM David Blaikie via cfe-users wrote: > > Yeah, coming across compiler bugs does happen - but more often it's bugs in > input progra

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-07 Thread David Blaikie via cfe-users
UBSan doesn't cover this sort of thing - MSan is the sanitizer for catching uninitialized values. (MSan is, unfortunately, a bit more finicky to use because the whole program (including the standard library) must be compiled with the feature enabled for it to work correctly - I don't have an MSan e

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-07 Thread David Blaikie via cfe-users
Looks like valgrind catches some things around here: ==115793== Conditional jump or move depends on uninitialised value(s) ==115793==at 0x402671: main (t-sqrlo.c:106) ==115793== ==115793== Conditional jump or move depends on uninitialised value(s) ==115793==at 0x40268A: main (t-sqrlo.c:107

[cfe-users] error: inline function '_BitScanForward' is not defined

2019-11-07 Thread pendyala syam via cfe-users
Hi Team, While compiling my source cpp file which is including intrin.h, clang is throwing the following error error: inline function '_BitScanForward' is not defined [-Werror,-Wundefined -inline] _BitScanForward ( I checked clang headers for definition but in clang intrin.h header file its jus

Re: [cfe-users] Clang9 UBSan and GMP

2019-11-09 Thread Hans Åberg via cfe-users
> On 7 Nov 2019, at 15:24, Hans Wennborg wrote: > > Looking at LLVM's -print-after-all shows a diff after GVN which seems > to come from this if-statement in tests/mpn/t-sqrlo.c: > > if (pp[-1] != p_before || pp[n] != p_after > || scratch[-1] != s_before || scratch[itch] != s_after > ||

[cfe-users] dumb question about record-command-line

2019-11-19 Thread Jerry Scharf via cfe-users
Hi, I have an exceeding dumb question. If I turn on -frecord-command-line, how do I view it in the object files, libraries and executables? No matter what I incant to google, it only wants to tell me what the command line arguments are. thanks in advance, jerry ___

Re: [cfe-users] dumb question about record-command-line

2019-11-19 Thread David Blaikie via cfe-users
c) to dump the contents of that section. On Tue, Nov 19, 2019 at 8:44 AM Jerry Scharf via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > > I have an exceeding dumb question. > > If I turn on -frecord-command-line, how do I view it in the object > files, libraries and

Re: [cfe-users] dumb question about record-command-line

2019-11-19 Thread Jerry Scharf via cfe-users
for anyone who happens upon this, the incantation is llvm-readobj -p .GCC.command.line filename (you can use llvm-readelf or readelf with the same args as well) jerry On 11/19/19 11:39 AM, David Blaikie wrote: Depends on your platform, but probably in some section or another in the object/exe

[cfe-users] Is it possible to translate or forward flags from clang to llc?

2019-11-27 Thread Massimiliano Culpo via cfe-users
Hi, I'm looking into what could be the best way to add compiler flags for Clang to emit optimized code for a specific chip on a given architecture. Looking at various sources I saw that: - llc -march= -mcpu=help returns the list of the supported cpus which is already helpful. The piece of in

Re: [cfe-users] How to have clang ignore gch directories?

2019-11-27 Thread Paul Smith via cfe-users
On Thu, 2019-04-25 at 18:53 -0400, Paul Smith via cfe-users wrote: > On Thu, 2019-04-25 at 14:38 -0700, Richard Smith wrote: > > > How can I tell clang to just ignore the GCC-specific precompiled > > > headers, or equivalently ignore precompiled headers altogether? I >

[cfe-users] DeclRefExpr question

2019-12-03 Thread Robert Ankeney via cfe-users
Let's assume I have a DeclRefExpr that is referenceing some variable that is declared as "static const int var;". How can I determine the variable is static? There is no isStaticLocal() or getStorageClass() call as there would be for the VarDecl. Is there something within the QualType that gets me

Re: [cfe-users] DeclRefExpr question

2019-12-03 Thread David Blaikie via cfe-users
. On Tue, Dec 3, 2019 at 1:33 PM Robert Ankeney via cfe-users < cfe-users@lists.llvm.org> wrote: > Let's assume I have a DeclRefExpr that is referenceing some variable that > is declared as "static const int var;". How can I determine the variable is > static? Th

Re: [cfe-users] DeclRefExpr question

2019-12-03 Thread Robert Ankeney via cfe-users
hat's being referenced (could be a function, etc, > etc) then do whatever you want to do with that VarDecl. > > On Tue, Dec 3, 2019 at 1:33 PM Robert Ankeney via cfe-users < > cfe-users@lists.llvm.org> wrote: > >> Let's assume I have a DeclRefExpr that is referen

[cfe-users] got wrong parameter type using clang

2019-12-10 Thread henry ding via cfe-users
simple test.cpp: void test(std::string xx,string bb,int aa){} clang usage: int getFuncInfo(Rewriter* TheRewrite,clang::ASTContext *Context, const FunctionDecl *func,FuncNode &node){ clang::LangOptions LangOpts; LangOpts.CPlusPlus = true; Policy.FullyQualifiedName = 1; ..

Re: [cfe-users] got wrong parameter type using clang

2019-12-11 Thread Richard Smith via cfe-users
On Tue, 10 Dec 2019, 22:45 henry ding via cfe-users, < cfe-users@lists.llvm.org> wrote: > simple test.cpp: > void test(std::string xx,string bb,int aa){} > > clang usage: > int getFuncInfo(Rewriter* TheRewrite,clang::ASTContext *Context, const > FunctionDecl *func,Func

Re: [cfe-users] got wrong parameter type using clang

2019-12-12 Thread henry ding via cfe-users
l found there were a typedecl which typedef string as int, this may be the reason std::string|int|/usr/include/c++/4.8.5/bits/stringfwd.h 2019-12-12 2:13 GMT+08:00, Richard Smith : > On Tue, 10 Dec 2019, 22:45 henry ding via cfe-users, < > cfe-users@lists.llvm.org> wrote: > >

[cfe-users] Checking if a class can be copy constructed

2019-12-14 Thread Xuanyi Zhou via cfe-users
Hello, I’ve been trying to do some code generation using clang (not libclang), and want to find out if a class can be copy constructed. I’ve tried testing if the copy constructor is deleted, but this does not work well with templates. For example, I have a class that contains a std::vector, whose c

[cfe-users] Checking if a class can be copy constructed

2019-12-14 Thread Luke Zhou via cfe-users
Hello again! It seems that the system failed to extract text from my previous post. This is my first time using a mailing list, so please excuse me for my mistakes. Here are the original contents of that post: Hello, > > I’ve been trying to do some code generation using clang (not libclang), > and

[cfe-users] Checking if a class can be copy constructed

2019-12-16 Thread Luke Zhou via cfe-users
Hello, I’ve been trying to do some code generation using clang (not libclang), and want to find out if a class can be copy constructed. I’ve tried testing if the copy constructor is deleted, but this does not work well with templates. For example, I have a class that contains a std::vector, who

[cfe-users] Clang optimization options with out dead code elimination?

2019-12-19 Thread Guofeng Zhang via cfe-users
Hi, We use clang 8+. Does clang have options (not -O0) that do not remove dead code when clang optimize the code? We have a old project, now migrating to Clang. It works well with -O0, but failed when use -O1 to -O3. Thanks, Guofeng ___ cfe-users mail

Re: [cfe-users] Clang optimization options with out dead code elimination?

2019-12-19 Thread David Blaikie via cfe-users
izersn (address, memory, undefined behavior sanitizer) to help identify if there are bugs that could be fixed. On Thu, Dec 19, 2019 at 12:19 AM Guofeng Zhang via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > > We use clang 8+. Does clang have options (not -O0) that do not remove d

[cfe-users] Seg fault building with clang++ and -femulated-tls against gcc std lib

2020-01-14 Thread Dave Gittins via cfe-users
I am having a problem building on OSX with clang, against the gcc standard library (there are project constraints behind why I am doing this). I am using homebrew packages for both clang and gcc. This pattern worked fine until a recent gcc package upgrade and I would at least like to understand bet

Re: [cfe-users] Seg fault building with clang++ and -femulated-tls against gcc std lib

2020-01-14 Thread Dave Gittins via cfe-users
Update: I believe this is resolved by adding -lgcc_s.1 to the build command. (gcc does this automatically) So in case anyone else runs into this, here is my working build command to build with clang on OSX against the gcc 7.5 std lib: usr/local/Cellar/llvm@7/7.1.0_1/bin/clang++ -isystem /usr/loca

[cfe-users] Calling match in a clang-tidy check's check method

2020-01-15 Thread Lewis, Cannada via cfe-users
Is there a way to get a non const reference to the ASTContext inside of a clang tidy check? I have two reasons I want this. 1. To do matches on specific nodes like below. void MyCheck::check(const MatchFinder::MatchResult &Result) { auto const *Lambda = Result.Nodes.getNodeAs("Lambda

Re: [cfe-users] clangd --clang-tidy: // NOLINT only works sometimes

2020-01-26 Thread David Blaikie via cfe-users
+Sam in case he's got some thoughts or can rope in others who might. On Sun, Jan 26, 2020 at 1:03 PM tastytea via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > I recently started using clangd (9.0.1) with --clang-tidy. I noticed > that suppressing diagnostics only some

[cfe-users] Compiling Visual Studio 2017 headers with clang library

2020-01-28 Thread Jens Restemeier via cfe-users
Hi, I'm trying to resurrect an open source C++ reflection tool (https://github.com/Celtoys/clReflect ) against the latest clang. I've got everything building and the tool produces some output, though I've yet to analyse if the generated database is complete and correct. I'm trying to build wit

[cfe-users] Silencing errors in TSAN

2020-01-29 Thread Kyle Edwards via cfe-users
Hello all, I am attempting to build OpenMPI with TSAN enabled (to TSAN-itize a project that uses OpenMPI), and am finding that OpenMPI throws lots of errors in TSAN (not surprising.) I am attempting to build OpenMPI with the following blacklist: src:* However, I am still getting errors when I ru

Re: [cfe-users] clangd --clang-tidy: // NOLINT only works sometimes

2020-01-29 Thread Sam McCall via cfe-users
call). The inconsistency is a bug: filed https://github.com/clangd/clangd/issues/266 Cheers, Sam On Sun, Jan 26, 2020 at 10:15 PM David Blaikie wrote: > +Sam in case he's got some thoughts or can rope in others who might. > > On Sun, Jan 26, 2020 at 1:03 PM tastytea via cfe-users

Re: [cfe-users] Compiling Visual Studio 2017 headers with clang library

2020-02-01 Thread Jens Restemeier via cfe-users
Hi, I got this to work, so for the benefit of future people coming across this from Google: > I am getting > "C:/Program Files (x86)/Windows > Kits/10/Include/10.0.17763.0/ucrt\stdio.h(378,9): warning : macro expansion > producing 'defined' has undefined behavior > 2>#if _CRT_INTERNAL_NONS

[cfe-users] clang-tidy

2020-02-03 Thread Mario Charest via cfe-users
Hello, First post, be gentle ;-) I'm trying to find a clean solution to an error message that clang-tidy is giving, tried with 10 and 11) This is the code: struct Foo { Foo(const std::string &value) : m_name(value) {} Foo(std::string &&value) : m_name(std::move(value)) {} std::strin

Re: [cfe-users] clang-tidy

2020-02-05 Thread Chris Green via cfe-users
Hi, On 1/30/20 12:02 PM, Mario Charest via cfe-users wrote: Hello, First post, be gentle ;-) I'm trying to find a clean solution to an error message that clang-tidy is giving, tried with 10 and 11) This is the code: struct Foo {     Foo(const std::string &value) : m_name(value) {

Re: [cfe-users] Silencing errors in TSAN

2020-02-05 Thread Kyle Edwards via cfe-users
On Wed, 2020-02-05 at 19:30 +0100, JVApen wrote: > Hey Kyle, > > This is a bug in your code, if you have a context switch after the > creation of the thread on an overloaded system, the close of the pipe > can be closed while writing or even before it. > > Timing ain't a good way to synchronize t

Re: [cfe-users] clang-tidy

2020-02-05 Thread Mario Charest via cfe-users
Le mer. 5 févr. 2020 09 h 48, Chris Green a écrit : > Hi, > On 1/30/20 12:02 PM, Mario Charest via cfe-users wrote: > > Hello, > > First post, be gentle ;-) > > I'm trying to find a clean solution to an error message that clang-tidy is > giving, tried with

[cfe-users] How to check whether a type is_copy_assignable?

2020-02-06 Thread Weston Carvalho via cfe-users
HI, I'm trying to write a tool that uses the AST to look at all the class declarations in our codebase and get some metrics on our use of special member functions. (How many classes are copyable, how many have ctors without the corresponding assignment operator, etc.) I'm running into some problem

[cfe-users] is this compiller error

2020-02-07 Thread FRANČEK PRIJATELJ via cfe-users
/* Following code compiled with clang-cl on win10 generates 2 errors (while the same code compiled with MS cl compiles): t1.cpp(12,35): error: in-class initializer for static data member is not a constant expression     static const int64_t MIN_VALUE = -0x8000LL;   

Re: [cfe-users] is this compiller error

2020-02-12 Thread Richard Smith via cfe-users
On Fri, 7 Feb 2020 at 19:51, FRANČEK PRIJATELJ via cfe-users < cfe-users@lists.llvm.org> wrote: > /* > > Following code compiled with clang-cl on win10 generates 2 errors > (while the same code compiled with MS cl compiles): > > t1.cpp(12,35): error: in-class initializer f

[cfe-users] clang-cl pulls in random crap

2020-02-13 Thread Андрей Леликов via cfe-users
Hi everyone, a newbie question. I'm trying to build a "hello,world" application on windows. I have my own makefile and just changed cl.exe to clang-cl.exe. Anything fails to compile with an error like that: clang: warning: argument unused during compilation: '/arch:SSE2' [-Wunused-command-li

[cfe-users] How to determine if variable is templated?

2020-02-16 Thread Robert Ankeney via cfe-users
Suppose I have some code like: template Type tVar; function(tVar); How can I determine that tVar is templated from the VarDecl or a MemberExpr? I don't see any obvious function in QualType or Type. Thanks, Robert ___ cfe-users mailing list cfe-users@li

Re: [cfe-users] How to determine if variable is templated?

2020-02-17 Thread David Blaikie via cfe-users
Guessing these sort of functions would be relevant: https://clang.llvm.org/doxygen/classclang_1_1VarDecl.html#a617bcdd5baaab0ccba71a96cd9c2ed03 On Sun, Feb 16, 2020 at 5:43 PM Robert Ankeney via cfe-users < cfe-users@lists.llvm.org> wrote: > Suppose I have some code like: > >

[cfe-users] Clang-tidy lexer util issue.

2020-02-17 Thread Lewis, Cannada via cfe-users
I am trying to use the getPreviousToken function from clang-tools-extra/clang-tidy/utils

Re: [cfe-users] Clang-tidy lexer util issue.

2020-02-18 Thread Lewis, Cannada via cfe-users
I was able to solve my problem by making sure to get the expansion location before calling getPreviousToken. On Feb 17, 2020, at 5:42 PM, Lewis, Cannada mailto:canl...@sandia.gov>> wrote: I am trying to use the getPreviousToken function from clang-tools-extra

Re: [cfe-users] (no subject)

2020-02-18 Thread Andrey L via cfe-users
2. how can I disable it? To make sure that clang-cl.exe is a compiler, that takes options and input files from command line, and not from some hard-coded heuristics. Is it possible at all? On 18.02.2020 13:52, degski via cfe-users wrote: You need to install "the integration" (with

Re: [cfe-users] Need a GCC-free LLVM/Clang on Linux.

2020-02-19 Thread Richard Smith via cfe-users
On Thu, 23 Jan 2020 at 07:24, Christopher H Green via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > > I've spent the last several days trying to build a fast, full-featured > relocatable distribution of LLVM/Clang 9.0.1 on Linux RHEL7, which has an > older

Re: [cfe-users] How to check whether a type is_copy_assignable?

2020-02-19 Thread Richard Smith via cfe-users
On Thu, 6 Feb 2020 at 12:13, Weston Carvalho via cfe-users < cfe-users@lists.llvm.org> wrote: > HI, > > I'm trying to write a tool that uses the AST to look at all the class > declarations in our codebase and get some metrics on our use of special > member functi

Re: [cfe-users] How to check whether a type is_copy_assignable?

2020-02-20 Thread Weston Carvalho via cfe-users
m checking is an instantiation of a template class itself or if its copy constructor was templated? Thanks again for your help, Weston On Wed, Feb 19, 2020 at 2:49 PM Richard Smith wrote: > On Thu, 6 Feb 2020 at 12:13, Weston Carvalho via cfe-users < > cfe-users@lists.llvm.org> wrote:

Re: [cfe-users] cfe-users Digest, Vol 85, Issue 8

2020-02-20 Thread Robert Ankeney via cfe-users
lways see "Type" returned if I do a getUnqualifiedType().getAsString(). I had hoped for a simple function call, as these template parameters seem like generic types. Robert On Mon, Feb 17, 2020 at 11:58 AM via cfe-users wrote: > Send cfe-users mailing list submissions to >

Re: [cfe-users] How to determine if variable is templated?

2020-02-20 Thread David Blaikie via cfe-users
as I mentioned in the link previously - "getTemplateSpecializationKind" on the VarDecl should tell you if it's a template at all. At least I think that's how you'd go about it... - Dave On Sun, Feb 20, 2020 at 4:08 PM Robert Ankeney via cfe-users < cfe-users@lists.llvm

Re: [cfe-users] How to check whether a type is_copy_assignable?

2020-02-20 Thread Richard Smith via cfe-users
tantiations (or at least, we will have already triggered those instantiations when the answers weren't easy). If you instead want to know "would `a = b;` invoke a trivial assignment operator?" then determining that can involve evaluating arbitrary metaprogramming constructs, which can res

[cfe-users] Looking for specific revision

2020-03-06 Thread Mahmood Naderan via cfe-users
Hi The following command svn co http://llvm.org/svn/llvm-project/llvm/branches/release_39/ /home/mahmood/source/llvm-3.9 -q -r 301135 returns svn: E175002: REPORT of '/svn/llvm-project/!svn/vcc/default': Could not read response body: connection was closed by server (http://llvm.org) I want to

Re: [cfe-users] Looking for specific revision

2020-03-06 Thread Jan Korous via cfe-users
6736 Author: Xin Tong Date: Sun Apr 23 17:36:25 2017 + Correct grammar. NFC llvm-svn: 301135 HTH Jan > On Mar 6, 2020, at 4:00 AM, Mahmood Naderan via cfe-users > wrote: > > Hi > The following command > > svn co http://llvm.org/svn/llvm-project/llvm/branche

Re: [cfe-users] Looking for specific revision

2020-03-06 Thread Mahmood Naderan via cfe-users
36 > Author: Xin Tong > Date: Sun Apr 23 17:36:25 2017 + > > Correct grammar. NFC > > llvm-svn: 301135 > > HTH > > Jan > > On Mar 6, 2020, at 4:00 AM, Mahmood Naderan via cfe-users < > cfe-users@lists.llvm.org> wrote: > > Hi > The

Re: [cfe-users] Looking for specific revision

2020-03-07 Thread Mahmood Naderan via cfe-users
73132726736 >> Author: Xin Tong >> Date: Sun Apr 23 17:36:25 2017 +0000 >> >> Correct grammar. NFC >> >> llvm-svn: 301135 >> >> HTH >> >> Jan >> >> On Mar 6, 2020, at 4:00 AM, Mahmood Naderan via cfe-users < >

[cfe-users] Problem building llvm from source

2020-03-07 Thread Mahmood Naderan via cfe-users
Hi, I want to use a specific revision number and for the cmake command below cmake ~/codestitcher/source/llvm-3.9 -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=host -DLLVM_ENABLE_CXX1Y=ON -DLLVM_BUILD_TESTS=OFF -DLLVM_BINUTILS_INCDIR=~/codestitcher/source/binutils-2.30/include -DLLVM_BUILD_TO

Re: [cfe-users] Problem building llvm from source

2020-03-07 Thread David Blaikie via cfe-users
What make command did you run? On Sat, Mar 7, 2020 at 8:09 AM Mahmood Naderan via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > I want to use a specific revision number and for the cmake command below > > cmake ~/codestitcher/source/llvm-3.9 -DCMAKE_

Re: [cfe-users] Problem building llvm from source

2020-03-07 Thread Mahmood Naderan via cfe-users
>What make command did you run? make -j2 Regards, Mahmood ___ cfe-users mailing list cfe-users@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users

Re: [cfe-users] Problem building llvm from source

2020-03-07 Thread Mahmood Naderan via cfe-users
I am looking for a way to stop LLVM of SVN from version checking. I haven't found that. I hope there is a way to that. Even using -DLLVM_APPEND_VC_REV=OFF doesn't fix the problem. Regards, Mahmood On Sat, Mar 7, 2020 at 11:13 PM Mahmood Naderan wrote: > >What make command did you run? > > m

Re: [cfe-users] Need a GCC-free LLVM/Clang on Linux.

2020-03-09 Thread Chris Green via cfe-users
Hi, Many thanks for this advice. I'm just now getting back to this. If I solve the libgcc_s problem, I'll let you know. Thanks again, Chris. On 2/19/20 4:02 PM, Richard Smith wrote: On Thu, 23 Jan 2020 at 07:24, Christopher H Green via cfe-users mailto:cfe-users@lists.llvm.o

Re: [cfe-users] Need a GCC-free LLVM/Clang on Linux.

2020-03-10 Thread Chris Green via cfe-users
Hi, On 2/19/20 4:02 PM, Richard Smith wrote: I have a two-stage setup that builds a GCC-free Clang except for libgcc_s (I've not looked at what's pulling that in yet, but I expect that's resolvable). My stage1 cmake setup has: -DCLANG_DEFAULT_CXX_STDLIB=libc++ -DCLANG_DEFAULT_RTLIB=compiler-

[cfe-users] Final C++20 rules and -Wambiguous-reversed-operator

2020-03-12 Thread Romain GEISSLER via cfe-users
Hi, It looks like the working of C++20 introduced some breaking compatibilities with some C++17 accepted patterns. From what I read in https://reviews.llvm.org/rL375306 these incompatibilities weren’t really intented by the initial C++20 proposal, and thus broken patterns were still allowed as

[cfe-users] Fail to build C++ module with Bazel

2020-03-12 Thread Wynand Pieterse via cfe-users
Hi all, trust all is well! I'm trying to build C++ modules using CLang and Bazel. I've created a special rule to compile modules, and inside the rule I've created two actions for the seperate steps of compiling the module to a precompiled file, and the second action builds the LLVM bitcode from th

Re: [cfe-users] Final C++20 rules and -Wambiguous-reversed-operator

2020-03-15 Thread Richard Smith via cfe-users
On Thu, 12 Mar 2020 at 15:14, Romain GEISSLER via cfe-users < cfe-users@lists.llvm.org> wrote: > Hi, > > It looks like the working of C++20 introduced some breaking > compatibilities with some C++17 accepted patterns. From what I read in > https://reviews.llvm.org/rL375306 th

Re: [cfe-users] [EXT] Final C++20 rules and -Wambiguous-reversed-operator

2020-03-19 Thread Richard Smith via cfe-users
On Thu, 19 Mar 2020 at 05:28, Romain GEISSLER wrote: > > Le 15 mars 2020 à 20:14, Richard Smith a écrit : > > > > No, we still don't have a resolution from the C++ committee, but it's > being discussed by various implementers, and we hope to present to the > committee a suggested set of changes

Re: [cfe-users] [EXT] Final C++20 rules and -Wambiguous-reversed-operator

2020-03-25 Thread Romain GEISSLER via cfe-users
> Le 15 mars 2020 à 20:14, Richard Smith a écrit : > > No, we still don't have a resolution from the C++ committee, but it's being > discussed by various implementers, and we hope to present to the committee a > suggested set of changes to minimize the pain to users as soon as we can. I > ex

[cfe-users] clang-9 (MacOS 10.13) linker crash and optimization issues

2020-03-25 Thread Artur Shepilko via cfe-users
Hello, First post on this mailing list...to report a crash-bug in clang-9.0.0 (x86_64-apple-darwin17.0.0) on MacOS 10.13 (High Sierra). The clang-9 was installed from the pre-built binary on llvm.org (not XCode). There're two related issues uncovered: 1) clang-9 ld64.lld crashed when trying to li

[cfe-users] clang and C++: exporting member function template from library using attribute visibility("default")

2020-03-30 Thread Alexis Murzeau via cfe-users
Hi, When using clang, I discovered that it errors out where other compilers doesn't (GCC and MSVC). I'm trying to do this: - Have a library compiled with -fvisibility=hidden and adding __attribute__((visibility("default"))) only for stuff that must be exported from the library .so. - Have

<    4   5   6   7   8   9   10   11   12   13   >