- Mar 21, 2016
-
-
Faisal Vali authored
Implement lambda capture of *this by copy. For e.g.: struct A { int d = 10; auto foo() { return [*this] (auto a) mutable { d+=a; return d; }; } }; auto L = A{}.foo(); // A{}'s lifetime is gone. // Below is still ok, because *this was captured by value. assert(L(10) == 20); assert(L(100) == 120); If the capture was implicit, or [this] (i.e. *this was captured by reference), this code would be otherwise undefined. Implementation Strategy: - amend the parser to accept *this in the lambda introducer - add a new king of capture LCK_StarThis - teach Sema::CheckCXXThisCapture to handle by copy captures of the enclosing object (i.e. *this) - when CheckCXXThisCapture does capture by copy, the corresponding initializer expression for the closure's data member direct-initializes it thus making a copy of '*this'. - in codegen, when assigning to CXXThisValue, if *this was captured by copy, make sure it points to the corresponding field member, and not, unlike when captured by reference, what the field member points to. - mark feature as implemented in svn Much gratitude to Richard Smith for his carefully illuminating reviews! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263921 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 20, 2016
-
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263896 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263895 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 09, 2016
-
-
Aaron Ballman authored
Implement support for [[maybe_unused]] in C++1z that is based off existing support for unused, and treat it as an extension pre-C++1z. This also means extending the existing unused attribute so that it can be placed on an enum and enumerator, in addition to the other subjects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263025 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 08, 2016
-
-
Richard Smith authored
P0017R1: In C++1z, an aggregate class can have (public non-virtual) base classes; these are initialized as if they were data members. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262963 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262889 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
exactly the same as clang's existing [[clang::fallthrough]] attribute, which has been updated to have the same semantics. The one significant difference is that [[fallthrough]] is ill-formed if it's not used immediately before a switch label (even when -Wimplicit-fallthrough is disabled). To support that, we now build a CFG of any function that uses a '[[fallthrough]];' statement to check. In passing, fix some bugs with our support for statement attributes -- in particular, diagnose their use on declarations, rather than asserting. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262881 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 07, 2016
-
-
Aaron Ballman authored
Implement support for [[nodiscard]] in C++1z that is based off existing support for warn_unused_result, and treat it as an extension pre-C++1z. This also means extending the existing warn_unused_result attribute so that it can be placed on an enum as well as a class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262872 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Mar 04, 2016
-
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262747 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262743 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 19, 2016
-
-
Nico Weber authored
C++11 requires const objects to have a user-provided constructor, even for classes without any fields. DR 253 relaxes this to say "If the implicit default constructor initializes all subobjects, no initializer should be required." clang is currently the only compiler that implements this C++11 rule, and e.g. libstdc++ relies on something like DR 253 to compile in newer versions. This change makes it possible to build code that says `const vector<int> v;' again when using libstdc++5.2 and _GLIBCXX_DEBUG (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60284). Fixes PR23381. http://reviews.llvm.org/D16552 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261297 91177308-0d34-0410-b5e6-96231b3b80d8
-
Nico Weber authored
Created by: cd www curl -O http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_index.html ./make_cxx_dr_status git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261295 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 18, 2016
-
-
Yury Gribov authored
to force debug build and hopefully enable more precise warnings. Static Analyzer is much more efficient when built in debug mode (-UNDEBUG) so we advice users to enable it manually. This may be inconvenient in case of large complex projects (think about Linux distros e.g. Android or Tizen). This patch adds a flag to scan-build which inserts -UNDEBUG automatically. Differential Revision: http://reviews.llvm.org/D16200 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261204 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 10, 2016
-
-
Mandeep Singh Grang authored
Reviewers: weimingz Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D17085 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260433 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 09, 2016
-
-
Richard Smith authored
Update documentation to reflect that libc++abi provides __cxa_thread_atexit (and has for quite a while). Also document that we have not yet implemented the new inheriting constructor rules. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260311 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 06, 2016
-
-
Devin Coughlin authored
This is not the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259969 91177308-0d34-0410-b5e6-96231b3b80d8
-
Devin Coughlin authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259967 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Feb 01, 2016
-
-
David Majnemer authored
We implemented this DR back in r258768 but forgot to mark it as implemented. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259335 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 30, 2016
-
-
Alexey Samsonov authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259278 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Jan 13, 2016
-
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257698 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257695 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hans Wennborg authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257652 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 16, 2015
-
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255727 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255726 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255723 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Dec 10, 2015
-
-
Justin Bogner authored
Since the instructions use cmake, we should probably refer to the cmake flags and not the configure ones. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255297 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 26, 2015
-
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254123 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254122 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 25, 2015
-
-
Richard Smith authored
We will still allow it in system headers, in macros from system headers, when combined with an 'asm' label, and under the flag -Wno-register. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254097 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 12, 2015
-
-
Richard Smith authored
DR407, the C++ standard doesn't really say how this should work. Here's what we do (which is consistent with DR407 as far as I can tell): * When performing name lookup for an elaborated-type-specifier, a tag declaration hides a typedef declaration that names the same type. * When performing any other kind of lookup, a typedef declaration hides a tag declaration that names the same type. In any other case where lookup finds both a typedef and a tag (that is, when they name different types), the lookup will be ambiguous. If lookup finds a tag and a typedef that name the same type, and finds anything else, the lookup will always be ambiguous (even if the other entity would hide the tag, it does not also hide the typedef). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252959 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 11, 2015
-
-
Richard Smith authored
std::initializer_list<T> type. Instead, the list must contain a single element and the type is deduced from that. In Clang 3.7, we warned by default on all the cases that would change meaning due to this change. In Clang 3.8, we will support only the new rules -- per the request in N3922, this change is applied as a Defect Report against earlier versions of the C++ standard. This change is not entirely trivial, because for lambda init-captures we previously did not track the difference between direct-list-initialization and copy-list-initialization. The difference was not previously observable, because the two forms of initialization always did the same thing (the elements of the initializer list were always copy-initialized regardless of the initialization style used for the init-capture). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252688 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 09, 2015
-
-
Jonathan Roelofs authored
http://reviews.llvm.org/D14403 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252474 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Nov 05, 2015
-
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252223 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252216 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252215 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252214 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 29, 2015
-
-
Ehsan Akhgari authored
DXR is a project developed at Mozilla that implements a code indexing and browsing utility on top of libclang that has features such as call graph querying. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251638 91177308-0d34-0410-b5e6-96231b3b80d8
-
Devin Coughlin authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251591 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Oct 27, 2015
-
-
Anna Zaks authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251448 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 18, 2015
-
-
Jordan Rose authored
The content at the new links is /also/ a little dated, but that's our (Apple's) problem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247999 91177308-0d34-0410-b5e6-96231b3b80d8
-