Some release note updates for C++ language acceptance changes since Clang 3.8.

llvm-svn: 268663
This commit is contained in:
Richard Smith 2016-05-05 18:40:37 +00:00
parent df43264cf7
commit 8eb53c8e22
1 changed files with 52 additions and 2 deletions

View File

@ -91,11 +91,61 @@ C11 Feature Support
C++ Language Changes in Clang
-----------------------------
- ...
- Clang now enforces the rule that a *using-declaration* cannot name an enumerator of a
scoped enumeration.
C++11 Feature Support
.. codeblock:: c++
namespace Foo { enum class E { e }; }
namespace Bar {
using Foo::E::e; // error
constexpr auto e = Foo::E::e; // ok
}
- Clang now enforces the rule that an enumerator of an unscoped enumeration declared at
class scope can only be named by a *using-declaration* in a derived class.
.. codeblock:: c++
class Foo { enum E { e }; }
using Foo::e; // error
static constexpr auto e = Foo::e; // ok
...
C++1z Feature Support
^^^^^^^^^^^^^^^^^^^^^
Clang's experimental support for the upcoming C++1z standard can be enabled with ``-std=c++1z``.
Changes to C++1z features since Clang 3.8:
- The ``[[fallthrough]]``, ``[[nodiscard]]``, and ``[[maybe_unused]]`` attributes are
supported in C++11 onwards, and are largely synonymous with Clang's existing attributes
``[[clang::fallthrough]]``, ``[[gnu::warn_unused_result]]``, and ``[[gnu::unused]]``.
Use ``-Wimplicit-fallthrough`` to warn on unannotated fallthrough within ``switch``
statements.
- In C++1z mode, aggregate initialization can be performed for classes with base classes:
.. codeblock:: c++
struct A { int n; };
struct B : A { int x, y; };
B b = { 1, 2, 3 }; // b.n == 1, b.x == 2, b.y == 3
- The range in a range-based ``for`` statement can have different types for its ``begin``
and ``end`` iterators. This is permitted as an extension in C++11 onwards.
- Lambda-expressions can explicitly capture ``*this`` (to capture the surrounding object
by copy). This is permitted as an extension in C++11 onwards.
- Objects of enumeration type can be direct-list-initialized from a value of the underlying
type. ``E{n}`` is equivalent to ``E(n)``, except that it implies a check for a narrowing
conversion.
- Unary *fold-expression*\s over an empty pack are now rejected for all operators
other than ``&&``, ``||``, and ``,``.
...
Objective-C Language Changes in Clang