1======================= 2Clang 3.6 Release Notes 3======================= 4 5.. contents:: 6 :local: 7 :depth: 2 8 9Written by the `LLVM Team <http://llvm.org/>`_ 10 11Introduction 12============ 13 14This document contains the release notes for the Clang C/C++/Objective-C 15frontend, part of the LLVM Compiler Infrastructure, release 3.6. Here we 16describe the status of Clang in some detail, including major 17improvements from the previous release and new feature work. For the 18general LLVM release notes, see `the LLVM 19documentation <http://llvm.org/releases/3.6.0/docs/ReleaseNotes.html>`_. 20All LLVM releases may be downloaded from the `LLVM releases web 21site <http://llvm.org/releases/>`_. 22 23For more information about Clang or LLVM, including information about 24the latest release, please check out the main please see the `Clang Web 25Site <http://clang.llvm.org>`_ or the `LLVM Web 26Site <http://llvm.org>`_. 27 28What's New in Clang 3.6? 29======================== 30 31Some of the major new features and improvements to Clang are listed 32here. Generic improvements to Clang as a whole or to its underlying 33infrastructure are described first, followed by language-specific 34sections with improvements to Clang's support for those languages. 35 36Major New Features 37------------------ 38 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 43 syntax querying. 44 45- clang-format now supports formatting Java code. 46 47 48Improvements to Clang's diagnostics 49----------------------------------- 50 51Clang's diagnostics are constantly being improved to catch more issues, 52explain them more clearly, and provide more accurate source information 53about them. The improvements since the 3.5 release include: 54 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. 58 59 60New Compiler Flags 61------------------ 62 63The ``-fpic`` option now uses small pic on PowerPC. 64 65 66The __EXCEPTIONS macro 67---------------------- 68``__EXCEPTIONS`` is now defined when landing pads are emitted, not when 69C++ exceptions are enabled. The two can be different in Objective-C files: 70If C++ exceptions are disabled but Objective-C exceptions are enabled, 71landing 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 74emitted, but is now set if C++ exceptions are enabled. So there are 3 cases: 75 76Clang before 3.5: 77 ``__EXCEPTIONS`` is set if C++ exceptions are enabled, ``cxx_exceptions`` 78 enabled if C++ or ObjC exceptions are enabled 79 80Clang 3.5: 81 ``__EXCEPTIONS`` is set if C++ exceptions are enabled, ``cxx_exceptions`` 82 enabled if C++ exceptions are enabled 83 84Clang 3.6: 85 ``__EXCEPTIONS`` is set if C++ or ObjC exceptions are enabled, 86 ``cxx_exceptions`` enabled if C++ exceptions are enabled 87 88To reliably test if C++ exceptions are enabled, use 89``__EXCEPTIONS && __has_feature(cxx_exceptions)``, else things won't work in 90all versions of Clang in Objective-C++ files. 91 92 93New Pragmas in Clang 94----------------------- 95 96Clang now supports the `#pragma unroll` and `#pragma nounroll` directives to 97specify loop unrolling optimization hints. Placed just prior to the desired 98loop, `#pragma unroll` directs the loop unroller to attempt to fully unroll the 99loop. The pragma may also be specified with a positive integer parameter 100indicating the desired unroll count: `#pragma unroll _value_`. The unroll count 101parameter can be optionally enclosed in parentheses. The directive `#pragma 102nounroll` indicates that the loop should not be unrolled. These unrolling hints 103may also be expressed using the `#pragma clang loop` directive. See the Clang 104`language extensions 105<http://clang.llvm.org/docs/LanguageExtensions.html#extensions-for-loop-hint-optimizations>`_ 106for details. 107 108Windows Support 109--------------- 110 111- Many, many bug fixes. 112 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. 116 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. 121 122- Added support for the Visual C++ ``__super`` keyword. 123 124- Added support for MSVC's ``__vectorcall`` calling convention, which is used 125 in the upcoming Visual Studio 2015 STL. 126 127- Added basic support for DWARF debug information in COFF files. 128 129 130C Language Changes in Clang 131--------------------------- 132 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. 137 138C11 Feature Support 139^^^^^^^^^^^^^^^^^^^ 140 141- Clang now provides an implementation of the standard C11 header `<stdatomic.h>`. 142 143C++ Language Changes in Clang 144----------------------------- 145 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. 153 154- Clang now supports putting identical constructors and destructors in 155 the C5/D5 comdat, reducing code duplication. 156 157- Clang will put individual ``.init_array/.ctors`` sections in 158 comdats, reducing code duplication and speeding up startup. 159 160 161C++17 Feature Support 162^^^^^^^^^^^^^^^^^^^^^ 163 164Clang has experimental support for some proposed C++1z (tentatively, C++17) 165features. This support can be enabled using the `-std=c++1z` flag. 166 167New in Clang 3.6 is support for: 168 169- Fold expressions 170 171- `u8` character literals 172 173- Nested namespace definitions: `namespace A::B { ... }` as a shorthand for 174 `namespace A { namespace B { ... } }` 175 176- Attributes for namespaces and enumerators 177 178- Constant evaluation for all non-type template arguments 179 180Note that these features may be changed or removed in future Clang releases 181without notice. 182 183Support for `for (identifier : range)` as a synonym for 184`for (auto &&identifier : range)` has been removed as it is no longer currently 185considered for C++17. 186 187For more details on C++ feature support, see 188`the C++ status page <http://clang.llvm.org/cxx_status.html>`_. 189 190 191OpenMP Language Changes in Clang 192-------------------------------- 193 194Clang 3.6 contains codegen for many individual OpenMP pragmas, but combinations are not completed yet. 195We 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>_`. 197LLVM's OpenMP runtime library, originally developed by Intel, has been modified to work on ARM, PowerPC, 198as 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. 200Support for ppc64le architecture is now available and automatically detected when using cmake system. 201Using makefile the new "ppc64le" arch type is available. 202Contributors to this work include AMD, Argonne National Lab., IBM, Intel, Texas Instruments, University of Houston and many others. 203 204 205Additional Information 206====================== 207 208A wide variety of additional information is available on the `Clang web 209page <http://clang.llvm.org/>`_. The web page contains versions of the 210API documentation which are up-to-date with the Subversion version of 211the source code. You can access versions of these documents specific to 212this release by going into the "``clang/docs/``" directory in the Clang 213tree. 214 215If you have any questions or comments about Clang, please feel free to 216contact us via the `mailing 217list <http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev>`_. 218