Commit Graph

1475 Commits

Author SHA1 Message Date
Alexander Lanin e5a56f2d50 Remove outdated svn/git information from hacking page
The patch files section is redundant to https://llvm.org/docs/GettingStarted.html.
There is nothing clang specific here. We are talking about a monorepo after all.
While it may seem nice to have one single clang page which explains everything,
it's not: It doesn't cover the topics in sufficient depth, it's redundant to
other pages and it's hard to keep it up to date as we see with the svn
instructions.
2020-01-03 14:13:40 -05:00
David Blaikie d8018233d1 Revert "CWG2352: Allow qualification conversions during reference binding."
This reverts commit de21704ba9.

Regressed/causes this to error due to ambiguity:

  void f(const int * const &);
  void f(int *);
  int main() {
    int * x;
    f(x);
  }

(in case it's important - the original case where this turned up was a
member function overload in a class template with, essentially:

  f(const T1&)
  f(T2*)

(where T1 == X const *, T2 == X))

It's not super clear to me if this ^ is expected behavior, in which case
I'm sorry about the revert & happy to look into ways to fix the original
code.
2019-12-27 12:27:20 -08:00
Sylvestre Ledru 7ece0ee3dd features.html: Remove some old info 2019-12-21 10:52:39 +01:00
Sylvestre Ledru a0ce615573 clang is now under the apache2 license 2019-12-21 10:52:30 +01:00
Sylvestre Ledru 384a287a99 Remove a gcc 4.9 comparison as it doesn't make sense 2019-12-21 10:46:45 +01:00
Richard Smith de21704ba9 CWG2352: Allow qualification conversions during reference binding.
The language wording change forgot to update overload resolution to rank
implicit conversion sequences based on qualification conversions in
reference bindings. The anticipated resolution for that oversight is
implemented here -- we order candidates based on qualification
conversion, not only on top-level cv-qualifiers.

For OpenCL/C++, this allows reference binding between pointers with
differing (nested) address spaces. This makes the behavior of reference
binding consistent with that of implicit pointer conversions, as is the
purpose of this change, but that pre-existing behavior for pointer
conversions is itself probably not correct. In any case, it's now
consistently the same behavior and implemented in only one place.
2019-12-19 18:37:55 -08:00
Artem Dergachev b284005072 [analyzer] Add a syntactic security check for ObjC NSCoder API.
Method '-[NSCoder decodeValueOfObjCType:at:]' is not only deprecated
but also a security hazard, hence a loud check.

Differential Revision: https://reviews.llvm.org/D71728
2019-12-19 14:54:29 -08:00
Richard Smith df2e2ab07b Implement latest C++ feature test macro recommendations.
We don't yet advertise init capture packs, because I found some bugs
while testing it. We reject-valid and then crash on both of these:

template<int ...a> auto x = [...y = a] {};
template<int ...a> auto x = [y = a...] {};
2019-12-19 12:59:13 -08:00
Richard Smith f495de43bd [c++20] P1959R0: Remove support for std::*_equality. 2019-12-16 17:49:45 -08:00
Richard Smith 4b00299958 [c++20] Add deprecation warnings for the expression forms deprecated by P1120R0.
This covers:
 * usual arithmetic conversions (comparisons, arithmetic, conditionals)
   between different enumeration types
 * usual arithmetic conversions between enums and floating-point types
 * comparisons between two operands of array type

The deprecation warnings are on-by-default (in C++20 compilations); it
seems likely that these forms will become ill-formed in C++23, so
warning on them now by default seems wise.

For the first two bullets, off-by-default warnings were also added for
all the cases where we didn't already have warnings (covering language
modes prior to C++20). These warnings are in subgroups of the existing
-Wenum-conversion (except that the first case is not warned on if either
enumeration type is anonymous, consistent with our existing
-Wenum-conversion warnings).
2019-12-16 17:49:45 -08:00
Richard Smith bc633a42dd Mark the major papers for C++20 consistent comparisons as "done", and
start publishing the corresponding feature-test macro.
2019-12-15 22:20:06 -08:00
Richard Smith 357e64e952 [cxx_status] Fix paper number for "Concept auto" paper. 2019-12-14 14:53:05 -08:00
Gabor Marton 4cfb91f1ef [Analyzer][Docs][NFC] Add CodeChecker to the command line tools
We add a new common html file that documents the available command line
tools. Also a new html is added for a brief description of CodeChecker,
this way complementing scan-build.

