Commit Graph

1294 Commits

Author SHA1 Message Date
Faisal Vali 8194a3e975 [c++2a] Implement P0409R2 - Allow lambda capture [=,this] (by hamzasood)
This patch, by hamzasood, implements P0409R2, and allows [=, this] pre-C++2a as an extension (with appropriate warnings) for consistency.

https://reviews.llvm.org/D36572

Thanks Hamza!

llvm-svn: 311224
2017-08-19 03:43:07 +00:00
Richard Smith 9d07ae77e7 Implement latest feature test macro recommendations, P0096R4.
llvm-svn: 310694
2017-08-11 03:39:40 +00:00
Richard Smith b9e5af2123 Update cxx_status to mention the upcoming Clang 5 release.
llvm-svn: 310693
2017-08-11 03:16:11 +00:00
Richard Smith f8c735c770 PR33850: Update cxx_dr_status for Clang 5 branch.
llvm-svn: 310692
2017-08-11 03:14:20 +00:00
Devin Coughlin f0cadcd9f3 [Analyzer] Add support for displaying cross-file diagnostic paths in HTML output
This change adds support for cross-file diagnostic paths in html output. If the
diagnostic path is not cross-file, there is no change in the output.

Patch by Vlad Tsyrklevich!

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

llvm-svn: 309968
2017-08-03 18:12:22 +00:00
Devin Coughlin 35b59fcaf2 [analyzer] Add missing documentation for static analyzer checkers
Some checks did not have documentation in the www/analyzer/ folder and also
some alpha checks became non-alpha.

Patch by Dominik Szabó!

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

llvm-svn: 308242
2017-07-18 00:34:57 +00:00
Richard Smith 21a1019387 [cxx_status] Fix typos.
llvm-svn: 308101
2017-07-15 15:51:59 +00:00
Richard Smith da62f427a4 [cxx_status] Add approved Toronto WG21 motions.
llvm-svn: 308099
2017-07-15 15:42:36 +00:00
Gabor Horvath 70c671a3bf [analyzer] Fix a path in the developer manual
Patch by: Reka Nikolett Kovacs

llvm-svn: 307468
2017-07-08 08:23:52 +00:00
Richard Smith 29c5f16ad0 [cxx_status] Update link to Modules TS to latest working draft. Fix Coroutines TS flag to work if copy-pasted.
llvm-svn: 307231
2017-07-06 00:29:13 +00:00
Hiroshi Inoue c5e54ddab3 fix trivial typos in comments; NFC
llvm-svn: 307007
2017-07-03 08:49:44 +00:00
Gor Nishanov b87931e983 [coroutines] www/cxx_status.html: add non-breaking hyphen
Reviewers: GorNishanov

Reviewed By: GorNishanov

Subscribers: EricWF, rsmith, cfe-commits

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

llvm-svn: 304092
2017-05-28 17:35:23 +00:00
Gor Nishanov 6ecbe540c6 [coroutines] www/cxx_status.html: add non-breaking hyphen
Reviewers: GorNishanov

Reviewed By: GorNishanov

Subscribers: EricWF, rsmith, cfe-commits

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

llvm-svn: 304091
2017-05-28 16:25:31 +00:00
Gor Nishanov b5543e5b32 [coroutines] Mark cxx_status.html of Coroutines TS as (SVN)
Summary: It is time!

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov, rsmith

Subscribers: EricWF, rsmith, cfe-commits

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

llvm-svn: 304081
2017-05-27 22:54:52 +00:00
George Burgess IV a911cb4ec8 [docs] Point coroutine link to an actual document
Unsure if there's a better document, but what we had before led to a
404. :)

