blob: 60d418bd4a01243d056511c7fbaf314f83eb8c87 [file] [log] [blame]
Hans Wennborg60d06bf2016-07-18 18:05:19 +00001=======================================
Hans Wennborgfbb21e02017-07-19 14:14:07 +00002Clang 6.0.0 (In-Progress) Release Notes
Hans Wennborg60d06bf2016-07-18 18:05:19 +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 Wennborgfbb21e02017-07-19 14:14:07 +000013 These are in-progress notes for the upcoming Clang 6 release.
Hans Wennborg189f1f32017-02-09 23:26:34 +000014 Release notes for previous releases can be found on
15 `the Download Page <http://releases.llvm.org/download.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 Wennborgfbb21e02017-07-19 14:14:07 +000021frontend, part of the LLVM Compiler Infrastructure, release 6.0.0. 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
Hans Wennborgd878ca82017-08-30 18:35:44 +000029For more information about Clang or LLVM, including information about the
30latest release, please see the `Clang Web Site <http://clang.llvm.org>`_ or the
31`LLVM Web Site <http://llvm.org>`_.
Sean Silvafe251442012-12-23 01:19:35 +000032
33Note that if you are reading this file from a Subversion checkout or the
34main Clang web page, this document applies to the *next* release, not
35the current one. To see the release notes for a specific release, please
36see the `releases page <http://llvm.org/releases/>`_.
37
Hans Wennborgfbb21e02017-07-19 14:14:07 +000038What's New in Clang 6.0.0?
Hans Wennborg60d06bf2016-07-18 18:05:19 +000039==========================
Sean Silvafe251442012-12-23 01:19:35 +000040
41Some of the major new features and improvements to Clang are listed
42here. Generic improvements to Clang as a whole or to its underlying
43infrastructure are described first, followed by language-specific
44sections with improvements to Clang's support for those languages.
45
46Major New Features
47------------------
48
Hans Wennborg60d06bf2016-07-18 18:05:19 +000049- ...
Rafael Espindola34970692013-12-12 16:07:11 +000050
Sean Silvafe251442012-12-23 01:19:35 +000051Improvements to Clang's diagnostics
52^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
53
Alex Lorenzdbbe8222017-07-31 14:22:43 +000054- ``-Wpragma-pack`` is a new warning that warns in the following cases:
55
56 - When a translation unit is missing terminating ``#pragma pack (pop)``
Alex Lorenz51748662017-07-31 14:08:41 +000057 directives.
Alex Lorenzdbbe8222017-07-31 14:22:43 +000058
Alex Lorenz51748662017-07-31 14:08:41 +000059 - When leaving an included file that changes the current alignment value,
Alex Lorenzdbbe8222017-07-31 14:22:43 +000060 i.e. when the alignment before ``#include`` is different to the alignment
61 after ``#include``.
62
63 - ``-Wpragma-pack-suspicious-include`` (disabled by default) warns on an
64 ``#include`` when the included file contains structures or unions affected by
65 a non-default alignment that has been specified using a ``#pragma pack``
66 directive prior to the ``#include``.
Sean Silvafe251442012-12-23 01:19:35 +000067
Alex Lorenzd9f12842017-08-25 16:12:17 +000068- ``-Wobjc-messaging-id`` is a new, non-default warning that warns about
69 message sends to unqualified ``id`` in Objective-C. This warning is useful
70 for projects that would like to avoid any potential future compiler
71 errors/warnings, as the system frameworks might add a method with the same
72 selector which could make the message send to ``id`` ambiguous.
73
Roman Lebedev6aa34aa2017-09-07 22:14:25 +000074- ``-Wtautological-compare`` now warns when comparing an unsigned integer and 0
75 regardless of whether the constant is signed or unsigned."
76
77- ``-Wtautological-compare`` now warns about comparing a signed integer and 0
78 when the signed integer is coerced to an unsigned type for the comparison.
79 ``-Wsign-compare`` was adjusted not to warn in this case.
80
Erich Keaneb0c78092017-07-26 18:04:45 +000081Non-comprehensive list of changes in this release
82-------------------------------------------------
83
Sylvestre Ledru31f4fee2017-09-05 13:56:40 +000084- Bitrig OS was merged back into OpenBSD, so Bitrig support has been
Erich Keaneb0c78092017-07-26 18:04:45 +000085 removed from Clang/LLVM.
86
Sean Silvafe251442012-12-23 01:19:35 +000087New Compiler Flags
88------------------
89
Yuka Takahashi9b6b5d52017-08-11 09:44:42 +000090- --autocomplete was implemented to obtain a list of flags and its arguments. This is used for shell autocompletion.
Sylvestre Ledruf6b48972016-11-12 10:37:17 +000091
Joerg Sonnenbergerc9199682017-07-01 21:36:21 +000092Deprecated Compiler Flags
93-------------------------
94
95The following options are deprecated and ignored. They will be removed in
96future versions of Clang.
97
Hans Wennborgfbb21e02017-07-19 14:14:07 +000098- ...
Joerg Sonnenbergerc9199682017-07-01 21:36:21 +000099
Tyler Nowickidb2668a2014-06-18 00:51:32 +0000100New Pragmas in Clang
101-----------------------
102
Rafael Espindolaaf742502014-08-22 21:59:11 +0000103Clang now supports the ...
Mark Heffernanbd26f5e2014-07-21 18:08:34 +0000104
Paul Robinsonf9ede1c2016-07-18 17:19:12 +0000105
106Attribute Changes in Clang
107--------------------------
108
Erik Pilkington1b003722017-08-08 17:09:09 +0000109- The presence of __attribute__((availability(...))) on a declaration no longer
110 implies default visibility for that declaration on macOS.
111
Hans Wennborgfbb21e02017-07-19 14:14:07 +0000112- ...
Paul Robinsonf9ede1c2016-07-18 17:19:12 +0000113
Hans Wennborg02dc0002014-08-05 00:21:23 +0000114Windows Support
115---------------
116
Rafael Espindolaaf742502014-08-22 21:59:11 +0000117Clang's support for building native Windows programs ...
Hans Wennborg02dc0002014-08-05 00:21:23 +0000118
119
Renato Golinf2fcddb2013-12-13 09:27:34 +0000120C Language Changes in Clang
121---------------------------
122
Hans Wennborg60d06bf2016-07-18 18:05:19 +0000123- ...
Pirama Arumuga Nainarc85c8532016-06-21 16:09:30 +0000124
Renato Golinf2fcddb2013-12-13 09:27:34 +0000125...
126
Sean Silvafe251442012-12-23 01:19:35 +0000127C11 Feature Support
128^^^^^^^^^^^^^^^^^^^
129
130...
131
132C++ Language Changes in Clang
133-----------------------------
134
Richard Smith8eb53c82016-05-05 18:40:37 +0000135...
136
137C++1z Feature Support
Sean Silvafe251442012-12-23 01:19:35 +0000138^^^^^^^^^^^^^^^^^^^^^
139
140...
141
142Objective-C Language Changes in Clang
143-------------------------------------
144
145...
146
Erik Schnetter489700d2013-11-11 06:36:33 +0000147OpenCL C Language Changes in Clang
148----------------------------------
149
Bill Wendling0a794a4b2013-11-20 10:13:37 +0000150...
Erik Schnetter489700d2013-11-11 06:36:33 +0000151
Alexey Bataev44b67502016-05-31 11:17:08 +0000152OpenMP Support in Clang
153----------------------------------
154
Hans Wennborg60d06bf2016-07-18 18:05:19 +0000155...
Alexey Bataev44b67502016-05-31 11:17:08 +0000156
Sean Silvafe251442012-12-23 01:19:35 +0000157Internal API Changes
158--------------------
159
Hans Wennborg159d6ad2017-01-12 21:55:16 +0000160These are major API changes that have happened since the 4.0.0 release of
Sean Silvafe251442012-12-23 01:19:35 +0000161Clang. If upgrading an external codebase that uses Clang as a library,
162this section should help get you past the largest hurdles of upgrading.
163
Vedant Kumar5fb00e42016-07-27 23:01:55 +0000164- ...
Richard Smitha0334a92015-05-14 00:22:12 +0000165
Aaron Ballmancdc43af2015-09-17 13:47:22 +0000166AST Matchers
167------------
Aaron Ballmancdc43af2015-09-17 13:47:22 +0000168
Manuel Klimek696e5052017-08-02 13:04:44 +0000169The hasDeclaration matcher now works the same for Type and QualType and only
170ever looks through one level of sugaring in a limited number of cases.
Aaron Ballmancdc43af2015-09-17 13:47:22 +0000171
Manuel Klimek696e5052017-08-02 13:04:44 +0000172There are two main patterns affected by this:
173
174- qualType(hasDeclaration(recordDecl(...))): previously, we would look through
175 sugar like TypedefType to get at the underlying recordDecl; now, we need
176 to explicitly remove the sugaring:
177 qualType(hasUnqualifiedDesugaredType(hasDeclaration(recordDecl(...))))
178
179- hasType(recordDecl(...)): hasType internally uses hasDeclaration; previously,
180 this matcher used to match for example TypedefTypes of the RecordType, but
181 after the change they don't; to fix, use:
182
183::
184 hasType(hasUnqualifiedDesugaredType(
185 recordType(hasDeclaration(recordDecl(...)))))
186
187- templateSpecializationType(hasDeclaration(classTemplateDecl(...))):
188 previously, we would directly match the underlying ClassTemplateDecl;
189 now, we can explicitly match the ClassTemplateSpecializationDecl, but that
190 requires to explicitly get the ClassTemplateDecl:
191
192::
193 templateSpecializationType(hasDeclaration(
194 classTemplateSpecializationDecl(
195 hasSpecializedTemplate(classTemplateDecl(...)))))
Sylvestre Ledru72e3fa72017-03-14 09:43:55 +0000196
197clang-format
198------------
199
Sylvestre Ledru31f4fee2017-09-05 13:56:40 +0000200* Option *IndentPPDirectives* added to indent preprocessor directives on
201 conditionals.
202
203 +----------------------+----------------------+
204 | Before | After |
205 +======================+======================+
206 | .. code-block:: c++ | .. code-block:: c++ |
207 | | |
208 | #if FOO | #if FOO |
209 | #if BAR | # if BAR |
210 | #include <foo> | # include <foo> |
211 | #endif | # endif |
212 | #endif | #endif |
213 +----------------------+----------------------+
Sylvestre Ledru72e3fa72017-03-14 09:43:55 +0000214
Sylvestre Ledrud23dd6c2017-08-12 15:15:10 +0000215* Option -verbose added to the command line.
216 Shows the list of processed files.
217
Ted Kremenek3a2291b2013-04-24 07:33:52 +0000218libclang
219--------
220
Bill Wendling61f44cc2013-06-04 06:17:46 +0000221...
Ted Kremenek3a2291b2013-04-24 07:33:52 +0000222
Sylvestre Ledruea49d3a2016-08-06 20:23:54 +0000223
Anna Zaksb6219a92013-04-25 23:14:38 +0000224Static Analyzer
Ted Kremenek004e8232013-04-26 00:01:34 +0000225---------------
Anna Zaksb6219a92013-04-25 23:14:38 +0000226
Bill Wendling0a794a4b2013-11-20 10:13:37 +0000227...
Ted Kremenek004e8232013-04-26 00:01:34 +0000228
Vedant Kumar840c2c72017-06-13 02:52:31 +0000229Undefined Behavior Sanitizer (UBSan)
230------------------------------------
231
Vedant Kumara0c36712017-08-02 18:10:31 +0000232...
Vedant Kumar840c2c72017-06-13 02:52:31 +0000233
Ted Kremenek004e8232013-04-26 00:01:34 +0000234Core Analysis Improvements
235==========================
236
Bill Wendling61f44cc2013-06-04 06:17:46 +0000237- ...
Ted Kremenek004e8232013-04-26 00:01:34 +0000238
239New Issues Found
240================
241
Bill Wendling61f44cc2013-06-04 06:17:46 +0000242- ...
Anna Zaksb6219a92013-04-25 23:14:38 +0000243
Sean Silvafe251442012-12-23 01:19:35 +0000244Python Binding Changes
245----------------------
246
247The following methods have been added:
248
249- ...
250
251Significant Known Problems
252==========================
253
254Additional Information
255======================
256
257A wide variety of additional information is available on the `Clang web
258page <http://clang.llvm.org/>`_. The web page contains versions of the
259API documentation which are up-to-date with the Subversion version of
260the source code. You can access versions of these documents specific to
261this release by going into the "``clang/docs/``" directory in the Clang
262tree.
263
264If you have any questions or comments about Clang, please feel free to
265contact us via the `mailing
Tanya Lattner4a08e932015-08-05 03:55:23 +0000266list <http://lists.llvm.org/mailman/listinfo/cfe-dev>`_.