blob: a4c5c62b000b2ef2de560967a67ce04f5ba15665 [file] [log] [blame]
Sean Silvab0455142013-01-02 22:05:33 +00001=====================================
Hans Wennborgac3ddff2016-01-13 17:32:59 +00002Clang 3.9 (In-Progress) Release Notes
Sean Silvab0455142013-01-02 22:05:33 +00003=====================================
Sean Silvafe251442012-12-23 01:19:35 +00004
5.. contents::
6 :local:
7 :depth: 2
8
9Written by the `LLVM Team <http://llvm.org/>`_
10
11.. warning::
12
Hans Wennborgac3ddff2016-01-13 17:32:59 +000013 These are in-progress notes for the upcoming Clang 3.9 release. You may
Hans Wennborgb2ed61a2016-03-09 17:26:46 +000014 prefer the `Clang 3.8 Release Notes
15 <http://llvm.org/releases/3.8.0/tools/clang/docs/ReleaseNotes.html>`_.
Sean Silvafe251442012-12-23 01:19:35 +000016
17Introduction
18============
19
20This document contains the release notes for the Clang C/C++/Objective-C
Hans Wennborgac3ddff2016-01-13 17:32:59 +000021frontend, part of the LLVM Compiler Infrastructure, release 3.9. Here we
Sean Silvafe251442012-12-23 01:19:35 +000022describe the status of Clang in some detail, including major
23improvements from the previous release and new feature work. For the
24general LLVM release notes, see `the LLVM
25documentation <http://llvm.org/docs/ReleaseNotes.html>`_. All LLVM
26releases may be downloaded from the `LLVM releases web
27site <http://llvm.org/releases/>`_.
28
29For more information about Clang or LLVM, including information about
30the latest release, please check out the main please see the `Clang Web
31Site <http://clang.llvm.org>`_ or the `LLVM Web
32Site <http://llvm.org>`_.
33
34Note that if you are reading this file from a Subversion checkout or the
35main Clang web page, this document applies to the *next* release, not
36the current one. To see the release notes for a specific release, please
37see the `releases page <http://llvm.org/releases/>`_.
38
Hans Wennborgac3ddff2016-01-13 17:32:59 +000039What's New in Clang 3.9?
Sean Silvafe251442012-12-23 01:19:35 +000040========================
41
42Some of the major new features and improvements to Clang are listed
43here. Generic improvements to Clang as a whole or to its underlying
44infrastructure are described first, followed by language-specific
45sections with improvements to Clang's support for those languages.
46
47Major New Features
48------------------
49
Hans Wennborge904ea22015-07-14 22:52:36 +000050- Feature1...
Rafael Espindola34970692013-12-12 16:07:11 +000051
Sean Silvafe251442012-12-23 01:19:35 +000052Improvements to Clang's diagnostics
53^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54
55Clang's diagnostics are constantly being improved to catch more issues,
56explain them more clearly, and provide more accurate source information
Hans Wennborgeb2bd9a2015-08-12 16:40:42 +000057about them. The improvements since the 3.7 release include:
Sylvestre Ledru5e43f742014-07-14 18:30:23 +000058
Sean Silvafe251442012-12-23 01:19:35 +000059- ...
60
Sean Silvafe251442012-12-23 01:19:35 +000061New Compiler Flags
62------------------
63
Rafael Espindolaaf742502014-08-22 21:59:11 +000064The option ....
Renato Golin1588cda2013-12-11 09:35:10 +000065
Sylvestre Ledru0e767b12014-07-14 18:34:37 +000066
Tyler Nowickidb2668a2014-06-18 00:51:32 +000067New Pragmas in Clang
68-----------------------
69
Rafael Espindolaaf742502014-08-22 21:59:11 +000070Clang now supports the ...
Mark Heffernanbd26f5e2014-07-21 18:08:34 +000071
Hans Wennborg02dc0002014-08-05 00:21:23 +000072Windows Support
73---------------
74
Rafael Espindolaaf742502014-08-22 21:59:11 +000075Clang's support for building native Windows programs ...
Hans Wennborg02dc0002014-08-05 00:21:23 +000076
NAKAMURA Takumi33ff1dd2016-01-16 03:44:52 +000077TLS is enabled for Cygwin defaults to -femulated-tls.
78
Hans Wennborg02dc0002014-08-05 00:21:23 +000079
Renato Golinf2fcddb2013-12-13 09:27:34 +000080C Language Changes in Clang
81---------------------------
Eric Christopher37df19e2016-03-24 01:28:25 +000082The -faltivec and -maltivec flags no longer silently include altivec.h on Power platforms.
Renato Golinf2fcddb2013-12-13 09:27:34 +000083
84...
85
Sean Silvafe251442012-12-23 01:19:35 +000086C11 Feature Support
87^^^^^^^^^^^^^^^^^^^
88
89...
90
91C++ Language Changes in Clang
92-----------------------------
93
Richard Smith8eb53c82016-05-05 18:40:37 +000094- Clang now enforces the rule that a *using-declaration* cannot name an enumerator of a
95 scoped enumeration.
Rafael Espindola9ca6e812013-04-09 12:51:24 +000096
Aaron Ballmandc76a4d2016-05-06 11:56:57 +000097 .. code-block:: c++
Richard Smith8eb53c82016-05-05 18:40:37 +000098
99 namespace Foo { enum class E { e }; }
100 namespace Bar {
101 using Foo::E::e; // error
102 constexpr auto e = Foo::E::e; // ok
103 }
104
105- Clang now enforces the rule that an enumerator of an unscoped enumeration declared at
106 class scope can only be named by a *using-declaration* in a derived class.
107
Aaron Ballmandc76a4d2016-05-06 11:56:57 +0000108 .. code-block:: c++
Richard Smith8eb53c82016-05-05 18:40:37 +0000109
110 class Foo { enum E { e }; }
111 using Foo::e; // error
112 static constexpr auto e = Foo::e; // ok
113
114...
115
116C++1z Feature Support
Sean Silvafe251442012-12-23 01:19:35 +0000117^^^^^^^^^^^^^^^^^^^^^
118
Richard Smith8eb53c82016-05-05 18:40:37 +0000119Clang's experimental support for the upcoming C++1z standard can be enabled with ``-std=c++1z``.
120Changes to C++1z features since Clang 3.8:
121
122- The ``[[fallthrough]]``, ``[[nodiscard]]``, and ``[[maybe_unused]]`` attributes are
123 supported in C++11 onwards, and are largely synonymous with Clang's existing attributes
124 ``[[clang::fallthrough]]``, ``[[gnu::warn_unused_result]]``, and ``[[gnu::unused]]``.
125 Use ``-Wimplicit-fallthrough`` to warn on unannotated fallthrough within ``switch``
126 statements.
127
128- In C++1z mode, aggregate initialization can be performed for classes with base classes:
129
Aaron Ballmandc76a4d2016-05-06 11:56:57 +0000130 .. code-block:: c++
Richard Smith8eb53c82016-05-05 18:40:37 +0000131
132 struct A { int n; };
133 struct B : A { int x, y; };
134 B b = { 1, 2, 3 }; // b.n == 1, b.x == 2, b.y == 3
135
136- The range in a range-based ``for`` statement can have different types for its ``begin``
137 and ``end`` iterators. This is permitted as an extension in C++11 onwards.
138
139- Lambda-expressions can explicitly capture ``*this`` (to capture the surrounding object
140 by copy). This is permitted as an extension in C++11 onwards.
141
142- Objects of enumeration type can be direct-list-initialized from a value of the underlying
143 type. ``E{n}`` is equivalent to ``E(n)``, except that it implies a check for a narrowing
144 conversion.
145
146- Unary *fold-expression*\s over an empty pack are now rejected for all operators
147 other than ``&&``, ``||``, and ``,``.
148
Sean Silvafe251442012-12-23 01:19:35 +0000149...
150
151Objective-C Language Changes in Clang
152-------------------------------------
153
154...
155
Erik Schnetter489700d2013-11-11 06:36:33 +0000156OpenCL C Language Changes in Clang
157----------------------------------
158
Bill Wendling0a794a4b2013-11-20 10:13:37 +0000159...
Erik Schnetter489700d2013-11-11 06:36:33 +0000160
Sean Silvafe251442012-12-23 01:19:35 +0000161Internal API Changes
162--------------------
163
Hans Wennborgac3ddff2016-01-13 17:32:59 +0000164These are major API changes that have happened since the 3.8 release of
Sean Silvafe251442012-12-23 01:19:35 +0000165Clang. If upgrading an external codebase that uses Clang as a library,
166this section should help get you past the largest hurdles of upgrading.
167
Hans Wennborge904ea22015-07-14 22:52:36 +0000168- ...
Richard Smitha0334a92015-05-14 00:22:12 +0000169
Aaron Ballmancdc43af2015-09-17 13:47:22 +0000170AST Matchers
171------------
Aaron Ballmancdc43af2015-09-17 13:47:22 +0000172
Gabor Horvath1b654f22016-03-30 11:22:14 +0000173- hasAnyArgument: Matcher no longer ignores parentheses and implicit casts on
174 the argument before applying the inner matcher. The fix was done to allow for
175 greater control by the user. In all existing checkers that use this matcher
176 all instances of code ``hasAnyArgument(<inner matcher>)`` must be changed to
177 ``hasAnyArgument(ignoringParenImpCasts(<inner matcher>))``.
178
Aaron Ballmancdc43af2015-09-17 13:47:22 +0000179...
180
Ted Kremenek3a2291b2013-04-24 07:33:52 +0000181libclang
182--------
183
Bill Wendling61f44cc2013-06-04 06:17:46 +0000184...
Ted Kremenek3a2291b2013-04-24 07:33:52 +0000185
Anna Zaksb6219a92013-04-25 23:14:38 +0000186Static Analyzer
Ted Kremenek004e8232013-04-26 00:01:34 +0000187---------------
Anna Zaksb6219a92013-04-25 23:14:38 +0000188
Bill Wendling0a794a4b2013-11-20 10:13:37 +0000189...
Ted Kremenek004e8232013-04-26 00:01:34 +0000190
191Core Analysis Improvements
192==========================
193
Bill Wendling61f44cc2013-06-04 06:17:46 +0000194- ...
Ted Kremenek004e8232013-04-26 00:01:34 +0000195
196New Issues Found
197================
198
Bill Wendling61f44cc2013-06-04 06:17:46 +0000199- ...
Anna Zaksb6219a92013-04-25 23:14:38 +0000200
Sean Silvafe251442012-12-23 01:19:35 +0000201Python Binding Changes
202----------------------
203
204The following methods have been added:
205
206- ...
207
208Significant Known Problems
209==========================
210
211Additional Information
212======================
213
214A wide variety of additional information is available on the `Clang web
215page <http://clang.llvm.org/>`_. The web page contains versions of the
216API documentation which are up-to-date with the Subversion version of
217the source code. You can access versions of these documents specific to
218this release by going into the "``clang/docs/``" directory in the Clang
219tree.
220
221If you have any questions or comments about Clang, please feel free to
222contact us via the `mailing
Tanya Lattner4a08e932015-08-05 03:55:23 +0000223list <http://lists.llvm.org/mailman/listinfo/cfe-dev>`_.