Home | History | Annotate | Download | only in docs
      1 =====================================
      2 Clang 3.9 (In-Progress) Release Notes
      3 =====================================
      4 
      5 .. contents::
      6    :local:
      7    :depth: 2
      8 
      9 Written by the `LLVM Team <http://llvm.org/>`_
     10 
     11 .. warning::
     12 
     13    These are in-progress notes for the upcoming Clang 3.9 release. You may
     14    prefer the `Clang 3.8 Release Notes
     15    <http://llvm.org/releases/3.8.0/tools/clang/docs/ReleaseNotes.html>`_.
     16 
     17 Introduction
     18 ============
     19 
     20 This document contains the release notes for the Clang C/C++/Objective-C
     21 frontend, part of the LLVM Compiler Infrastructure, release 3.9. Here we
     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 
     39 What's New in Clang 3.9?
     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 
     50 - Clang will no longer passes --build-id by default to the linker. In modern
     51   linkers that is a relatively expensive option. It can be passed explicitly
     52   with -Wl,--build-id. To have clang always pass it, build clang with
     53   -DENABLE_LINKER_BUILD_ID.
     54 
     55 Improvements to Clang's diagnostics
     56 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     57 
     58 Clang's diagnostics are constantly being improved to catch more issues,
     59 explain them more clearly, and provide more accurate source information
     60 about them. The improvements since the 3.7 release include:
     61 
     62 -  ...
     63 
     64 New Compiler Flags
     65 ------------------
     66 
     67 The option ....
     68 
     69 
     70 New Pragmas in Clang
     71 -----------------------
     72 
     73 Clang now supports the ...
     74 
     75 Windows Support
     76 ---------------
     77 
     78 Clang's support for building native Windows programs ...
     79 
     80 TLS is enabled for Cygwin defaults to -femulated-tls.
     81 
     82 
     83 C Language Changes in Clang
     84 ---------------------------
     85 The -faltivec and -maltivec flags no longer silently include altivec.h on Power platforms.
     86 
     87 `RenderScript
     88 <https://developer.android.com/guide/topics/renderscript/compute.html>`_
     89 support added to the Frontend and enabled by the '-x renderscript' option or
     90 the '.rs' file extension.
     91 
     92 ...
     93 
     94 C11 Feature Support
     95 ^^^^^^^^^^^^^^^^^^^
     96 
     97 ...
     98 
     99 C++ Language Changes in Clang
    100 -----------------------------
    101 
    102 - Clang now enforces the rule that a *using-declaration* cannot name an enumerator of a
    103   scoped enumeration.
    104 
    105   .. code-block:: c++
    106 
    107     namespace Foo { enum class E { e }; }
    108     namespace Bar {
    109       using Foo::E::e; // error
    110       constexpr auto e = Foo::E::e; // ok
    111     }
    112 
    113 - Clang now enforces the rule that an enumerator of an unscoped enumeration declared at
    114   class scope can only be named by a *using-declaration* in a derived class.
    115 
    116   .. code-block:: c++
    117 
    118     class Foo { enum E { e }; }
    119     using Foo::e; // error
    120     static constexpr auto e = Foo::e; // ok
    121 
    122 ...
    123 
    124 C++1z Feature Support
    125 ^^^^^^^^^^^^^^^^^^^^^
    126 
    127 Clang's experimental support for the upcoming C++1z standard can be enabled with ``-std=c++1z``.
    128 Changes to C++1z features since Clang 3.8:
    129 
    130 - The ``[[fallthrough]]``, ``[[nodiscard]]``, and ``[[maybe_unused]]`` attributes are
    131   supported in C++11 onwards, and are largely synonymous with Clang's existing attributes
    132   ``[[clang::fallthrough]]``, ``[[gnu::warn_unused_result]]``, and ``[[gnu::unused]]``.
    133   Use ``-Wimplicit-fallthrough`` to warn on unannotated fallthrough within ``switch``
    134   statements.
    135 
    136 - In C++1z mode, aggregate initialization can be performed for classes with base classes:
    137 
    138   .. code-block:: c++
    139 
    140     struct A { int n; };
    141     struct B : A { int x, y; };
    142     B b = { 1, 2, 3 }; // b.n == 1, b.x == 2, b.y == 3
    143 
    144 - The range in a range-based ``for`` statement can have different types for its ``begin``
    145   and ``end`` iterators. This is permitted as an extension in C++11 onwards.
    146 
    147 - Lambda-expressions can explicitly capture ``*this`` (to capture the surrounding object
    148   by copy). This is permitted as an extension in C++11 onwards.
    149 
    150 - Objects of enumeration type can be direct-list-initialized from a value of the underlying
    151   type. ``E{n}`` is equivalent to ``E(n)``, except that it implies a check for a narrowing
    152   conversion.
    153 
    154 - Unary *fold-expression*\s over an empty pack are now rejected for all operators
    155   other than ``&&``, ``||``, and ``,``.
    156 
    157 ...
    158 
    159 Objective-C Language Changes in Clang
    160 -------------------------------------
    161 
    162 ...
    163 
    164 OpenCL C Language Changes in Clang
    165 ----------------------------------
    166 
    167 ...
    168 
    169 OpenMP Support in Clang
    170 ----------------------------------
    171 
    172 Added support for all non-offloading features from OpenMP 4.5, including using
    173 data members in private clauses of non-static member functions. Additionally,
    174 data members can be used as loop control variables in loop-based directives.
    175 
    176 Currently Clang supports OpenMP 3.1 and all non-offloading features of
    177 OpenMP 4.0/4.5. Offloading features are under development. Clang defines macro
    178 _OPENMP and sets it to OpenMP 3.1 (in accordance with OpenMP standard) by
    179 default. User may change this value using ``-fopenmp-version=[31|40|45]`` option.
    180 
    181 The codegen for OpenMP constructs was significantly improved to produce much
    182 more stable and faster code.
    183 
    184 Internal API Changes
    185 --------------------
    186 
    187 These are major API changes that have happened since the 3.8 release of
    188 Clang. If upgrading an external codebase that uses Clang as a library,
    189 this section should help get you past the largest hurdles of upgrading.
    190 
    191 -  ...
    192 
    193 AST Matchers
    194 ------------
    195 
    196 - has and hasAnyArgument: Matchers no longer ignores parentheses and implicit
    197   casts on the argument before applying the inner matcher. The fix was done to
    198   allow for greater control by the user. In all existing checkers that use this
    199   matcher all instances of code ``hasAnyArgument(<inner matcher>)`` or
    200   ``has(<inner matcher>)`` must be changed to
    201   ``hasAnyArgument(ignoringParenImpCasts(<inner matcher>))`` or
    202   ``has(ignoringParenImpCasts(<inner matcher>))``.
    203 
    204 ...
    205 
    206 libclang
    207 --------
    208 
    209 ...
    210 
    211 Static Analyzer
    212 ---------------
    213 
    214 ...
    215 
    216 Core Analysis Improvements
    217 ==========================
    218 
    219 - ...
    220 
    221 New Issues Found
    222 ================
    223 
    224 - ...
    225 
    226 Python Binding Changes
    227 ----------------------
    228 
    229 The following methods have been added:
    230 
    231 -  ...
    232 
    233 Significant Known Problems
    234 ==========================
    235 
    236 Additional Information
    237 ======================
    238 
    239 A wide variety of additional information is available on the `Clang web
    240 page <http://clang.llvm.org/>`_. The web page contains versions of the
    241 API documentation which are up-to-date with the Subversion version of
    242 the source code. You can access versions of these documents specific to
    243 this release by going into the "``clang/docs/``" directory in the Clang
    244 tree.
    245 
    246 If you have any questions or comments about Clang, please feel free to
    247 contact us via the `mailing
    248 list <http://lists.llvm.org/mailman/listinfo/cfe-dev>`_.
    249