Differential Revision: https://reviews.llvm.org/D70439
2019-12-12 14:22:52 +01:00
Richard Smith f7235ac1d3 [cxx_status] Re-add missing cell. 2019-12-10 19:56:07 -08:00
Richard Smith ffe612922c [c++20] Implement P1946R0: allow defaulted comparisons to take their
arguments by value.
2019-12-10 19:54:35 -08:00
Richard Smith 8e0c9e21bf [c++20] Delete defaulted comparison functions if they would invoke an
inaccessible comparison function.
2019-12-10 19:28:30 -08:00
Richard Smith 336ac7197e [cxx_status] Fix table layout. 2019-12-10 13:03:12 -08:00
Richard Smith 439cb88e26 [cxx_status] Add missed Belfast paper affecting three-way comparisons. 2019-12-10 11:49:04 -08:00
Richard Smith 5253d9138e [c++20] Determine whether a defaulted comparison should be deleted or
constexpr.
2019-12-06 16:32:48 -08:00
Richard Smith 092577e317 [cxx_status] Update with Belfast motions. 2019-11-09 03:13:21 -08:00
Stephan T. Lavavej 3a7a22445e [www] More HTTPS and outdated link fixes.
Resolves D69981.
2019-11-08 14:41:27 -08:00
Artem Dergachev 5e0fb64842 [analyzer] Add test cases for the unsupported C++ constructor modeling.
Namely, for the following items:
- Handle constructors within new[];
- Handle constructors for default arguments.

Update the open projects page with a link to the newly added tests
and more hints for potential contributors.

Patch by Daniel Krupp!

Differential Revision: https://reviews.llvm.org/D69308
2019-11-07 17:15:53 -08:00
Stephan T. Lavavej 2e4f1e112d [www] Change URLs to HTTPS.
This changes most URLs in llvm's html files to HTTPS. Most changes were
search-and-replace with manual verification; some changes were manual.
For a few URLs, the websites were performing redirects or had changed
their anchors; I fixed those up manually. This consistently uses the
official https://wg21.link redirector. This also strips trailing
whitespace and fixes a couple of typos.

Fixes D69363.

There are a very small number of dead links for which I don't know any
replacements (they are equally dead as HTTP or HTTPS):

https://llvm.org/cmds/llvm2cpp.html
https://llvm.org/devmtg/2010-11/videos/Grosser_Polly-desktop.mp4
https://llvm.org/devmtg/2010-11/videos/Grosser_Polly-mobile.mp4
https://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-desktop.mov
https://llvm.org/devmtg/2011-11/videos/Grosser_PollyOptimizations-mobile.mp4
https://llvm.org/perf/db_default/v4/nts/22463
https://polly.llvm.org/documentation/memaccess.html
2019-10-24 13:25:15 -07:00
Chandler Carruth dc1499b90d Improve Clang's getting involved document and make it more inclusive in wording.
Summary: Working with Meike and others to improve the wording in this document.

Reviewers: klimek

Subscribers: mcrosier, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69351
2019-10-23 16:11:24 -07:00
Richard Smith 974c8b7e2f [c++20] Add rewriting from comparison operators to <=> / ==.
This adds support for rewriting <, >, <=, and >= to a normal or reversed
call to operator<=>, for rewriting != to a normal or reversed call to
operator==, and for rewriting <=> and == to reversed forms of those same
operators.

Note that this is a breaking change for various C++17 code patterns,
including some in use in LLVM. The most common patterns (where an
operator== becomes ambiguous with a reversed form of itself) are still
accepted under this patch, as an extension (with a warning). I'm hopeful
that we can get the language rules fixed before C++20 ships, and the
extension warning is aimed primarily at providing data to inform that
decision.

llvm-svn: 375306
2019-10-19 00:04:43 +00:00
Richard Smith 4a6861a7e5 [c++20] P1152R4: warn on any simple-assignment to a volatile lvalue
whose value is not ignored.

We don't warn on all the cases that are deprecated: specifically, we
choose to not warn for now if there are parentheses around the
assignment but its value is not actually used. This seems like a more
defensible rule, particularly for cases like sizeof(v = a), where the
parens are part of the operand rather than the sizeof syntax.

llvm-svn: 374135
2019-10-09 02:04:54 +00:00
Richard Smith 84ef9c6493 [c++20] Implement most of P1152R4.
Diagnose some now-deprecated uses of volatile types:
 * as function parameter types and return types
 * as the type of a structured binding declaration
 * as the type of the lvalue operand of an increment / decrement /
   compound assignment operator

This does not implement a check for the deprecation of simple
assignments whose results are used; that check requires somewhat
more complexity and will be addressed separately.

llvm-svn: 374133
2019-10-09 00:49:40 +00:00
Richard Smith 32377ad7cb [cxx_status] Note that Clang has supported std::source_location since
version 9.

llvm-svn: 374131
2019-10-08 23:39:56 +00:00
Richard Smith 344df110e5 Implements CWG 1601 in [over.ics.rank/4.2]
Summary:
The overload resolution for enums with a fixed underlying type has changed in the C++14 standard. This patch implements the new rule.

Patch by Mark de Wever!

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D65695