llvm-svn: 303962
2017-05-26 02:56:51 +00:00
Aaron Ballman c674a056e9 Update the getting started documentation to match the corresponding LLVM commit in r303912.
llvm-svn: 303913
2017-05-25 21:02:49 +00:00
Eric Fiselier b0bac2dafb [Sema] Implement Core 2094: Trivial copy/move constructor for class with volatile member
Summary: This patch implements http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2094 which reverts Core 496.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 302593
2017-05-09 22:21:24 +00:00
Eric Fiselier a34cb77273 Update Clang C++ DR documentation for new issue list
llvm-svn: 302592
2017-05-09 22:17:23 +00:00
Matthias Gehre dc01bb448f Implement DR 373 "Lookup on namespace qualified name in using-directive"
Summary:
3.4.6 [basic.lookup.udir] paragraph 1:
In a using-directive or namespace-alias-definition, during the lookup for a namespace-name or for a name in a nested-name-specifier, only namespace names are considered.

Reviewers: rsmith, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 298126
2017-03-17 21:41:20 +00:00
Ed Schouten f59d8df38d Make table cells referring to Clang 4 green, as Clang 4 has been released.
llvm-svn: 297956
2017-03-16 14:21:00 +00:00
Gabor Horvath 829c6bc04a [analyzer] Extend block in critical section check with C11 and Pthread APIs.
Patch by Zoltan Daniel Torok!

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

llvm-svn: 297461
2017-03-10 14:50:12 +00:00
Richard Smith c46fe0d629 Update cxx_dr_status page.
llvm-svn: 296276
2017-02-25 23:54:18 +00:00
Richard Smith b80bbca254 [c++1z] Mark constexpr lambdas as done on status page and start advertising
them via feature test macro __cpp_constexpr.

Thanks to Faisal for implementing this feature!

llvm-svn: 295791
2017-02-21 23:58:29 +00:00
Richard Smith 4e05eaa9e8 [c++1z] Diagnose non-deducible template parameters in deduction guide templates, per [temp.param]p11.
llvm-svn: 295264
2017-02-16 00:36:47 +00:00
Richard Smith cbe079321e [c++1z] Add some more tests for class template argument deduction, add
feature-test macro, and mark feature as done on status page.

