[lldb-dev] C++11 in LLDB source code.

Colin Riley colin at codeplay.com
Thu Feb 13 11:35:44 PST 2014


Annoyingly the compiler that ships with Visual Studio 2013 is labelled MSVC 2012, always seems to be out by one :) 

We are certainly using the windows build extensively with this compiler, so would rather it remained the lowest common denominator for adoption of c++11 features in the lldb code.

Colin


-----Original Message-----
From: "Todd Fiala" <tfiala at google.com>
Sent: ‎13/‎02/‎2014 18:15
To: "Greg Clayton" <gclayton at apple.com>
Cc: "lldb-dev" <lldb-dev at cs.uiuc.edu>
Subject: Re: [lldb-dev] C++11 in LLDB source code.

MSVC has a 2013 compiler.  I believe there are some C++ language improvements in it as well.



On Thu, Feb 13, 2014 at 10:12 AM, Greg Clayton <gclayton at apple.com> wrote:


On Feb 13, 2014, at 8:56 AM, Jean-Daniel Dupas <devlists at shadowlab.org> wrote:

> Hello LLDB community,
>
> I'm actually working on a thankless task which is to try to review most warnings produced by clang and other static code analyzer when almost all warnings are enabled in LLDB code base.
>
> And I did found a lot of place where latent bug could be fixed by using C++11 features, the most notable bugs are the one about member initialization which can be solve either by explicitly using compiler generated copy constructor and operators (Constructor() = default;) or simply by using member initialization in declaration construct.
>
> class Foo {
>
> private:
>    int m_flag = 0;
> };
>
> An other big source of latent bugs in LLDB source code are unexpected fall though in switch statements.
> This kind of issue can be spotted and solved by enabling the proper warning in clang and annotating expected fall through using the C++11 attribute [[clang::fallthrough]]
>
> So I have a simple question.
> I see that LLDB already relies on many C++11 constructs (shared_ptr, for loop, …), so what are the acceptables C++11 features that can be used in LLDB, or to say it another way, what compiler LLDB is expected to support ?


The only limits we need to stick to are making sure we don't break any existing buildbots, or the windows MSVC build with the latest MSVC release. Some platforms have more complete C++11 support, but we should at least shoot for:

- current clang compiler
- gcc 4.8.2 and later
- MSVC 2012 and later (I believe this is the latest?)

Greg



_______________________________________________
lldb-dev mailing list
lldb-dev at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev






-- 

Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140213/7b9d1974/attachment.html>


More information about the lldb-dev mailing list