1 =======================
2 Clang 3.6 Release Notes
3 =======================
9 Written by the `LLVM Team <http://llvm.org/>`_
14 This document contains the release notes for the Clang C/C++/Objective-C
15 frontend, part of the LLVM Compiler Infrastructure, release 3.6. Here we
16 describe the status of Clang in some detail, including major
17 improvements from the previous release and new feature work. For the
18 general LLVM release notes, see `the LLVM
19 documentation <http://llvm.org/releases/3.6.0/docs/ReleaseNotes.html>`_.
20 All LLVM releases may be downloaded from the `LLVM releases web
21 site <http://llvm.org/releases/>`_.
23 For more information about Clang or LLVM, including information about
24 the latest release, please check out the main please see the `Clang Web
25 Site <http://clang.llvm.org>`_ or the `LLVM Web
26 Site <http://llvm.org>`_.
28 What's New in Clang 3.6?
29 ========================
31 Some of the major new features and improvements to Clang are listed
32 here. Generic improvements to Clang as a whole or to its underlying
33 infrastructure are described first, followed by language-specific
34 sections with improvements to Clang's support for those languages.
39 - The __has_attribute built-in macro no longer queries for attributes across
40 multiple attribute syntaxes (GNU, C++11, __declspec, etc). Instead, it only
41 queries GNU-style attributes. With the addition of __has_cpp_attribute and
42 __has_declspec_attribute, this allows for more precise coverage of attribute
45 - clang-format now supports formatting Java code.
48 Improvements to Clang's diagnostics
49 -----------------------------------
51 Clang's diagnostics are constantly being improved to catch more issues,
52 explain them more clearly, and provide more accurate source information
53 about them. The improvements since the 3.5 release include:
55 - Smarter typo correction. Clang now tries a bit harder to give a usable
56 suggestion in more cases, and can now successfully recover in more
57 situations where the suggestion changes how an expression is parsed.
63 The ``-fpic`` option now uses small pic on PowerPC.
66 The __EXCEPTIONS macro
67 ----------------------
68 ``__EXCEPTIONS`` is now defined when landing pads are emitted, not when
69 C++ exceptions are enabled. The two can be different in Objective-C files:
70 If C++ exceptions are disabled but Objective-C exceptions are enabled,
71 landing pads will be emitted. Clang 3.6 is switching the behavior of
72 ``__EXCEPTIONS``. Clang 3.5 confusingly changed the behavior of
73 ``has_feature(cxx_exceptions)``, which used to be set if landing pads were
74 emitted, but is now set if C++ exceptions are enabled. So there are 3 cases:
77 ``__EXCEPTIONS`` is set if C++ exceptions are enabled, ``cxx_exceptions``
78 enabled if C++ or ObjC exceptions are enabled
81 ``__EXCEPTIONS`` is set if C++ exceptions are enabled, ``cxx_exceptions``
82 enabled if C++ exceptions are enabled
85 ``__EXCEPTIONS`` is set if C++ or ObjC exceptions are enabled,
86 ``cxx_exceptions`` enabled if C++ exceptions are enabled
88 To reliably test if C++ exceptions are enabled, use
89 ``__EXCEPTIONS && __has_feature(cxx_exceptions)``, else things won't work in
90 all versions of Clang in Objective-C++ files.
94 -----------------------
96 Clang now supports the `#pragma unroll` and `#pragma nounroll` directives to
97 specify loop unrolling optimization hints. Placed just prior to the desired
98 loop, `#pragma unroll` directs the loop unroller to attempt to fully unroll the
99 loop. The pragma may also be specified with a positive integer parameter
100 indicating the desired unroll count: `#pragma unroll _value_`. The unroll count
101 parameter can be optionally enclosed in parentheses. The directive `#pragma
102 nounroll` indicates that the loop should not be unrolled. These unrolling hints
103 may also be expressed using the `#pragma clang loop` directive. See the Clang
105 <http://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-loop-hint-optimizations>`_
111 - Many, many bug fixes.
113 - Clang can now self-host using the ``msvc`` environment on x86 and x64
114 Windows. This means that Microsoft C++ ABI is more or less feature-complete,
115 minus exception support.
117 - Added more MSVC compatibility hacks, such as allowing more lookup into
118 dependent bases of class templates when there is a known template pattern.
119 As a result, applications using Active Template Library (ATL) or Windows
120 Runtime Library (WRL) headers should compile correctly.
122 - Added support for the Visual C++ ``__super`` keyword.
124 - Added support for MSVC's ``__vectorcall`` calling convention, which is used
125 in the upcoming Visual Studio 2015 STL.
127 - Added basic support for DWARF debug information in COFF files.
130 C Language Changes in Clang
131 ---------------------------
133 - The default language mode for C compilations with Clang has been changed from
134 C99 with GNU extensions to C11 with GNU extensions. C11 is largely
135 backwards-compatible with C99, but if you want to restore the former behavior
136 you can do so with the `-std=gnu99` flag.
141 - Clang now provides an implementation of the standard C11 header `<stdatomic.h>`.
143 C++ Language Changes in Clang
144 -----------------------------
146 - An `upcoming change to C++ <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3922.html>_`
147 changes the semantics of certain deductions of `auto` from a braced initializer
148 list. Following the intent of the C++ committee, this change will be applied to
149 our C++11 and C++14 modes as well as our experimental C++17 mode. Clang 3.6
150 does not yet implement this change, but to provide a transition period, it
151 warns on constructs whose meaning will change. The fix in all cases is to
152 add an `=` prior to the left brace.
154 - Clang now supports putting identical constructors and destructors in
155 the C5/D5 comdat, reducing code duplication.
157 - Clang will put individual ``.init_array/.ctors`` sections in
158 comdats, reducing code duplication and speeding up startup.
161 C++17 Feature Support
162 ^^^^^^^^^^^^^^^^^^^^^
164 Clang has experimental support for some proposed C++1z (tentatively, C++17)
165 features. This support can be enabled using the `-std=c++1z` flag.
167 New in Clang 3.6 is support for:
171 - `u8` character literals
173 - Nested namespace definitions: `namespace A::B { ... }` as a shorthand for
174 `namespace A { namespace B { ... } }`
176 - Attributes for namespaces and enumerators
178 - Constant evaluation for all non-type template arguments
180 Note that these features may be changed or removed in future Clang releases
183 Support for `for (identifier : range)` as a synonym for
184 `for (auto &&identifier : range)` has been removed as it is no longer currently
185 considered for C++17.
187 For more details on C++ feature support, see
188 `the C++ status page <http://clang.llvm.org/cxx_status.html>`_.
191 OpenMP Language Changes in Clang
192 --------------------------------
194 Clang 3.6 contains codegen for many individual OpenMP pragmas, but combinations are not completed yet.
195 We plan to continue codegen code drop aiming for completion in 3.7. Please see this link for up-to-date
196 `status <https://github.com/clang-omp/clang/wiki/Status-of-supported-OpenMP-constructs>_`.
197 LLVM's OpenMP runtime library, originally developed by Intel, has been modified to work on ARM, PowerPC,
198 as well as X86. The Runtime Library's compatibility with GCC 4.9 is improved
199 - missed entry points added, barrier and fork/join code improved, one more type of barrier enabled.
200 Support for ppc64le architecture is now available and automatically detected when using cmake system.
201 Using makefile the new "ppc64le" arch type is available.
202 Contributors to this work include AMD, Argonne National Lab., IBM, Intel, Texas Instruments, University of Houston and many others.
205 Additional Information
206 ======================
208 A wide variety of additional information is available on the `Clang web
209 page <http://clang.llvm.org/>`_. The web page contains versions of the
210 API documentation which are up-to-date with the Subversion version of
211 the source code. You can access versions of these documents specific to
212 this release by going into the "``clang/docs/``" directory in the Clang
215 If you have any questions or comments about Clang, please feel free to
216 contact us via the `mailing
217 list <http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev>`_.