blob: dcd39e23c945f57d2bf07a55ec17fdbdc77ec234 [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
Richard Smith1a015f52016-05-06 16:48:29 +0000132 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
Richard Smith8eb53c82016-05-05 18:40:37 +0000135
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
Alexey Bataev44b67502016-05-31 11:17:08 +0000161OpenMP Support in Clang
162----------------------------------
163
164Added support for all non-offloading features from OpenMP 4.5, including using
165data members in private clauses of non-static member functions. Additionally,
166data members can be used as loop control variables in loop-based directives.
167
168Currently Clang supports OpenMP 3.1 and all non-offloading features of
169OpenMP 4.0/4.5. Offloading features are under development. Clang defines macro
170_OPENMP and sets it to OpenMP 3.1 (in accordance with OpenMP standard) by
171default. User may change this value using ``-fopenmp-version=[31|40|45]`` option.
172
173The codegen for OpenMP constructs was significantly improved to produce much
174more stable and faster code.
175
Sean Silvafe251442012-12-23 01:19:35 +0000176Internal API Changes
177--------------------
178
Hans Wennborgac3ddff2016-01-13 17:32:59 +0000179These are major API changes that have happened since the 3.8 release of
Sean Silvafe251442012-12-23 01:19:35 +0000180Clang. If upgrading an external codebase that uses Clang as a library,
181this section should help get you past the largest hurdles of upgrading.
182
Hans Wennborge904ea22015-07-14 22:52:36 +0000183- ...
Richard Smitha0334a92015-05-14 00:22:12 +0000184
Aaron Ballmancdc43af2015-09-17 13:47:22 +0000185AST Matchers
186------------
Aaron Ballmancdc43af2015-09-17 13:47:22 +0000187
Gabor Horvath1b654f22016-03-30 11:22:14 +0000188- hasAnyArgument: Matcher no longer ignores parentheses and implicit casts on
189 the argument before applying the inner matcher. The fix was done to allow for
190 greater control by the user. In all existing checkers that use this matcher
191 all instances of code ``hasAnyArgument(<inner matcher>)`` must be changed to
192 ``hasAnyArgument(ignoringParenImpCasts(<inner matcher>))``.
193
Aaron Ballmancdc43af2015-09-17 13:47:22 +0000194...
195
Ted Kremenek3a2291b2013-04-24 07:33:52 +0000196libclang
197--------
198
Bill Wendling61f44cc2013-06-04 06:17:46 +0000199...
Ted Kremenek3a2291b2013-04-24 07:33:52 +0000200
Anna Zaksb6219a92013-04-25 23:14:38 +0000201Static Analyzer
Ted Kremenek004e8232013-04-26 00:01:34 +0000202---------------
Anna Zaksb6219a92013-04-25 23:14:38 +0000203
Bill Wendling0a794a4b2013-11-20 10:13:37 +0000204...
Ted Kremenek004e8232013-04-26 00:01:34 +0000205
206Core Analysis Improvements
207==========================
208
Bill Wendling61f44cc2013-06-04 06:17:46 +0000209- ...
Ted Kremenek004e8232013-04-26 00:01:34 +0000210
211New Issues Found
212================
213
Bill Wendling61f44cc2013-06-04 06:17:46 +0000214- ...
Anna Zaksb6219a92013-04-25 23:14:38 +0000215
Sean Silvafe251442012-12-23 01:19:35 +0000216Python Binding Changes
217----------------------
218
219The following methods have been added:
220
221- ...
222
223Significant Known Problems
224==========================
225
226Additional Information
227======================
228
229A wide variety of additional information is available on the `Clang web
230page <http://clang.llvm.org/>`_. The web page contains versions of the
231API documentation which are up-to-date with the Subversion version of
232the source code. You can access versions of these documents specific to
233this release by going into the "``clang/docs/``" directory in the Clang
234tree.
235
236If you have any questions or comments about Clang, please feel free to
237contact us via the `mailing
Tanya Lattner4a08e932015-08-05 03:55:23 +0000238list <http://lists.llvm.org/mailman/listinfo/cfe-dev>`_.