Clang 5.0.0 Release Notes — Clang 5 documentation (original) (raw)

Written by the LLVM Team

Introduction

This document contains the release notes for the Clang C/C++/Objective-C frontend, part of the LLVM Compiler Infrastructure, release 5.0.0. Here we describe the status of Clang in some detail, including major improvements from the previous release and new feature work. For the general LLVM release notes, see the LLVM documentation. All LLVM releases may be downloaded from the LLVM releases web site.

For more information about Clang or LLVM, including information about the latest release, please see the Clang Web Site or theLLVM Web Site.

What’s New in Clang 5.0.0?

Some of the major new features and improvements to Clang are listed here. Generic improvements to Clang as a whole or to its underlying infrastructure are described first, followed by language-specific sections with improvements to Clang’s support for those languages.

Major New Features

C++ coroutines

C++ coroutines TSimplementation has landed. Use -fcoroutines-ts -stdlib=libc++ to enable coroutine support. Here is an example to get you started.

Improvements to Clang’s diagnostics

New Compiler Flags

Deprecated Compiler Flags

The following options are deprecated and ignored. They will be removed in future versions of Clang.

New Pragmas in Clang

Attribute Changes in Clang

C Language Changes in Clang

typedef unsigned v4i32 attribute((vector_size(16)));

v4i32 foo(v4i32 a) { // Here 5 is implicitly casted to an unsigned value and replicated into a // vector with as many elements as 'a'. return a + 5; }

The implicit conversion of a scalar value to a vector value–in the context of a vector expression–occurs when:

Currently the basic integer and floating point types with the following operators are supported: +, /, -, *, %, >, <,>=, <=, ==, !=, &, |, ^ and the corresponding assignment operators where applicable.

C++ Language Changes in Clang

Objective-C Language Changes in Clang

OpenCL C Language Changes in Clang

Various bug fixes and improvements:

The following new functionalities have been added:

clang-format

libclang

Static Analyzer

Undefined Behavior Sanitizer (UBSan)

Python Binding Changes

Python bindings now support both Python 2 and Python 3.

The following methods have been added:

Additional Information

A wide variety of additional information is available on the Clang web page. The web page contains versions of the API documentation which are up-to-date with the Subversion version of the source code. You can access versions of these documents specific to this release by going into the “clang/docs/” directory in the Clang tree.

If you have any questions or comments about Clang, please feel free to contact us via the mailing list.