llvm-svn: 373866
2019-10-06 18:50:40 +00:00
Richard Smith 69e9d84b1a Mark P0784R7 as complete and start defining its feature-test macro.
Note that this only covers the language side of this feature. (The
library side has its own feature test macro.)

llvm-svn: 373548
2019-10-03 00:39:37 +00:00
Richard Smith 9bc1c6ecc5 [cxx_status] Mark P0784R7 as partially complete.
llvm-svn: 373162
2019-09-29 07:16:13 +00:00
Richard Smith 2d2850ff09 [www] Turn 'Clang 9' boxes green in C++ status pages now Clang 9 is
released.

llvm-svn: 372415
2019-09-20 18:09:05 +00:00
Richard Smith c667cdc850 [c++20] P1331R2: Allow transient use of uninitialized objects in
constant evaluation.

llvm-svn: 372237
2019-09-18 17:37:44 +00:00
Richard Smith a6e8b685e1 [c++20] P1143R2: Add support for the C++20 'constinit' keyword.
This is mostly the same as the
[[clang::require_constant_initialization]] attribute, but has a couple
of additional syntactic and semantic restrictions.

In passing, I added a warning for the attribute form being added after
we have already seen the initialization of the variable (but before we
see the definition); that case previously slipped between the cracks and
the attribute was silently ignored.

llvm-svn: 370972
2019-09-04 20:30:37 +00:00
Richard Smith 03d2567f91 [www] Mark items complete in Clang 9 as 'Clang 9' rather than 'SVN'.
Don't turn the boxes green yet, since Clang 9 hasn't been released.

llvm-svn: 370795
2019-09-03 17:49:51 +00:00
Richard Smith ff9bf925e7 [c++20] Add support for designated direct-list-initialization syntax.
This completes the implementation of P0329R4.

llvm-svn: 370558
2019-08-31 01:00:37 +00:00
Joe Ranieri d0698b67e8 Testing commit access; NFC
llvm-svn: 370051
2019-08-27 12:36:25 +00:00
Erich Keane a8abe1f828 Fix poorly formatted HTML in the cxx_status.html file caused by adding
1668.

llvm-svn: 369286
2019-08-19 18:14:22 +00:00
Erich Keane ab00f237ac Update cxx_status.html with P1668 status.
llvm-svn: 369282
2019-08-19 17:57:27 +00:00
George Karpenkov e7fdf7cb71 Test commit #2.
llvm-svn: 369020
2019-08-15 17:17:21 +00:00
Richard Smith 5cd312d352 [www] Update DR status page to match latest version of CWG issues list.
llvm-svn: 368941
2019-08-14 22:57:51 +00:00
Erich Keane ad137fa788 Fix cxx_status html for r367027
llvm-svn: 367038
2019-07-25 17:14:37 +00:00
Erich Keane 46441fdb3c Implement P1771
As passed in the Cologne meeting and treated by Core as a DR,
[[nodiscard]] was applied to constructors so that they can be diagnosed
in cases where the user forgets a variable name for a type.

The intent is to enable the library to start using this on the
constructors of scope_guard/lock_guard.

Differential Revision: https://reviews.llvm.org/D64914

llvm-svn: 367027
2019-07-25 15:10:56 +00:00
Richard Smith 6a38205039 [c++20] P1161R3: a[b,c] is deprecated.
llvm-svn: 366630
2019-07-20 09:32:27 +00:00
Aaron Ballman 7017a6d3a3 Mark P1301R4 in C++2a as being SVN instead.
llvm-svn: 366629
2019-07-20 08:57:08 +00:00
Aaron Ballman 1358af27c0 We support P1301R4 in C++2a as of r366626.
llvm-svn: 366628
2019-07-20 08:24:56 +00:00
Richard Smith 1f8aa536f3 [cxx_status] Update status page for WG21 Cologne meeting motions.
Note that many of the paper links will be dead until the post-meeting
mailing is released.

llvm-svn: 366627
2019-07-20 08:20:54 +00:00
Simon Pilgrim 6f6e5d85de Retire VS2015 Support
As proposed here: https://lists.llvm.org/pipermail/llvm-dev/2019-June/133147.html

This patch raises the minimum supported version to build LLVM/Clang to Visual Studio 2017.

Differential Revision: https://reviews.llvm.org/D64326

llvm-svn: 365454
2019-07-09 10:12:37 +00:00
Richard Smith 7939ba08ab [cxx2a] P1236R1: the validity of a left shift does not depend on the
value of the LHS operand.

llvm-svn: 364265
2019-06-25 01:45:26 +00:00
Richard Smith 78b239ea67 P0840R2: support for [[no_unique_address]] attribute
Summary:
Add support for the C++2a [[no_unique_address]] attribute for targets using the Itanium C++ ABI.

This depends on D63371.

Reviewers: rjmccall, aaron.ballman

Subscribers: dschuff, aheejin, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63451

llvm-svn: 363976
2019-06-20 20:44:45 +00:00