Sean Silva | b045514 | 2013-01-02 22:05:33 +0000 | [diff] [blame] | 1 | ===================================== |
Hans Wennborg | ac3ddff | 2016-01-13 17:32:59 +0000 | [diff] [blame] | 2 | Clang 3.9 (In-Progress) Release Notes |
Sean Silva | b045514 | 2013-01-02 22:05:33 +0000 | [diff] [blame] | 3 | ===================================== |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 4 | |
| 5 | .. contents:: |
| 6 | :local: |
| 7 | :depth: 2 |
| 8 | |
| 9 | Written by the `LLVM Team <http://llvm.org/>`_ |
| 10 | |
| 11 | .. warning:: |
| 12 | |
Hans Wennborg | ac3ddff | 2016-01-13 17:32:59 +0000 | [diff] [blame] | 13 | These are in-progress notes for the upcoming Clang 3.9 release. You may |
Hans Wennborg | b2ed61a | 2016-03-09 17:26:46 +0000 | [diff] [blame] | 14 | prefer the `Clang 3.8 Release Notes |
| 15 | <http://llvm.org/releases/3.8.0/tools/clang/docs/ReleaseNotes.html>`_. |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 16 | |
| 17 | Introduction |
| 18 | ============ |
| 19 | |
| 20 | This document contains the release notes for the Clang C/C++/Objective-C |
Hans Wennborg | ac3ddff | 2016-01-13 17:32:59 +0000 | [diff] [blame] | 21 | frontend, part of the LLVM Compiler Infrastructure, release 3.9. Here we |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 22 | describe the status of Clang in some detail, including major |
| 23 | improvements from the previous release and new feature work. For the |
| 24 | general LLVM release notes, see `the LLVM |
| 25 | documentation <http://llvm.org/docs/ReleaseNotes.html>`_. All LLVM |
| 26 | releases may be downloaded from the `LLVM releases web |
| 27 | site <http://llvm.org/releases/>`_. |
| 28 | |
| 29 | For more information about Clang or LLVM, including information about |
| 30 | the latest release, please check out the main please see the `Clang Web |
| 31 | Site <http://clang.llvm.org>`_ or the `LLVM Web |
| 32 | Site <http://llvm.org>`_. |
| 33 | |
| 34 | Note that if you are reading this file from a Subversion checkout or the |
| 35 | main Clang web page, this document applies to the *next* release, not |
| 36 | the current one. To see the release notes for a specific release, please |
| 37 | see the `releases page <http://llvm.org/releases/>`_. |
| 38 | |
Hans Wennborg | ac3ddff | 2016-01-13 17:32:59 +0000 | [diff] [blame] | 39 | What's New in Clang 3.9? |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 40 | ======================== |
| 41 | |
| 42 | Some of the major new features and improvements to Clang are listed |
| 43 | here. Generic improvements to Clang as a whole or to its underlying |
| 44 | infrastructure are described first, followed by language-specific |
| 45 | sections with improvements to Clang's support for those languages. |
| 46 | |
| 47 | Major New Features |
| 48 | ------------------ |
| 49 | |
Hans Wennborg | e904ea2 | 2015-07-14 22:52:36 +0000 | [diff] [blame] | 50 | - Feature1... |
Rafael Espindola | 3497069 | 2013-12-12 16:07:11 +0000 | [diff] [blame] | 51 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 52 | Improvements to Clang's diagnostics |
| 53 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 54 | |
| 55 | Clang's diagnostics are constantly being improved to catch more issues, |
| 56 | explain them more clearly, and provide more accurate source information |
Hans Wennborg | eb2bd9a | 2015-08-12 16:40:42 +0000 | [diff] [blame] | 57 | about them. The improvements since the 3.7 release include: |
Sylvestre Ledru | 5e43f74 | 2014-07-14 18:30:23 +0000 | [diff] [blame] | 58 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 59 | - ... |
| 60 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 61 | New Compiler Flags |
| 62 | ------------------ |
| 63 | |
Rafael Espindola | af74250 | 2014-08-22 21:59:11 +0000 | [diff] [blame] | 64 | The option .... |
Renato Golin | 1588cda | 2013-12-11 09:35:10 +0000 | [diff] [blame] | 65 | |
Sylvestre Ledru | 0e767b1 | 2014-07-14 18:34:37 +0000 | [diff] [blame] | 66 | |
Tyler Nowicki | db2668a | 2014-06-18 00:51:32 +0000 | [diff] [blame] | 67 | New Pragmas in Clang |
| 68 | ----------------------- |
| 69 | |
Rafael Espindola | af74250 | 2014-08-22 21:59:11 +0000 | [diff] [blame] | 70 | Clang now supports the ... |
Mark Heffernan | bd26f5e | 2014-07-21 18:08:34 +0000 | [diff] [blame] | 71 | |
Hans Wennborg | 02dc000 | 2014-08-05 00:21:23 +0000 | [diff] [blame] | 72 | Windows Support |
| 73 | --------------- |
| 74 | |
Rafael Espindola | af74250 | 2014-08-22 21:59:11 +0000 | [diff] [blame] | 75 | Clang's support for building native Windows programs ... |
Hans Wennborg | 02dc000 | 2014-08-05 00:21:23 +0000 | [diff] [blame] | 76 | |
NAKAMURA Takumi | 33ff1dd | 2016-01-16 03:44:52 +0000 | [diff] [blame] | 77 | TLS is enabled for Cygwin defaults to -femulated-tls. |
| 78 | |
Hans Wennborg | 02dc000 | 2014-08-05 00:21:23 +0000 | [diff] [blame] | 79 | |
Renato Golin | f2fcddb | 2013-12-13 09:27:34 +0000 | [diff] [blame] | 80 | C Language Changes in Clang |
| 81 | --------------------------- |
Eric Christopher | 37df19e | 2016-03-24 01:28:25 +0000 | [diff] [blame] | 82 | The -faltivec and -maltivec flags no longer silently include altivec.h on Power platforms. |
Renato Golin | f2fcddb | 2013-12-13 09:27:34 +0000 | [diff] [blame] | 83 | |
| 84 | ... |
| 85 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 86 | C11 Feature Support |
| 87 | ^^^^^^^^^^^^^^^^^^^ |
| 88 | |
| 89 | ... |
| 90 | |
| 91 | C++ Language Changes in Clang |
| 92 | ----------------------------- |
| 93 | |
Richard Smith | 8eb53c8 | 2016-05-05 18:40:37 +0000 | [diff] [blame] | 94 | - Clang now enforces the rule that a *using-declaration* cannot name an enumerator of a |
| 95 | scoped enumeration. |
Rafael Espindola | 9ca6e81 | 2013-04-09 12:51:24 +0000 | [diff] [blame] | 96 | |
Aaron Ballman | dc76a4d | 2016-05-06 11:56:57 +0000 | [diff] [blame] | 97 | .. code-block:: c++ |
Richard Smith | 8eb53c8 | 2016-05-05 18:40:37 +0000 | [diff] [blame] | 98 | |
| 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 Ballman | dc76a4d | 2016-05-06 11:56:57 +0000 | [diff] [blame] | 108 | .. code-block:: c++ |
Richard Smith | 8eb53c8 | 2016-05-05 18:40:37 +0000 | [diff] [blame] | 109 | |
| 110 | class Foo { enum E { e }; } |
| 111 | using Foo::e; // error |
| 112 | static constexpr auto e = Foo::e; // ok |
| 113 | |
| 114 | ... |
| 115 | |
| 116 | C++1z Feature Support |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 117 | ^^^^^^^^^^^^^^^^^^^^^ |
| 118 | |
Richard Smith | 8eb53c8 | 2016-05-05 18:40:37 +0000 | [diff] [blame] | 119 | Clang's experimental support for the upcoming C++1z standard can be enabled with ``-std=c++1z``. |
| 120 | Changes 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 Ballman | dc76a4d | 2016-05-06 11:56:57 +0000 | [diff] [blame] | 130 | .. code-block:: c++ |
Richard Smith | 8eb53c8 | 2016-05-05 18:40:37 +0000 | [diff] [blame] | 131 | |
Richard Smith | 1a015f5 | 2016-05-06 16:48:29 +0000 | [diff] [blame] | 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 |
Richard Smith | 8eb53c8 | 2016-05-05 18:40:37 +0000 | [diff] [blame] | 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 Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 149 | ... |
| 150 | |
| 151 | Objective-C Language Changes in Clang |
| 152 | ------------------------------------- |
| 153 | |
| 154 | ... |
| 155 | |
Erik Schnetter | 489700d | 2013-11-11 06:36:33 +0000 | [diff] [blame] | 156 | OpenCL C Language Changes in Clang |
| 157 | ---------------------------------- |
| 158 | |
Bill Wendling | 0a794a4b | 2013-11-20 10:13:37 +0000 | [diff] [blame] | 159 | ... |
Erik Schnetter | 489700d | 2013-11-11 06:36:33 +0000 | [diff] [blame] | 160 | |
Alexey Bataev | 44b6750 | 2016-05-31 11:17:08 +0000 | [diff] [blame^] | 161 | OpenMP Support in Clang |
| 162 | ---------------------------------- |
| 163 | |
| 164 | Added support for all non-offloading features from OpenMP 4.5, including using |
| 165 | data members in private clauses of non-static member functions. Additionally, |
| 166 | data members can be used as loop control variables in loop-based directives. |
| 167 | |
| 168 | Currently Clang supports OpenMP 3.1 and all non-offloading features of |
| 169 | OpenMP 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 |
| 171 | default. User may change this value using ``-fopenmp-version=[31|40|45]`` option. |
| 172 | |
| 173 | The codegen for OpenMP constructs was significantly improved to produce much |
| 174 | more stable and faster code. |
| 175 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 176 | Internal API Changes |
| 177 | -------------------- |
| 178 | |
Hans Wennborg | ac3ddff | 2016-01-13 17:32:59 +0000 | [diff] [blame] | 179 | These are major API changes that have happened since the 3.8 release of |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 180 | Clang. If upgrading an external codebase that uses Clang as a library, |
| 181 | this section should help get you past the largest hurdles of upgrading. |
| 182 | |
Hans Wennborg | e904ea2 | 2015-07-14 22:52:36 +0000 | [diff] [blame] | 183 | - ... |
Richard Smith | a0334a9 | 2015-05-14 00:22:12 +0000 | [diff] [blame] | 184 | |
Aaron Ballman | cdc43af | 2015-09-17 13:47:22 +0000 | [diff] [blame] | 185 | AST Matchers |
| 186 | ------------ |
Aaron Ballman | cdc43af | 2015-09-17 13:47:22 +0000 | [diff] [blame] | 187 | |
Gabor Horvath | 1b654f2 | 2016-03-30 11:22:14 +0000 | [diff] [blame] | 188 | - 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 Ballman | cdc43af | 2015-09-17 13:47:22 +0000 | [diff] [blame] | 194 | ... |
| 195 | |
Ted Kremenek | 3a2291b | 2013-04-24 07:33:52 +0000 | [diff] [blame] | 196 | libclang |
| 197 | -------- |
| 198 | |
Bill Wendling | 61f44cc | 2013-06-04 06:17:46 +0000 | [diff] [blame] | 199 | ... |
Ted Kremenek | 3a2291b | 2013-04-24 07:33:52 +0000 | [diff] [blame] | 200 | |
Anna Zaks | b6219a9 | 2013-04-25 23:14:38 +0000 | [diff] [blame] | 201 | Static Analyzer |
Ted Kremenek | 004e823 | 2013-04-26 00:01:34 +0000 | [diff] [blame] | 202 | --------------- |
Anna Zaks | b6219a9 | 2013-04-25 23:14:38 +0000 | [diff] [blame] | 203 | |
Bill Wendling | 0a794a4b | 2013-11-20 10:13:37 +0000 | [diff] [blame] | 204 | ... |
Ted Kremenek | 004e823 | 2013-04-26 00:01:34 +0000 | [diff] [blame] | 205 | |
| 206 | Core Analysis Improvements |
| 207 | ========================== |
| 208 | |
Bill Wendling | 61f44cc | 2013-06-04 06:17:46 +0000 | [diff] [blame] | 209 | - ... |
Ted Kremenek | 004e823 | 2013-04-26 00:01:34 +0000 | [diff] [blame] | 210 | |
| 211 | New Issues Found |
| 212 | ================ |
| 213 | |
Bill Wendling | 61f44cc | 2013-06-04 06:17:46 +0000 | [diff] [blame] | 214 | - ... |
Anna Zaks | b6219a9 | 2013-04-25 23:14:38 +0000 | [diff] [blame] | 215 | |
Sean Silva | fe25144 | 2012-12-23 01:19:35 +0000 | [diff] [blame] | 216 | Python Binding Changes |
| 217 | ---------------------- |
| 218 | |
| 219 | The following methods have been added: |
| 220 | |
| 221 | - ... |
| 222 | |
| 223 | Significant Known Problems |
| 224 | ========================== |
| 225 | |
| 226 | Additional Information |
| 227 | ====================== |
| 228 | |
| 229 | A wide variety of additional information is available on the `Clang web |
| 230 | page <http://clang.llvm.org/>`_. The web page contains versions of the |
| 231 | API documentation which are up-to-date with the Subversion version of |
| 232 | the source code. You can access versions of these documents specific to |
| 233 | this release by going into the "``clang/docs/``" directory in the Clang |
| 234 | tree. |
| 235 | |
| 236 | If you have any questions or comments about Clang, please feel free to |
| 237 | contact us via the `mailing |
Tanya Lattner | 4a08e93 | 2015-08-05 03:55:23 +0000 | [diff] [blame] | 238 | list <http://lists.llvm.org/mailman/listinfo/cfe-dev>`_. |