Clang 3.0 Release Notes

LLVM Dragon Logo

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 3.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 check out the main please see the Clang Web Site or the LLVM Web Site.

Note that if you are reading this file from a Subversion checkout or the main Clang web page, this document applies to the next release, not the current one. To see the release notes for a specific release, please see the releases page.

What's New in Clang 3.0?

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

Major New Features

Unorganized Notes

These are completely random notes as I'm organizing my thoughts and reviewing the history. Anything still here needs to be distilled and turned into proper prose in a section of its own. When doing that, delete the notes.

A multitude of improvements to Clang's diagnostics

Clang's diagnostics are constantly being improved to catch more issues, explain them more clearly, and provide more accurate source information about them. A few improvements since the 2.9 release that have a particularly high impact:

This release saw significant improvements to libclang

The Clang GCC-compatible command-line driver improved dramatically

A great deal of work went into the GCC-compatible driver for the 3.0 release making it support more operating systems, emulate GCC behavior more accurately, and support a much broader range of Linux distributions out of the box.

Expanded support for instrumenting the preprocessor through callbacks

Several enhancements were made to the PPCallbacks interface to expand the information available to tools and library users of Clang that wish to introspect the preprocessing.

Clang is building and tested regularly on Windows and can compile limited subsets of code on Windows

Clang is regularly built and tested on a variety of Windows platforms including MinGW 32-bit and 64-bit, Cygwin, and natively with MSVC. In addition, Clang can be used as a compiler in a few Windows contexts.

C Language Changes in Clang

C1X Feature Support

Clang 3.0 adds support for the _Alignas, _Generic, and _Static_assert keywords, drafted for inclusion in the next C standard, which is provisionally known as C1X. Use -std=c1x or -std=gnu1x to enable support for the new language standard. These features are backwards-compatible and are available as an extension in all language modes.

C++ Language Changes in Clang

C++11 Feature Support

Clang 3.0 adds support for more of the language features added in the latest ISO C++ standard, C++ 2011. Use -std=c++11 or -std=gnu++11 to enable support for these features. The following are now considered to be of production quality:

All warning and language selection flags which previously accepted c++0x now accept c++11. The old c++0x form remains as an alias.

Objective-C Language Changes in Clang

Internal API Changes

These are major API changes that have happened since the 2.9 release of Clang. If upgrading an external codebase that uses Clang as a library, this section should help get you past the largest hurdles of upgrading.

Switched terminology from "instantiation" to "expansion" for macros

A great deal of comments and code changes fell out of this, but also every API relating to macros with the word "instantiation" (or some variant thereof) was renamed. An incomplete list of the most note-worthy ones is here:

Diagnostic class names were shuffled

Subclasses of DiagnosticConsumer were also then renamed to end with Consumer.

Significant Known Problems

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/doc/" directory in the Clang tree.

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