llvm-svn: 295011
2017-02-14 00:55:25 +00:00
Richard Smith 19a311a483 Disallow explicit instantiation and explicit specialization for deduction guides.
llvm-svn: 294641
2017-02-09 22:47:51 +00:00
Richard Smith fd3dae024f Finish implementation of C++ DR1310 (http://wg21.link/cwg1310).
Diagnose the case when a dependent template name instantiates to an
injected-class-name outside a nested-name-specifier.

llvm-svn: 292545
2017-01-20 00:20:39 +00:00
Richard Smith 74f02347ca PR13403 (+duplicates): implement C++ DR1310 (http://wg21.link/cwg1310).
Under this defect resolution, the injected-class-name of a class or class
template cannot be used except in very limited circumstances (when declaring a
constructor, in a nested-name-specifier, in a base-specifier, or in an
elaborated-type-specifier). This is apparently done to make parsing easier, but
it's a pain for us since we don't know whether a template-id using the
injected-class-name is valid at the point when we annotate it (we don't yet
know whether the template-id will become part of an elaborated-type-specifier).

As a tentative resolution to a perceived language defect, mem-initializer-ids
are added to the list of exceptions here (they generally follow the same rules
as base-specifiers).

When the reference to the injected-class-name uses the 'typename' or 'template'
keywords, we permit it to be used to name a type or template as an extension;
other compilers also accept some cases in this area. There are also a couple of
corner cases with dependent template names that we do not yet diagnose, but
which will also get this treatment.

llvm-svn: 292518
2017-01-19 21:00:13 +00:00
Richard Smith 11255ec765 PR9551: Implement DR1004 (http://wg21.link/cwg1004).
This rule permits the injected-class-name of a class template to be used as
both a template type argument and a template template argument, with no extra
syntax required to disambiguate.

llvm-svn: 292426
2017-01-18 19:19:22 +00:00
Richard Smith 8210ed5586 Implement DR1265 (wg21.link/cwg1265).
Diasllow a declaration using the 'auto' type specifier from using two different
meanings of it at once, or from declaring multiple functions with deduced
return types or introducing multiple trailing return types.

The standard does not technically disallow the multiple trailing return types
case if all the declarators declare variables (such as function pointers with
trailing return types), but we disallow that too, following the clear intent.

llvm-svn: 291880
2017-01-13 02:22:01 +00:00
Richard Smith d7279bba20 Update C++ status pages for Clang 4 branch:
* Update version number in DR tests from 4.0 to 4
 * Teach make_cxx_dr_status script about version numbers that don't contain a
   period.
 * Update cxx_status.html and cxx_dr_status.html to list Clang 4 features as
   "Clang 4" rather than "SVN"

Clang 4 features are still listed in yellow rather than green until release.

llvm-svn: 291871
2017-01-13 00:57:54 +00:00
Anastasia Stulova 18e165f50d [Docs][OpenCL] Added OpenCL feature description to Clang documentation.
Updated index and UsersManual with OpenCL description.

Review: https://reviews.llvm.org/D28080 
llvm-svn: 291780
2017-01-12 17:52:22 +00:00
Richard Smith 6eedfe77c1 Implement C++ DR1391 (wg21.link/cwg1391)
Check for implicit conversion sequences for non-dependent function
template parameters between deduction and substitution. The idea is to accept
as many cases as possible, on the basis that substitution failure outside the
immediate context is much more common during substitution than during implicit
conversion sequence formation.

This re-commits r290808, reverted in r290811 and r291412, with a couple of
fixes for handling of explicitly-specified non-trailing template argument
packs.

llvm-svn: 291427
2017-01-09 08:01:21 +00:00
Richard Smith de0d34a576 Implement DR1388 (wg21.link/cwg1388).
This issue clarifies how deduction proceeds past a non-trailing function
parameter pack. Essentially, the pack itself is skipped and consumes no
arguments (except for those implied by an explicitly-specified template
arguments), and nothing is deduced from it. As a small fix to the standard's
rule, we do not allow subsequent deduction to change the length of the function
parameter pack (by preventing extension of the explicitly-specified pack if
present, and otherwise deducing all contained packs to empty packs).

llvm-svn: 291425
2017-01-09 07:14:40 +00:00
Richard Smith 7950d82ab5 Revert r291410 and r291411.
The test-suite bots are still failing even after r291410's fix.

llvm-svn: 291412
2017-01-09 01:18:18 +00:00
Richard Smith d22652122d Implement C++ DR1391 (wg21.link/cwg1391)
Check for implicit conversion sequences for non-dependent function
template parameters between deduction and substitution. The idea is to accept
as many cases as possible, on the basis that substitution failure outside the
immediate context is much more common during substitution than during implicit
conversion sequence formation.

This re-commits r290808, reverted in r290811, with a fix for handling of
explicitly-specified template argument packs.

llvm-svn: 291410
2017-01-09 00:43:47 +00:00
Renato Golin dad96d6751 Revert "DR1391: Check for implicit conversion sequences for non-dependent function template parameters between deduction and substitution. The idea is to accept as many cases as possible, on the basis that substitution failure outside the immediate context is much more common during substitution than during implicit conversion sequence formation."
This reverts commit r290808, as it broken all ARM and AArch64 test-suite
test: MultiSource/UnitTests/C++11/frame_layout

Also, please, next time, try to write a commit message in according to
our guidelines:

http://llvm.org/docs/DeveloperPolicy.html#commit-messages

llvm-svn: 290811
2017-01-02 11:15:42 +00:00
Richard Smith efcfe86072 DR1391: Check for implicit conversion sequences for non-dependent function
template parameters between deduction and substitution. The idea is to accept
as many cases as possible, on the basis that substitution failure outside
the immediate context is much more common during substitution than during
implicit conversion sequence formation.

This does not implement the partial ordering portion of DR1391, which so
far appears to be misguided.

llvm-svn: 290808
2017-01-02 02:42:17 +00:00
Richard Smith 26b86ea8b1 [c++17] Implement P0522R0 as written. This allows a template template argument
to be specified for a template template parameter whenever the parameter is at
least as specialized as the argument (when there's an obvious and correct
mapping from uses of the parameter to uses of the argument). For example, a
template with more parameters can be passed to a template template parameter
with fewer, if those trailing parameters have default arguments.

This is disabled by default, despite being a DR resolution, as it's fairly
broken in its current state: there are no partial ordering rules to cope with
template template parameters that have different parameter lists, meaning that
code that attempts to decompose template-ids based on arity can hit unavoidable
ambiguity issues.

The diagnostics produced on a non-matching argument are also pretty bad right
now, but I aim to improve them in a subsequent commit.

llvm-svn: 290792
2016-12-31 21:41:23 +00:00
Richard Smith 57aae07b4a DR1315: a non-type template argument in a partial specialization is permitted
to make reference to template parameters. This is only a partial
implementation; we retain the restriction that the argument must not be
type-dependent, since it's unclear how that would work given the existence of
other language rules requiring an exact type match in this context, even for
type-dependent cases (a question has been raised on the core reflector).

llvm-svn: 290647
2016-12-28 02:37:25 +00:00
Richard Smith 0e617ecdd1 DR1495: A partial specialization is ill-formed if it is not (strictly) more
specialized than the primary template. (Put another way, if we imagine there
were a partial specialization matching the primary template, we should never
select it if some other partial specialization also matches.)

llvm-svn: 290593
2016-12-27 07:56:27 +00:00
Richard Smith cb0ccb08ee [c++1z] cxx_status: mark p0195r2 as done.
llvm-svn: 290081
2016-12-19 04:16:03 +00:00
Richard Smith 378b8c8f01 [c++1z] P0217R3: Allow by-value structured binding of arrays.
llvm-svn: 289630
2016-12-14 03:22:16 +00:00
Richard Smith f0e87cf2c3 Add tests for a couple more DRs.
llvm-svn: 289258
2016-12-09 19:35:45 +00:00
Richard Smith b11b087a85 cxx_dr_status: update to latest issue list and add a couple more tests.
llvm-svn: 289255
2016-12-09 19:11:50 +00:00
Richard Smith 82da19ddb3 [c++1z] P0003R5: Removing dynamic exception specifications.
We continue to support dynamic exception specifications in C++1z as an
extension, but produce an error-by-default warning when we encounter one. This
allows users to opt back into the feature with a warning flag, and implicitly
opts system headers back into the feature should they happen to use it.

There is one semantic change implied by P0003R5 but not implemented here:
violating a throw() exception specification should now call std::terminate
directly instead of calling std::unexpected(), but since P0003R5 also removes
std::unexpected() and std::set_unexpected, and the default unexpected handler
calls std::terminate(), a conforming C++1z program cannot tell that we are
still calling it. The upside of this strategy is perfect backwards
compatibility; the downside is that we don't get the more efficient 'noexcept'
codegen for 'throw()'.

llvm-svn: 289019
2016-12-08 02:49:07 +00:00
Richard Smith 122f88d481 [c++17] P0135R1: Guaranteed copy elision.
When an object of class type is initialized from a prvalue of the same type
(ignoring cv qualifications), use the prvalue to initialize the object directly
instead of inserting a redundant elidable call to a copy constructor.

llvm-svn: 288866
2016-12-06 23:52:28 +00:00
Richard Smith b3189a1802 DR1213: element access on an array xvalue or prvalue produces an xvalue. In the
latter case, a temporary array object is materialized, and can be
lifetime-extended by binding a reference to the member access. Likewise, in an
array-to-pointer decay, an rvalue array is materialized before being converted
into a pointer.

This caused IR generation to stop treating file-scope array compound literals
as having static storage duration in some cases in C++; that has been rectified
by modeling such a compound literal as an lvalue. This also improves clang's
compatibility with GCC for those cases.

llvm-svn: 288654
2016-12-05 07:49:14 +00:00
Richard Smith 4baaa5ab52 DR616, and part of P0135R1: member access (or pointer-to-member access) on a
temporary produces an xvalue, not a prvalue. Support this by materializing the
temporary prior to performing the member access.

llvm-svn: 288563
2016-12-03 01:14:32 +00:00
Richard Smith a7d9378761 P0012R1: add Itanium ABI support for throwing non-noexcept function pointers and catching as noexcept.
llvm-svn: 288305
2016-12-01 03:32:42 +00:00