[www-releases] r321287 - Add 5.0.1 docs

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 21 10:09:58 PST 2017


Added: www-releases/trunk/5.0.1/tools/clang/docs/InternalsManual.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/5.0.1/tools/clang/docs/InternalsManual.html?rev=321287&view=auto
==============================================================================
--- www-releases/trunk/5.0.1/tools/clang/docs/InternalsManual.html (added)
+++ www-releases/trunk/5.0.1/tools/clang/docs/InternalsManual.html Thu Dec 21 10:09:53 2017
@@ -0,0 +1,2017 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>“Clang” CFE Internals Manual — Clang 5 documentation</title>
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="Driver Design & Internals" href="DriverInternals.html" />
+    <link rel="prev" title="Clang-Format Style Options" href="ClangFormatStyleOptions.html" /> 
+  </head>
+  <body>
+      <div class="header" role="banner"><h1 class="heading"><a href="index.html">
+          <span>Clang 5 documentation</span></a></h1>
+        <h2 class="heading"><span>“Clang” CFE Internals Manual</span></h2>
+      </div>
+      <div class="topnav" role="navigation" aria-label="top navigation">
+      
+        <p>
+        «  <a href="ClangFormatStyleOptions.html">Clang-Format Style Options</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="DriverInternals.html">Driver Design & Internals</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="clang-cfe-internals-manual">
+<h1>“Clang” CFE Internals Manual<a class="headerlink" href="#clang-cfe-internals-manual" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#introduction" id="id3">Introduction</a></li>
+<li><a class="reference internal" href="#llvm-support-library" id="id4">LLVM Support Library</a></li>
+<li><a class="reference internal" href="#the-clang-basic-library" id="id5">The Clang “Basic” Library</a><ul>
+<li><a class="reference internal" href="#the-diagnostics-subsystem" id="id6">The Diagnostics Subsystem</a><ul>
+<li><a class="reference internal" href="#the-diagnostic-kinds-td-files" id="id7">The <code class="docutils literal"><span class="pre">Diagnostic*Kinds.td</span></code> files</a></li>
+<li><a class="reference internal" href="#the-format-string" id="id8">The Format String</a></li>
+<li><a class="reference internal" href="#formatting-a-diagnostic-argument" id="id9">Formatting a Diagnostic Argument</a></li>
+<li><a class="reference internal" href="#producing-the-diagnostic" id="id10">Producing the Diagnostic</a></li>
+<li><a class="reference internal" href="#fix-it-hints" id="id11">Fix-It Hints</a></li>
+<li><a class="reference internal" href="#the-diagnosticclient-interface" id="id12">The <code class="docutils literal"><span class="pre">DiagnosticClient</span></code> Interface</a></li>
+<li><a class="reference internal" href="#adding-translations-to-clang" id="id13">Adding Translations to Clang</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-sourcelocation-and-sourcemanager-classes" id="id14">The <code class="docutils literal"><span class="pre">SourceLocation</span></code> and <code class="docutils literal"><span class="pre">SourceManager</span></code> classes</a></li>
+<li><a class="reference internal" href="#sourcerange-and-charsourcerange" id="id15"><code class="docutils literal"><span class="pre">SourceRange</span></code> and <code class="docutils literal"><span class="pre">CharSourceRange</span></code></a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-driver-library" id="id16">The Driver Library</a></li>
+<li><a class="reference internal" href="#precompiled-headers" id="id17">Precompiled Headers</a></li>
+<li><a class="reference internal" href="#the-frontend-library" id="id18">The Frontend Library</a></li>
+<li><a class="reference internal" href="#the-lexer-and-preprocessor-library" id="id19">The Lexer and Preprocessor Library</a><ul>
+<li><a class="reference internal" href="#the-token-class" id="id20">The Token class</a></li>
+<li><a class="reference internal" href="#annotation-tokens" id="id21">Annotation Tokens</a></li>
+<li><a class="reference internal" href="#the-lexer-class" id="id22">The <code class="docutils literal"><span class="pre">Lexer</span></code> class</a></li>
+<li><a class="reference internal" href="#the-tokenlexer-class" id="id23">The <code class="docutils literal"><span class="pre">TokenLexer</span></code> class</a></li>
+<li><a class="reference internal" href="#the-multipleincludeopt-class" id="id24">The <code class="docutils literal"><span class="pre">MultipleIncludeOpt</span></code> class</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-parser-library" id="id25">The Parser Library</a></li>
+<li><a class="reference internal" href="#the-ast-library" id="id26">The AST Library</a><ul>
+<li><a class="reference internal" href="#the-type-class-and-its-subclasses" id="id27">The <code class="docutils literal"><span class="pre">Type</span></code> class and its subclasses</a><ul>
+<li><a class="reference internal" href="#canonical-types" id="id28">Canonical Types</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-qualtype-class" id="id29">The <code class="docutils literal"><span class="pre">QualType</span></code> class</a></li>
+<li><a class="reference internal" href="#declaration-names" id="id30">Declaration names</a></li>
+<li><a class="reference internal" href="#declaration-contexts" id="id31">Declaration contexts</a><ul>
+<li><a class="reference internal" href="#redeclarations-and-overloads" id="id32">Redeclarations and Overloads</a></li>
+<li><a class="reference internal" href="#lexical-and-semantic-contexts" id="id33">Lexical and Semantic Contexts</a></li>
+<li><a class="reference internal" href="#transparent-declaration-contexts" id="id34">Transparent Declaration Contexts</a></li>
+<li><a class="reference internal" href="#multiply-defined-declaration-contexts" id="id35">Multiply-Defined Declaration Contexts</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-cfg-class" id="id36">The <code class="docutils literal"><span class="pre">CFG</span></code> class</a><ul>
+<li><a class="reference internal" href="#basic-blocks" id="id37">Basic Blocks</a></li>
+<li><a class="reference internal" href="#entry-and-exit-blocks" id="id38">Entry and Exit Blocks</a></li>
+<li><a class="reference internal" href="#conditional-control-flow" id="id39">Conditional Control-Flow</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#constant-folding-in-the-clang-ast" id="id40">Constant Folding in the Clang AST</a><ul>
+<li><a class="reference internal" href="#implementation-approach" id="id41">Implementation Approach</a></li>
+<li><a class="reference internal" href="#extensions" id="id42">Extensions</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a class="reference internal" href="#the-sema-library" id="id43">The Sema Library</a></li>
+<li><a class="reference internal" href="#the-codegen-library" id="id44">The CodeGen Library</a></li>
+<li><a class="reference internal" href="#how-to-change-clang" id="id45">How to change Clang</a><ul>
+<li><a class="reference internal" href="#how-to-add-an-attribute" id="id46">How to add an attribute</a><ul>
+<li><a class="reference internal" href="#attribute-basics" id="id47">Attribute Basics</a></li>
+<li><a class="reference internal" href="#include-clang-basic-attr-td" id="id48"><code class="docutils literal"><span class="pre">include/clang/Basic/Attr.td</span></code></a><ul>
+<li><a class="reference internal" href="#spellings" id="id49">Spellings</a></li>
+<li><a class="reference internal" href="#subjects" id="id50">Subjects</a></li>
+<li><a class="reference internal" href="#documentation" id="id51">Documentation</a></li>
+<li><a class="reference internal" href="#arguments" id="id52">Arguments</a></li>
+<li><a class="reference internal" href="#other-properties" id="id53">Other Properties</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#boilerplate" id="id54">Boilerplate</a></li>
+<li><a class="reference internal" href="#semantic-handling" id="id55">Semantic handling</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#how-to-add-an-expression-or-statement" id="id56">How to add an expression or statement</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id3">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>This document describes some of the more important APIs and internal design
+decisions made in the Clang C front-end.  The purpose of this document is to
+both capture some of this high level information and also describe some of the
+design decisions behind it.  This is meant for people interested in hacking on
+Clang, not for end-users.  The description below is categorized by libraries,
+and does not describe any of the clients of the libraries.</p>
+</div>
+<div class="section" id="llvm-support-library">
+<h2><a class="toc-backref" href="#id4">LLVM Support Library</a><a class="headerlink" href="#llvm-support-library" title="Permalink to this headline">¶</a></h2>
+<p>The LLVM <code class="docutils literal"><span class="pre">libSupport</span></code> library provides many underlying libraries and
+<a class="reference external" href="http://llvm.org/docs/ProgrammersManual.html">data-structures</a>, including
+command line option processing, various containers and a system abstraction
+layer, which is used for file system access.</p>
+</div>
+<div class="section" id="the-clang-basic-library">
+<h2><a class="toc-backref" href="#id5">The Clang “Basic” Library</a><a class="headerlink" href="#the-clang-basic-library" title="Permalink to this headline">¶</a></h2>
+<p>This library certainly needs a better name.  The “basic” library contains a
+number of low-level utilities for tracking and manipulating source buffers,
+locations within the source buffers, diagnostics, tokens, target abstraction,
+and information about the subset of the language being compiled for.</p>
+<p>Part of this infrastructure is specific to C (such as the <code class="docutils literal"><span class="pre">TargetInfo</span></code>
+class), other parts could be reused for other non-C-based languages
+(<code class="docutils literal"><span class="pre">SourceLocation</span></code>, <code class="docutils literal"><span class="pre">SourceManager</span></code>, <code class="docutils literal"><span class="pre">Diagnostics</span></code>, <code class="docutils literal"><span class="pre">FileManager</span></code>).
+When and if there is future demand we can figure out if it makes sense to
+introduce a new library, move the general classes somewhere else, or introduce
+some other solution.</p>
+<p>We describe the roles of these classes in order of their dependencies.</p>
+<div class="section" id="the-diagnostics-subsystem">
+<h3><a class="toc-backref" href="#id6">The Diagnostics Subsystem</a><a class="headerlink" href="#the-diagnostics-subsystem" title="Permalink to this headline">¶</a></h3>
+<p>The Clang Diagnostics subsystem is an important part of how the compiler
+communicates with the human.  Diagnostics are the warnings and errors produced
+when the code is incorrect or dubious.  In Clang, each diagnostic produced has
+(at the minimum) a unique ID, an English translation associated with it, a
+<a class="reference internal" href="#sourcelocation"><span class="std std-ref">SourceLocation</span></a> to “put the caret”, and a severity
+(e.g., <code class="docutils literal"><span class="pre">WARNING</span></code> or <code class="docutils literal"><span class="pre">ERROR</span></code>).  They can also optionally include a number of
+arguments to the dianostic (which fill in “%0“‘s in the string) as well as a
+number of source ranges that related to the diagnostic.</p>
+<p>In this section, we’ll be giving examples produced by the Clang command line
+driver, but diagnostics can be <a class="reference internal" href="#diagnosticclient"><span class="std std-ref">rendered in many different ways</span></a> depending on how the <code class="docutils literal"><span class="pre">DiagnosticClient</span></code> interface is
+implemented.  A representative example of a diagnostic is:</p>
+<div class="highlight-text"><div class="highlight"><pre><span></span>t.c:38:15: error: invalid operands to binary expression ('int *' and '_Complex float')
+P = (P-42) + Gamma*4;
+    ~~~~~~ ^ ~~~~~~~
+</pre></div>
+</div>
+<p>In this example, you can see the English translation, the severity (error), you
+can see the source location (the caret (“<code class="docutils literal"><span class="pre">^</span></code>”) and file/line/column info),
+the source ranges “<code class="docutils literal"><span class="pre">~~~~</span></code>”, arguments to the diagnostic (“<code class="docutils literal"><span class="pre">int*</span></code>” and
+“<code class="docutils literal"><span class="pre">_Complex</span> <span class="pre">float</span></code>”).  You’ll have to believe me that there is a unique ID
+backing the diagnostic :).</p>
+<p>Getting all of this to happen has several steps and involves many moving
+pieces, this section describes them and talks about best practices when adding
+a new diagnostic.</p>
+<div class="section" id="the-diagnostic-kinds-td-files">
+<h4><a class="toc-backref" href="#id7">The <code class="docutils literal"><span class="pre">Diagnostic*Kinds.td</span></code> files</a><a class="headerlink" href="#the-diagnostic-kinds-td-files" title="Permalink to this headline">¶</a></h4>
+<p>Diagnostics are created by adding an entry to one of the
+<code class="docutils literal"><span class="pre">clang/Basic/Diagnostic*Kinds.td</span></code> files, depending on what library will be
+using it.  From this file, <strong class="program">tblgen</strong> generates the unique ID of the
+diagnostic, the severity of the diagnostic and the English translation + format
+string.</p>
+<p>There is little sanity with the naming of the unique ID’s right now.  Some
+start with <code class="docutils literal"><span class="pre">err_</span></code>, <code class="docutils literal"><span class="pre">warn_</span></code>, <code class="docutils literal"><span class="pre">ext_</span></code> to encode the severity into the name.
+Since the enum is referenced in the C++ code that produces the diagnostic, it
+is somewhat useful for it to be reasonably short.</p>
+<p>The severity of the diagnostic comes from the set {<code class="docutils literal"><span class="pre">NOTE</span></code>, <code class="docutils literal"><span class="pre">REMARK</span></code>,
+<code class="docutils literal"><span class="pre">WARNING</span></code>,
+<code class="docutils literal"><span class="pre">EXTENSION</span></code>, <code class="docutils literal"><span class="pre">EXTWARN</span></code>, <code class="docutils literal"><span class="pre">ERROR</span></code>}.  The <code class="docutils literal"><span class="pre">ERROR</span></code> severity is used for
+diagnostics indicating the program is never acceptable under any circumstances.
+When an error is emitted, the AST for the input code may not be fully built.
+The <code class="docutils literal"><span class="pre">EXTENSION</span></code> and <code class="docutils literal"><span class="pre">EXTWARN</span></code> severities are used for extensions to the
+language that Clang accepts.  This means that Clang fully understands and can
+represent them in the AST, but we produce diagnostics to tell the user their
+code is non-portable.  The difference is that the former are ignored by
+default, and the later warn by default.  The <code class="docutils literal"><span class="pre">WARNING</span></code> severity is used for
+constructs that are valid in the currently selected source language but that
+are dubious in some way.  The <code class="docutils literal"><span class="pre">REMARK</span></code> severity provides generic information
+about the compilation that is not necessarily related to any dubious code.  The
+<code class="docutils literal"><span class="pre">NOTE</span></code> level is used to staple more information onto previous diagnostics.</p>
+<p>These <em>severities</em> are mapped into a smaller set (the <code class="docutils literal"><span class="pre">Diagnostic::Level</span></code>
+enum, {<code class="docutils literal"><span class="pre">Ignored</span></code>, <code class="docutils literal"><span class="pre">Note</span></code>, <code class="docutils literal"><span class="pre">Remark</span></code>, <code class="docutils literal"><span class="pre">Warning</span></code>, <code class="docutils literal"><span class="pre">Error</span></code>, <code class="docutils literal"><span class="pre">Fatal</span></code>}) of
+output
+<em>levels</em> by the diagnostics subsystem based on various configuration options.
+Clang internally supports a fully fine grained mapping mechanism that allows
+you to map almost any diagnostic to the output level that you want.  The only
+diagnostics that cannot be mapped are <code class="docutils literal"><span class="pre">NOTE</span></code>s, which always follow the
+severity of the previously emitted diagnostic and <code class="docutils literal"><span class="pre">ERROR</span></code>s, which can only
+be mapped to <code class="docutils literal"><span class="pre">Fatal</span></code> (it is not possible to turn an error into a warning, for
+example).</p>
+<p>Diagnostic mappings are used in many ways.  For example, if the user specifies
+<code class="docutils literal"><span class="pre">-pedantic</span></code>, <code class="docutils literal"><span class="pre">EXTENSION</span></code> maps to <code class="docutils literal"><span class="pre">Warning</span></code>, if they specify
+<code class="docutils literal"><span class="pre">-pedantic-errors</span></code>, it turns into <code class="docutils literal"><span class="pre">Error</span></code>.  This is used to implement
+options like <code class="docutils literal"><span class="pre">-Wunused_macros</span></code>, <code class="docutils literal"><span class="pre">-Wundef</span></code> etc.</p>
+<p>Mapping to <code class="docutils literal"><span class="pre">Fatal</span></code> should only be used for diagnostics that are considered so
+severe that error recovery won’t be able to recover sensibly from them (thus
+spewing a ton of bogus errors).  One example of this class of error are failure
+to <code class="docutils literal"><span class="pre">#include</span></code> a file.</p>
+</div>
+<div class="section" id="the-format-string">
+<h4><a class="toc-backref" href="#id8">The Format String</a><a class="headerlink" href="#the-format-string" title="Permalink to this headline">¶</a></h4>
+<p>The format string for the diagnostic is very simple, but it has some power.  It
+takes the form of a string in English with markers that indicate where and how
+arguments to the diagnostic are inserted and formatted.  For example, here are
+some simple format strings:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="s">"binary integer literals are an extension"</span>
+<span class="s">"format string contains '</span><span class="se">\\</span><span class="s">0' within the string body"</span>
+<span class="s">"more '%%' conversions than data arguments"</span>
+<span class="s">"invalid operands to binary expression (%0 and %1)"</span>
+<span class="s">"overloaded '%0' must be a %select{unary|binary|unary or binary}2 operator"</span>
+     <span class="s">" (has %1 parameter%s1)"</span>
+</pre></div>
+</div>
+<p>These examples show some important points of format strings.  You can use any
+plain ASCII character in the diagnostic string except “<code class="docutils literal"><span class="pre">%</span></code>” without a
+problem, but these are C strings, so you have to use and be aware of all the C
+escape sequences (as in the second example).  If you want to produce a “<code class="docutils literal"><span class="pre">%</span></code>”
+in the output, use the “<code class="docutils literal"><span class="pre">%%</span></code>” escape sequence, like the third diagnostic.
+Finally, Clang uses the “<code class="docutils literal"><span class="pre">%...[digit]</span></code>” sequences to specify where and how
+arguments to the diagnostic are formatted.</p>
+<p>Arguments to the diagnostic are numbered according to how they are specified by
+the C++ code that <a class="reference internal" href="#internals-producing-diag"><span class="std std-ref">produces them</span></a>, and are
+referenced by <code class="docutils literal"><span class="pre">%0</span></code> .. <code class="docutils literal"><span class="pre">%9</span></code>.  If you have more than 10 arguments to your
+diagnostic, you are doing something wrong :).  Unlike <code class="docutils literal"><span class="pre">printf</span></code>, there is no
+requirement that arguments to the diagnostic end up in the output in the same
+order as they are specified, you could have a format string with “<code class="docutils literal"><span class="pre">%1</span> <span class="pre">%0</span></code>”
+that swaps them, for example.  The text in between the percent and digit are
+formatting instructions.  If there are no instructions, the argument is just
+turned into a string and substituted in.</p>
+<p>Here are some “best practices” for writing the English format string:</p>
+<ul class="simple">
+<li>Keep the string short.  It should ideally fit in the 80 column limit of the
+<code class="docutils literal"><span class="pre">DiagnosticKinds.td</span></code> file.  This avoids the diagnostic wrapping when
+printed, and forces you to think about the important point you are conveying
+with the diagnostic.</li>
+<li>Take advantage of location information.  The user will be able to see the
+line and location of the caret, so you don’t need to tell them that the
+problem is with the 4th argument to the function: just point to it.</li>
+<li>Do not capitalize the diagnostic string, and do not end it with a period.</li>
+<li>If you need to quote something in the diagnostic string, use single quotes.</li>
+</ul>
+<p>Diagnostics should never take random English strings as arguments: you
+shouldn’t use “<code class="docutils literal"><span class="pre">you</span> <span class="pre">have</span> <span class="pre">a</span> <span class="pre">problem</span> <span class="pre">with</span> <span class="pre">%0</span></code>” and pass in things like “<code class="docutils literal"><span class="pre">your</span>
+<span class="pre">argument</span></code>” or “<code class="docutils literal"><span class="pre">your</span> <span class="pre">return</span> <span class="pre">value</span></code>” as arguments.  Doing this prevents
+<a class="reference internal" href="#internals-diag-translation"><span class="std std-ref">translating</span></a> the Clang diagnostics to other
+languages (because they’ll get random English words in their otherwise
+localized diagnostic).  The exceptions to this are C/C++ language keywords
+(e.g., <code class="docutils literal"><span class="pre">auto</span></code>, <code class="docutils literal"><span class="pre">const</span></code>, <code class="docutils literal"><span class="pre">mutable</span></code>, etc) and C/C++ operators (<code class="docutils literal"><span class="pre">/=</span></code>).
+Note that things like “pointer” and “reference” are not keywords.  On the other
+hand, you <em>can</em> include anything that comes from the user’s source code,
+including variable names, types, labels, etc.  The “<code class="docutils literal"><span class="pre">select</span></code>” format can be
+used to achieve this sort of thing in a localizable way, see below.</p>
+</div>
+<div class="section" id="formatting-a-diagnostic-argument">
+<h4><a class="toc-backref" href="#id9">Formatting a Diagnostic Argument</a><a class="headerlink" href="#formatting-a-diagnostic-argument" title="Permalink to this headline">¶</a></h4>
+<p>Arguments to diagnostics are fully typed internally, and come from a couple
+different classes: integers, types, names, and random strings.  Depending on
+the class of the argument, it can be optionally formatted in different ways.
+This gives the <code class="docutils literal"><span class="pre">DiagnosticClient</span></code> information about what the argument means
+without requiring it to use a specific presentation (consider this MVC for
+Clang :).</p>
+<p>Here are the different diagnostic argument formats currently supported by
+Clang:</p>
+<p><strong>“s” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><code class="docutils literal"><span class="pre">"requires</span> <span class="pre">%1</span> <span class="pre">parameter%s1"</span></code></dd>
+<dt>Class:</dt>
+<dd>Integers</dd>
+<dt>Description:</dt>
+<dd>This is a simple formatter for integers that is useful when producing English
+diagnostics.  When the integer is 1, it prints as nothing.  When the integer
+is not 1, it prints as “<code class="docutils literal"><span class="pre">s</span></code>”.  This allows some simple grammatical forms to
+be to be handled correctly, and eliminates the need to use gross things like
+<code class="docutils literal"><span class="pre">"requires</span> <span class="pre">%1</span> <span class="pre">parameter(s)"</span></code>.</dd>
+</dl>
+<p><strong>“select” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><code class="docutils literal"><span class="pre">"must</span> <span class="pre">be</span> <span class="pre">a</span> <span class="pre">%select{unary|binary|unary</span> <span class="pre">or</span> <span class="pre">binary}2</span> <span class="pre">operator"</span></code></dd>
+<dt>Class:</dt>
+<dd>Integers</dd>
+<dt>Description:</dt>
+<dd>This format specifier is used to merge multiple related diagnostics together
+into one common one, without requiring the difference to be specified as an
+English string argument.  Instead of specifying the string, the diagnostic
+gets an integer argument and the format string selects the numbered option.
+In this case, the “<code class="docutils literal"><span class="pre">%2</span></code>” value must be an integer in the range [0..2].  If
+it is 0, it prints “unary”, if it is 1 it prints “binary” if it is 2, it
+prints “unary or binary”.  This allows other language translations to
+substitute reasonable words (or entire phrases) based on the semantics of the
+diagnostic instead of having to do things textually.  The selected string
+does undergo formatting.</dd>
+</dl>
+<p><strong>“plural” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><code class="docutils literal"><span class="pre">"you</span> <span class="pre">have</span> <span class="pre">%1</span> <span class="pre">%plural{1:mouse|:mice}1</span> <span class="pre">connected</span> <span class="pre">to</span> <span class="pre">your</span> <span class="pre">computer"</span></code></dd>
+<dt>Class:</dt>
+<dd>Integers</dd>
+<dt>Description:</dt>
+<dd><p class="first">This is a formatter for complex plural forms.  It is designed to handle even
+the requirements of languages with very complex plural forms, as many Baltic
+languages have.  The argument consists of a series of expression/form pairs,
+separated by “:”, where the first form whose expression evaluates to true is
+the result of the modifier.</p>
+<p>An expression can be empty, in which case it is always true.  See the example
+at the top.  Otherwise, it is a series of one or more numeric conditions,
+separated by “,”.  If any condition matches, the expression matches.  Each
+numeric condition can take one of three forms.</p>
+<ul class="simple">
+<li>number: A simple decimal number matches if the argument is the same as the
+number.  Example: <code class="docutils literal"><span class="pre">"%plural{1:mouse|:mice}4"</span></code></li>
+<li>range: A range in square brackets matches if the argument is within the
+range.  Then range is inclusive on both ends.  Example:
+<code class="docutils literal"><span class="pre">"%plural{0:none|1:one|[2,5]:some|:many}2"</span></code></li>
+<li>modulo: A modulo operator is followed by a number, and equals sign and
+either a number or a range.  The tests are the same as for plain numbers
+and ranges, but the argument is taken modulo the number first.  Example:
+<code class="docutils literal"><span class="pre">"%plural{%100=0:even</span> <span class="pre">hundred|%100=[1,50]:lower</span> <span class="pre">half|:everything</span> <span class="pre">else}1"</span></code></li>
+</ul>
+<p class="last">The parser is very unforgiving.  A syntax error, even whitespace, will abort,
+as will a failure to match the argument against any expression.</p>
+</dd>
+</dl>
+<p><strong>“ordinal” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><code class="docutils literal"><span class="pre">"ambiguity</span> <span class="pre">in</span> <span class="pre">%ordinal0</span> <span class="pre">argument"</span></code></dd>
+<dt>Class:</dt>
+<dd>Integers</dd>
+<dt>Description:</dt>
+<dd>This is a formatter which represents the argument number as an ordinal: the
+value <code class="docutils literal"><span class="pre">1</span></code> becomes <code class="docutils literal"><span class="pre">1st</span></code>, <code class="docutils literal"><span class="pre">3</span></code> becomes <code class="docutils literal"><span class="pre">3rd</span></code>, and so on.  Values less
+than <code class="docutils literal"><span class="pre">1</span></code> are not supported.  This formatter is currently hard-coded to use
+English ordinals.</dd>
+</dl>
+<p><strong>“objcclass” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><code class="docutils literal"><span class="pre">"method</span> <span class="pre">%objcclass0</span> <span class="pre">not</span> <span class="pre">found"</span></code></dd>
+<dt>Class:</dt>
+<dd><code class="docutils literal"><span class="pre">DeclarationName</span></code></dd>
+<dt>Description:</dt>
+<dd>This is a simple formatter that indicates the <code class="docutils literal"><span class="pre">DeclarationName</span></code> corresponds
+to an Objective-C class method selector.  As such, it prints the selector
+with a leading “<code class="docutils literal"><span class="pre">+</span></code>”.</dd>
+</dl>
+<p><strong>“objcinstance” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><code class="docutils literal"><span class="pre">"method</span> <span class="pre">%objcinstance0</span> <span class="pre">not</span> <span class="pre">found"</span></code></dd>
+<dt>Class:</dt>
+<dd><code class="docutils literal"><span class="pre">DeclarationName</span></code></dd>
+<dt>Description:</dt>
+<dd>This is a simple formatter that indicates the <code class="docutils literal"><span class="pre">DeclarationName</span></code> corresponds
+to an Objective-C instance method selector.  As such, it prints the selector
+with a leading “<code class="docutils literal"><span class="pre">-</span></code>“.</dd>
+</dl>
+<p><strong>“q” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><code class="docutils literal"><span class="pre">"candidate</span> <span class="pre">found</span> <span class="pre">by</span> <span class="pre">name</span> <span class="pre">lookup</span> <span class="pre">is</span> <span class="pre">%q0"</span></code></dd>
+<dt>Class:</dt>
+<dd><code class="docutils literal"><span class="pre">NamedDecl</span> <span class="pre">*</span></code></dd>
+<dt>Description:</dt>
+<dd>This formatter indicates that the fully-qualified name of the declaration
+should be printed, e.g., “<code class="docutils literal"><span class="pre">std::vector</span></code>” rather than “<code class="docutils literal"><span class="pre">vector</span></code>”.</dd>
+</dl>
+<p><strong>“diff” format</strong></p>
+<dl class="docutils">
+<dt>Example:</dt>
+<dd><code class="docutils literal"><span class="pre">"no</span> <span class="pre">known</span> <span class="pre">conversion</span> <span class="pre">%diff{from</span> <span class="pre">$</span> <span class="pre">to</span> <span class="pre">$|from</span> <span class="pre">argument</span> <span class="pre">type</span> <span class="pre">to</span> <span class="pre">parameter</span> <span class="pre">type}1,2"</span></code></dd>
+<dt>Class:</dt>
+<dd><code class="docutils literal"><span class="pre">QualType</span></code></dd>
+<dt>Description:</dt>
+<dd>This formatter takes two <code class="docutils literal"><span class="pre">QualType</span></code>s and attempts to print a template
+difference between the two.  If tree printing is off, the text inside the
+braces before the pipe is printed, with the formatted text replacing the $.
+If tree printing is on, the text after the pipe is printed and a type tree is
+printed after the diagnostic message.</dd>
+</dl>
+<p>It is really easy to add format specifiers to the Clang diagnostics system, but
+they should be discussed before they are added.  If you are creating a lot of
+repetitive diagnostics and/or have an idea for a useful formatter, please bring
+it up on the cfe-dev mailing list.</p>
+</div>
+<div class="section" id="producing-the-diagnostic">
+<span id="internals-producing-diag"></span><h4><a class="toc-backref" href="#id10">Producing the Diagnostic</a><a class="headerlink" href="#producing-the-diagnostic" title="Permalink to this headline">¶</a></h4>
+<p>Now that you’ve created the diagnostic in the <code class="docutils literal"><span class="pre">Diagnostic*Kinds.td</span></code> file, you
+need to write the code that detects the condition in question and emits the new
+diagnostic.  Various components of Clang (e.g., the preprocessor, <code class="docutils literal"><span class="pre">Sema</span></code>,
+etc.) provide a helper function named “<code class="docutils literal"><span class="pre">Diag</span></code>”.  It creates a diagnostic and
+accepts the arguments, ranges, and other information that goes along with it.</p>
+<p>For example, the binary expression error comes from code like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">various</span> <span class="n">things</span> <span class="n">that</span> <span class="n">are</span> <span class="n">bad</span><span class="p">)</span>
+  <span class="n">Diag</span><span class="p">(</span><span class="n">Loc</span><span class="p">,</span> <span class="n">diag</span><span class="o">::</span><span class="n">err_typecheck_invalid_operands</span><span class="p">)</span>
+    <span class="o"><<</span> <span class="n">lex</span><span class="o">-></span><span class="n">getType</span><span class="p">()</span> <span class="o"><<</span> <span class="n">rex</span><span class="o">-></span><span class="n">getType</span><span class="p">()</span>
+    <span class="o"><<</span> <span class="n">lex</span><span class="o">-></span><span class="n">getSourceRange</span><span class="p">()</span> <span class="o"><<</span> <span class="n">rex</span><span class="o">-></span><span class="n">getSourceRange</span><span class="p">();</span>
+</pre></div>
+</div>
+<p>This shows that use of the <code class="docutils literal"><span class="pre">Diag</span></code> method: it takes a location (a
+<a class="reference internal" href="#sourcelocation"><span class="std std-ref">SourceLocation</span></a> object) and a diagnostic enum value
+(which matches the name from <code class="docutils literal"><span class="pre">Diagnostic*Kinds.td</span></code>).  If the diagnostic takes
+arguments, they are specified with the <code class="docutils literal"><span class="pre"><<</span></code> operator: the first argument
+becomes <code class="docutils literal"><span class="pre">%0</span></code>, the second becomes <code class="docutils literal"><span class="pre">%1</span></code>, etc.  The diagnostic interface
+allows you to specify arguments of many different types, including <code class="docutils literal"><span class="pre">int</span></code> and
+<code class="docutils literal"><span class="pre">unsigned</span></code> for integer arguments, <code class="docutils literal"><span class="pre">const</span> <span class="pre">char*</span></code> and <code class="docutils literal"><span class="pre">std::string</span></code> for
+string arguments, <code class="docutils literal"><span class="pre">DeclarationName</span></code> and <code class="docutils literal"><span class="pre">const</span> <span class="pre">IdentifierInfo</span> <span class="pre">*</span></code> for names,
+<code class="docutils literal"><span class="pre">QualType</span></code> for types, etc.  <code class="docutils literal"><span class="pre">SourceRange</span></code>s are also specified with the
+<code class="docutils literal"><span class="pre"><<</span></code> operator, but do not have a specific ordering requirement.</p>
+<p>As you can see, adding and producing a diagnostic is pretty straightforward.
+The hard part is deciding exactly what you need to say to help the user,
+picking a suitable wording, and providing the information needed to format it
+correctly.  The good news is that the call site that issues a diagnostic should
+be completely independent of how the diagnostic is formatted and in what
+language it is rendered.</p>
+</div>
+<div class="section" id="fix-it-hints">
+<h4><a class="toc-backref" href="#id11">Fix-It Hints</a><a class="headerlink" href="#fix-it-hints" title="Permalink to this headline">¶</a></h4>
+<p>In some cases, the front end emits diagnostics when it is clear that some small
+change to the source code would fix the problem.  For example, a missing
+semicolon at the end of a statement or a use of deprecated syntax that is
+easily rewritten into a more modern form.  Clang tries very hard to emit the
+diagnostic and recover gracefully in these and other cases.</p>
+<p>However, for these cases where the fix is obvious, the diagnostic can be
+annotated with a hint (referred to as a “fix-it hint”) that describes how to
+change the code referenced by the diagnostic to fix the problem.  For example,
+it might add the missing semicolon at the end of the statement or rewrite the
+use of a deprecated construct into something more palatable.  Here is one such
+example from the C++ front end, where we warn about the right-shift operator
+changing meaning from C++98 to C++11:</p>
+<div class="highlight-text"><div class="highlight"><pre><span></span>test.cpp:3:7: warning: use of right-shift operator ('>>') in template argument
+                       will require parentheses in C++11
+A<100 >> 2> *a;
+      ^
+  (       )
+</pre></div>
+</div>
+<p>Here, the fix-it hint is suggesting that parentheses be added, and showing
+exactly where those parentheses would be inserted into the source code.  The
+fix-it hints themselves describe what changes to make to the source code in an
+abstract manner, which the text diagnostic printer renders as a line of
+“insertions” below the caret line.  <a class="reference internal" href="#diagnosticclient"><span class="std std-ref">Other diagnostic clients</span></a> might choose to render the code differently (e.g., as
+markup inline) or even give the user the ability to automatically fix the
+problem.</p>
+<p>Fix-it hints on errors and warnings need to obey these rules:</p>
+<ul class="simple">
+<li>Since they are automatically applied if <code class="docutils literal"><span class="pre">-Xclang</span> <span class="pre">-fixit</span></code> is passed to the
+driver, they should only be used when it’s very likely they match the user’s
+intent.</li>
+<li>Clang must recover from errors as if the fix-it had been applied.</li>
+</ul>
+<p>If a fix-it can’t obey these rules, put the fix-it on a note.  Fix-its on notes
+are not applied automatically.</p>
+<p>All fix-it hints are described by the <code class="docutils literal"><span class="pre">FixItHint</span></code> class, instances of which
+should be attached to the diagnostic using the <code class="docutils literal"><span class="pre"><<</span></code> operator in the same way
+that highlighted source ranges and arguments are passed to the diagnostic.
+Fix-it hints can be created with one of three constructors:</p>
+<ul>
+<li><p class="first"><code class="docutils literal"><span class="pre">FixItHint::CreateInsertion(Loc,</span> <span class="pre">Code)</span></code></p>
+<blockquote>
+<div><p>Specifies that the given <code class="docutils literal"><span class="pre">Code</span></code> (a string) should be inserted before the
+source location <code class="docutils literal"><span class="pre">Loc</span></code>.</p>
+</div></blockquote>
+</li>
+<li><p class="first"><code class="docutils literal"><span class="pre">FixItHint::CreateRemoval(Range)</span></code></p>
+<blockquote>
+<div><p>Specifies that the code in the given source <code class="docutils literal"><span class="pre">Range</span></code> should be removed.</p>
+</div></blockquote>
+</li>
+<li><p class="first"><code class="docutils literal"><span class="pre">FixItHint::CreateReplacement(Range,</span> <span class="pre">Code)</span></code></p>
+<blockquote>
+<div><p>Specifies that the code in the given source <code class="docutils literal"><span class="pre">Range</span></code> should be removed,
+and replaced with the given <code class="docutils literal"><span class="pre">Code</span></code> string.</p>
+</div></blockquote>
+</li>
+</ul>
+</div>
+<div class="section" id="the-diagnosticclient-interface">
+<span id="diagnosticclient"></span><h4><a class="toc-backref" href="#id12">The <code class="docutils literal"><span class="pre">DiagnosticClient</span></code> Interface</a><a class="headerlink" href="#the-diagnosticclient-interface" title="Permalink to this headline">¶</a></h4>
+<p>Once code generates a diagnostic with all of the arguments and the rest of the
+relevant information, Clang needs to know what to do with it.  As previously
+mentioned, the diagnostic machinery goes through some filtering to map a
+severity onto a diagnostic level, then (assuming the diagnostic is not mapped
+to “<code class="docutils literal"><span class="pre">Ignore</span></code>”) it invokes an object that implements the <code class="docutils literal"><span class="pre">DiagnosticClient</span></code>
+interface with the information.</p>
+<p>It is possible to implement this interface in many different ways.  For
+example, the normal Clang <code class="docutils literal"><span class="pre">DiagnosticClient</span></code> (named
+<code class="docutils literal"><span class="pre">TextDiagnosticPrinter</span></code>) turns the arguments into strings (according to the
+various formatting rules), prints out the file/line/column information and the
+string, then prints out the line of code, the source ranges, and the caret.
+However, this behavior isn’t required.</p>
+<p>Another implementation of the <code class="docutils literal"><span class="pre">DiagnosticClient</span></code> interface is the
+<code class="docutils literal"><span class="pre">TextDiagnosticBuffer</span></code> class, which is used when Clang is in <code class="docutils literal"><span class="pre">-verify</span></code>
+mode.  Instead of formatting and printing out the diagnostics, this
+implementation just captures and remembers the diagnostics as they fly by.
+Then <code class="docutils literal"><span class="pre">-verify</span></code> compares the list of produced diagnostics to the list of
+expected ones.  If they disagree, it prints out its own output.  Full
+documentation for the <code class="docutils literal"><span class="pre">-verify</span></code> mode can be found in the Clang API
+documentation for <a class="reference external" href="/doxygen/classclang_1_1VerifyDiagnosticConsumer.html#details">VerifyDiagnosticConsumer</a>.</p>
+<p>There are many other possible implementations of this interface, and this is
+why we prefer diagnostics to pass down rich structured information in
+arguments.  For example, an HTML output might want declaration names be
+linkified to where they come from in the source.  Another example is that a GUI
+might let you click on typedefs to expand them.  This application would want to
+pass significantly more information about types through to the GUI than a
+simple flat string.  The interface allows this to happen.</p>
+</div>
+<div class="section" id="adding-translations-to-clang">
+<span id="internals-diag-translation"></span><h4><a class="toc-backref" href="#id13">Adding Translations to Clang</a><a class="headerlink" href="#adding-translations-to-clang" title="Permalink to this headline">¶</a></h4>
+<p>Not possible yet! Diagnostic strings should be written in UTF-8, the client can
+translate to the relevant code page if needed.  Each translation completely
+replaces the format string for the diagnostic.</p>
+</div>
+</div>
+<div class="section" id="the-sourcelocation-and-sourcemanager-classes">
+<span id="sourcemanager"></span><span id="sourcelocation"></span><h3><a class="toc-backref" href="#id14">The <code class="docutils literal"><span class="pre">SourceLocation</span></code> and <code class="docutils literal"><span class="pre">SourceManager</span></code> classes</a><a class="headerlink" href="#the-sourcelocation-and-sourcemanager-classes" title="Permalink to this headline">¶</a></h3>
+<p>Strangely enough, the <code class="docutils literal"><span class="pre">SourceLocation</span></code> class represents a location within the
+source code of the program.  Important design points include:</p>
+<ol class="arabic simple">
+<li><code class="docutils literal"><span class="pre">sizeof(SourceLocation)</span></code> must be extremely small, as these are embedded
+into many AST nodes and are passed around often.  Currently it is 32 bits.</li>
+<li><code class="docutils literal"><span class="pre">SourceLocation</span></code> must be a simple value object that can be efficiently
+copied.</li>
+<li>We should be able to represent a source location for any byte of any input
+file.  This includes in the middle of tokens, in whitespace, in trigraphs,
+etc.</li>
+<li>A <code class="docutils literal"><span class="pre">SourceLocation</span></code> must encode the current <code class="docutils literal"><span class="pre">#include</span></code> stack that was
+active when the location was processed.  For example, if the location
+corresponds to a token, it should contain the set of <code class="docutils literal"><span class="pre">#include</span></code>s active
+when the token was lexed.  This allows us to print the <code class="docutils literal"><span class="pre">#include</span></code> stack
+for a diagnostic.</li>
+<li><code class="docutils literal"><span class="pre">SourceLocation</span></code> must be able to describe macro expansions, capturing both
+the ultimate instantiation point and the source of the original character
+data.</li>
+</ol>
+<p>In practice, the <code class="docutils literal"><span class="pre">SourceLocation</span></code> works together with the <code class="docutils literal"><span class="pre">SourceManager</span></code>
+class to encode two pieces of information about a location: its spelling
+location and its instantiation location.  For most tokens, these will be the
+same.  However, for a macro expansion (or tokens that came from a <code class="docutils literal"><span class="pre">_Pragma</span></code>
+directive) these will describe the location of the characters corresponding to
+the token and the location where the token was used (i.e., the macro
+instantiation point or the location of the <code class="docutils literal"><span class="pre">_Pragma</span></code> itself).</p>
+<p>The Clang front-end inherently depends on the location of a token being tracked
+correctly.  If it is ever incorrect, the front-end may get confused and die.
+The reason for this is that the notion of the “spelling” of a <code class="docutils literal"><span class="pre">Token</span></code> in
+Clang depends on being able to find the original input characters for the
+token.  This concept maps directly to the “spelling location” for the token.</p>
+</div>
+<div class="section" id="sourcerange-and-charsourcerange">
+<h3><a class="toc-backref" href="#id15"><code class="docutils literal"><span class="pre">SourceRange</span></code> and <code class="docutils literal"><span class="pre">CharSourceRange</span></code></a><a class="headerlink" href="#sourcerange-and-charsourcerange" title="Permalink to this headline">¶</a></h3>
+<p>Clang represents most source ranges by [first, last], where “first” and “last”
+each point to the beginning of their respective tokens.  For example consider
+the <code class="docutils literal"><span class="pre">SourceRange</span></code> of the following statement:</p>
+<div class="highlight-text"><div class="highlight"><pre><span></span>x = foo + bar;
+^first    ^last
+</pre></div>
+</div>
+<p>To map from this representation to a character-based representation, the “last”
+location needs to be adjusted to point to (or past) the end of that token with
+either <code class="docutils literal"><span class="pre">Lexer::MeasureTokenLength()</span></code> or <code class="docutils literal"><span class="pre">Lexer::getLocForEndOfToken()</span></code>.  For
+the rare cases where character-level source ranges information is needed we use
+the <code class="docutils literal"><span class="pre">CharSourceRange</span></code> class.</p>
+</div>
+</div>
+<div class="section" id="the-driver-library">
+<h2><a class="toc-backref" href="#id16">The Driver Library</a><a class="headerlink" href="#the-driver-library" title="Permalink to this headline">¶</a></h2>
+<p>The clang Driver and library are documented <a class="reference internal" href="DriverInternals.html"><span class="doc">here</span></a>.</p>
+</div>
+<div class="section" id="precompiled-headers">
+<h2><a class="toc-backref" href="#id17">Precompiled Headers</a><a class="headerlink" href="#precompiled-headers" title="Permalink to this headline">¶</a></h2>
+<p>Clang supports two implementations of precompiled headers.  The default
+implementation, precompiled headers (<a class="reference internal" href="PCHInternals.html"><span class="doc">PCH</span></a>) uses a
+serialized representation of Clang’s internal data structures, encoded with the
+<a class="reference external" href="http://llvm.org/docs/BitCodeFormat.html">LLVM bitstream format</a>.
+Pretokenized headers (<a class="reference internal" href="PTHInternals.html"><span class="doc">PTH</span></a>), on the other hand, contain a
+serialized representation of the tokens encountered when preprocessing a header
+(and anything that header includes).</p>
+</div>
+<div class="section" id="the-frontend-library">
+<h2><a class="toc-backref" href="#id18">The Frontend Library</a><a class="headerlink" href="#the-frontend-library" title="Permalink to this headline">¶</a></h2>
+<p>The Frontend library contains functionality useful for building tools on top of
+the Clang libraries, for example several methods for outputting diagnostics.</p>
+</div>
+<div class="section" id="the-lexer-and-preprocessor-library">
+<h2><a class="toc-backref" href="#id19">The Lexer and Preprocessor Library</a><a class="headerlink" href="#the-lexer-and-preprocessor-library" title="Permalink to this headline">¶</a></h2>
+<p>The Lexer library contains several tightly-connected classes that are involved
+with the nasty process of lexing and preprocessing C source code.  The main
+interface to this library for outside clients is the large <code class="docutils literal"><span class="pre">Preprocessor</span></code>
+class.  It contains the various pieces of state that are required to coherently
+read tokens out of a translation unit.</p>
+<p>The core interface to the <code class="docutils literal"><span class="pre">Preprocessor</span></code> object (once it is set up) is the
+<code class="docutils literal"><span class="pre">Preprocessor::Lex</span></code> method, which returns the next <a class="reference internal" href="#token"><span class="std std-ref">Token</span></a> from
+the preprocessor stream.  There are two types of token providers that the
+preprocessor is capable of reading from: a buffer lexer (provided by the
+<a class="reference internal" href="#lexer"><span class="std std-ref">Lexer</span></a> class) and a buffered token stream (provided by the
+<a class="reference internal" href="#tokenlexer"><span class="std std-ref">TokenLexer</span></a> class).</p>
+<div class="section" id="the-token-class">
+<span id="token"></span><h3><a class="toc-backref" href="#id20">The Token class</a><a class="headerlink" href="#the-token-class" title="Permalink to this headline">¶</a></h3>
+<p>The <code class="docutils literal"><span class="pre">Token</span></code> class is used to represent a single lexed token.  Tokens are
+intended to be used by the lexer/preprocess and parser libraries, but are not
+intended to live beyond them (for example, they should not live in the ASTs).</p>
+<p>Tokens most often live on the stack (or some other location that is efficient
+to access) as the parser is running, but occasionally do get buffered up.  For
+example, macro definitions are stored as a series of tokens, and the C++
+front-end periodically needs to buffer tokens up for tentative parsing and
+various pieces of look-ahead.  As such, the size of a <code class="docutils literal"><span class="pre">Token</span></code> matters.  On a
+32-bit system, <code class="docutils literal"><span class="pre">sizeof(Token)</span></code> is currently 16 bytes.</p>
+<p>Tokens occur in two forms: <a class="reference internal" href="#annotationtoken"><span class="std std-ref">annotation tokens</span></a> and
+normal tokens.  Normal tokens are those returned by the lexer, annotation
+tokens represent semantic information and are produced by the parser, replacing
+normal tokens in the token stream.  Normal tokens contain the following
+information:</p>
+<ul class="simple">
+<li><strong>A SourceLocation</strong> — This indicates the location of the start of the
+token.</li>
+<li><strong>A length</strong> — This stores the length of the token as stored in the
+<code class="docutils literal"><span class="pre">SourceBuffer</span></code>.  For tokens that include them, this length includes
+trigraphs and escaped newlines which are ignored by later phases of the
+compiler.  By pointing into the original source buffer, it is always possible
+to get the original spelling of a token completely accurately.</li>
+<li><strong>IdentifierInfo</strong> — If a token takes the form of an identifier, and if
+identifier lookup was enabled when the token was lexed (e.g., the lexer was
+not reading in “raw” mode) this contains a pointer to the unique hash value
+for the identifier.  Because the lookup happens before keyword
+identification, this field is set even for language keywords like “<code class="docutils literal"><span class="pre">for</span></code>”.</li>
+<li><strong>TokenKind</strong> — This indicates the kind of token as classified by the
+lexer.  This includes things like <code class="docutils literal"><span class="pre">tok::starequal</span></code> (for the “<code class="docutils literal"><span class="pre">*=</span></code>”
+operator), <code class="docutils literal"><span class="pre">tok::ampamp</span></code> for the “<code class="docutils literal"><span class="pre">&&</span></code>” token, and keyword values (e.g.,
+<code class="docutils literal"><span class="pre">tok::kw_for</span></code>) for identifiers that correspond to keywords.  Note that
+some tokens can be spelled multiple ways.  For example, C++ supports
+“operator keywords”, where things like “<code class="docutils literal"><span class="pre">and</span></code>” are treated exactly like the
+“<code class="docutils literal"><span class="pre">&&</span></code>” operator.  In these cases, the kind value is set to <code class="docutils literal"><span class="pre">tok::ampamp</span></code>,
+which is good for the parser, which doesn’t have to consider both forms.  For
+something that cares about which form is used (e.g., the preprocessor
+“stringize” operator) the spelling indicates the original form.</li>
+<li><strong>Flags</strong> — There are currently four flags tracked by the
+lexer/preprocessor system on a per-token basis:<ol class="arabic">
+<li><strong>StartOfLine</strong> — This was the first token that occurred on its input
+source line.</li>
+<li><strong>LeadingSpace</strong> — There was a space character either immediately before
+the token or transitively before the token as it was expanded through a
+macro.  The definition of this flag is very closely defined by the
+stringizing requirements of the preprocessor.</li>
+<li><strong>DisableExpand</strong> — This flag is used internally to the preprocessor to
+represent identifier tokens which have macro expansion disabled.  This
+prevents them from being considered as candidates for macro expansion ever
+in the future.</li>
+<li><strong>NeedsCleaning</strong> — This flag is set if the original spelling for the
+token includes a trigraph or escaped newline.  Since this is uncommon,
+many pieces of code can fast-path on tokens that did not need cleaning.</li>
+</ol>
+</li>
+</ul>
+<p>One interesting (and somewhat unusual) aspect of normal tokens is that they
+don’t contain any semantic information about the lexed value.  For example, if
+the token was a pp-number token, we do not represent the value of the number
+that was lexed (this is left for later pieces of code to decide).
+Additionally, the lexer library has no notion of typedef names vs variable
+names: both are returned as identifiers, and the parser is left to decide
+whether a specific identifier is a typedef or a variable (tracking this
+requires scope information among other things).  The parser can do this
+translation by replacing tokens returned by the preprocessor with “Annotation
+Tokens”.</p>
+</div>
+<div class="section" id="annotation-tokens">
+<span id="annotationtoken"></span><h3><a class="toc-backref" href="#id21">Annotation Tokens</a><a class="headerlink" href="#annotation-tokens" title="Permalink to this headline">¶</a></h3>
+<p>Annotation tokens are tokens that are synthesized by the parser and injected
+into the preprocessor’s token stream (replacing existing tokens) to record
+semantic information found by the parser.  For example, if “<code class="docutils literal"><span class="pre">foo</span></code>” is found
+to be a typedef, the “<code class="docutils literal"><span class="pre">foo</span></code>” <code class="docutils literal"><span class="pre">tok::identifier</span></code> token is replaced with an
+<code class="docutils literal"><span class="pre">tok::annot_typename</span></code>.  This is useful for a couple of reasons: 1) this makes
+it easy to handle qualified type names (e.g., “<code class="docutils literal"><span class="pre">foo::bar::baz<42>::t</span></code>”) in
+C++ as a single “token” in the parser.  2) if the parser backtracks, the
+reparse does not need to redo semantic analysis to determine whether a token
+sequence is a variable, type, template, etc.</p>
+<p>Annotation tokens are created by the parser and reinjected into the parser’s
+token stream (when backtracking is enabled).  Because they can only exist in
+tokens that the preprocessor-proper is done with, it doesn’t need to keep
+around flags like “start of line” that the preprocessor uses to do its job.
+Additionally, an annotation token may “cover” a sequence of preprocessor tokens
+(e.g., “<code class="docutils literal"><span class="pre">a::b::c</span></code>” is five preprocessor tokens).  As such, the valid fields
+of an annotation token are different than the fields for a normal token (but
+they are multiplexed into the normal <code class="docutils literal"><span class="pre">Token</span></code> fields):</p>
+<ul class="simple">
+<li><strong>SourceLocation “Location”</strong> — The <code class="docutils literal"><span class="pre">SourceLocation</span></code> for the annotation
+token indicates the first token replaced by the annotation token.  In the
+example above, it would be the location of the “<code class="docutils literal"><span class="pre">a</span></code>” identifier.</li>
+<li><strong>SourceLocation “AnnotationEndLoc”</strong> — This holds the location of the last
+token replaced with the annotation token.  In the example above, it would be
+the location of the “<code class="docutils literal"><span class="pre">c</span></code>” identifier.</li>
+<li><strong>void* “AnnotationValue”</strong> — This contains an opaque object that the
+parser gets from <code class="docutils literal"><span class="pre">Sema</span></code>.  The parser merely preserves the information for
+<code class="docutils literal"><span class="pre">Sema</span></code> to later interpret based on the annotation token kind.</li>
+<li><strong>TokenKind “Kind”</strong> — This indicates the kind of Annotation token this is.
+See below for the different valid kinds.</li>
+</ul>
+<p>Annotation tokens currently come in three kinds:</p>
+<ol class="arabic simple">
+<li><strong>tok::annot_typename</strong>: This annotation token represents a resolved
+typename token that is potentially qualified.  The <code class="docutils literal"><span class="pre">AnnotationValue</span></code> field
+contains the <code class="docutils literal"><span class="pre">QualType</span></code> returned by <code class="docutils literal"><span class="pre">Sema::getTypeName()</span></code>, possibly with
+source location information attached.</li>
+<li><strong>tok::annot_cxxscope</strong>: This annotation token represents a C++ scope
+specifier, such as “<code class="docutils literal"><span class="pre">A::B::</span></code>”.  This corresponds to the grammar
+productions “<em>::</em>” and “<em>:: [opt] nested-name-specifier</em>”.  The
+<code class="docutils literal"><span class="pre">AnnotationValue</span></code> pointer is a <code class="docutils literal"><span class="pre">NestedNameSpecifier</span> <span class="pre">*</span></code> returned by the
+<code class="docutils literal"><span class="pre">Sema::ActOnCXXGlobalScopeSpecifier</span></code> and
+<code class="docutils literal"><span class="pre">Sema::ActOnCXXNestedNameSpecifier</span></code> callbacks.</li>
+<li><strong>tok::annot_template_id</strong>: This annotation token represents a C++
+template-id such as “<code class="docutils literal"><span class="pre">foo<int,</span> <span class="pre">4></span></code>”, where “<code class="docutils literal"><span class="pre">foo</span></code>” is the name of a
+template.  The <code class="docutils literal"><span class="pre">AnnotationValue</span></code> pointer is a pointer to a <code class="docutils literal"><span class="pre">malloc</span></code>’d
+<code class="docutils literal"><span class="pre">TemplateIdAnnotation</span></code> object.  Depending on the context, a parsed
+template-id that names a type might become a typename annotation token (if
+all we care about is the named type, e.g., because it occurs in a type
+specifier) or might remain a template-id token (if we want to retain more
+source location information or produce a new type, e.g., in a declaration of
+a class template specialization).  template-id annotation tokens that refer
+to a type can be “upgraded” to typename annotation tokens by the parser.</li>
+</ol>
+<p>As mentioned above, annotation tokens are not returned by the preprocessor,
+they are formed on demand by the parser.  This means that the parser has to be
+aware of cases where an annotation could occur and form it where appropriate.
+This is somewhat similar to how the parser handles Translation Phase 6 of C99:
+String Concatenation (see C99 5.1.1.2).  In the case of string concatenation,
+the preprocessor just returns distinct <code class="docutils literal"><span class="pre">tok::string_literal</span></code> and
+<code class="docutils literal"><span class="pre">tok::wide_string_literal</span></code> tokens and the parser eats a sequence of them
+wherever the grammar indicates that a string literal can occur.</p>
+<p>In order to do this, whenever the parser expects a <code class="docutils literal"><span class="pre">tok::identifier</span></code> or
+<code class="docutils literal"><span class="pre">tok::coloncolon</span></code>, it should call the <code class="docutils literal"><span class="pre">TryAnnotateTypeOrScopeToken</span></code> or
+<code class="docutils literal"><span class="pre">TryAnnotateCXXScopeToken</span></code> methods to form the annotation token.  These
+methods will maximally form the specified annotation tokens and replace the
+current token with them, if applicable.  If the current tokens is not valid for
+an annotation token, it will remain an identifier or “<code class="docutils literal"><span class="pre">::</span></code>” token.</p>
+</div>
+<div class="section" id="the-lexer-class">
+<span id="lexer"></span><h3><a class="toc-backref" href="#id22">The <code class="docutils literal"><span class="pre">Lexer</span></code> class</a><a class="headerlink" href="#the-lexer-class" title="Permalink to this headline">¶</a></h3>
+<p>The <code class="docutils literal"><span class="pre">Lexer</span></code> class provides the mechanics of lexing tokens out of a source
+buffer and deciding what they mean.  The <code class="docutils literal"><span class="pre">Lexer</span></code> is complicated by the fact
+that it operates on raw buffers that have not had spelling eliminated (this is
+a necessity to get decent performance), but this is countered with careful
+coding as well as standard performance techniques (for example, the comment
+handling code is vectorized on X86 and PowerPC hosts).</p>
+<p>The lexer has a couple of interesting modal features:</p>
+<ul class="simple">
+<li>The lexer can operate in “raw” mode.  This mode has several features that
+make it possible to quickly lex the file (e.g., it stops identifier lookup,
+doesn’t specially handle preprocessor tokens, handles EOF differently, etc).
+This mode is used for lexing within an “<code class="docutils literal"><span class="pre">#if</span> <span class="pre">0</span></code>” block, for example.</li>
+<li>The lexer can capture and return comments as tokens.  This is required to
+support the <code class="docutils literal"><span class="pre">-C</span></code> preprocessor mode, which passes comments through, and is
+used by the diagnostic checker to identifier expect-error annotations.</li>
+<li>The lexer can be in <code class="docutils literal"><span class="pre">ParsingFilename</span></code> mode, which happens when
+preprocessing after reading a <code class="docutils literal"><span class="pre">#include</span></code> directive.  This mode changes the
+parsing of “<code class="docutils literal"><span class="pre"><</span></code>” to return an “angled string” instead of a bunch of tokens
+for each thing within the filename.</li>
+<li>When parsing a preprocessor directive (after “<code class="docutils literal"><span class="pre">#</span></code>”) the
+<code class="docutils literal"><span class="pre">ParsingPreprocessorDirective</span></code> mode is entered.  This changes the parser to
+return EOD at a newline.</li>
+<li>The <code class="docutils literal"><span class="pre">Lexer</span></code> uses a <code class="docutils literal"><span class="pre">LangOptions</span></code> object to know whether trigraphs are
+enabled, whether C++ or ObjC keywords are recognized, etc.</li>
+</ul>
+<p>In addition to these modes, the lexer keeps track of a couple of other features
+that are local to a lexed buffer, which change as the buffer is lexed:</p>
+<ul class="simple">
+<li>The <code class="docutils literal"><span class="pre">Lexer</span></code> uses <code class="docutils literal"><span class="pre">BufferPtr</span></code> to keep track of the current character being
+lexed.</li>
+<li>The <code class="docutils literal"><span class="pre">Lexer</span></code> uses <code class="docutils literal"><span class="pre">IsAtStartOfLine</span></code> to keep track of whether the next
+lexed token will start with its “start of line” bit set.</li>
+<li>The <code class="docutils literal"><span class="pre">Lexer</span></code> keeps track of the current “<code class="docutils literal"><span class="pre">#if</span></code>” directives that are active
+(which can be nested).</li>
+<li>The <code class="docutils literal"><span class="pre">Lexer</span></code> keeps track of an <a class="reference internal" href="#multipleincludeopt"><span class="std std-ref">MultipleIncludeOpt</span></a> object, which is used to detect whether the buffer uses
+the standard “<code class="docutils literal"><span class="pre">#ifndef</span> <span class="pre">XX</span></code> / <code class="docutils literal"><span class="pre">#define</span> <span class="pre">XX</span></code>” idiom to prevent multiple
+inclusion.  If a buffer does, subsequent includes can be ignored if the
+“<code class="docutils literal"><span class="pre">XX</span></code>” macro is defined.</li>
+</ul>
+</div>
+<div class="section" id="the-tokenlexer-class">
+<span id="tokenlexer"></span><h3><a class="toc-backref" href="#id23">The <code class="docutils literal"><span class="pre">TokenLexer</span></code> class</a><a class="headerlink" href="#the-tokenlexer-class" title="Permalink to this headline">¶</a></h3>
+<p>The <code class="docutils literal"><span class="pre">TokenLexer</span></code> class is a token provider that returns tokens from a list of
+tokens that came from somewhere else.  It typically used for two things: 1)
+returning tokens from a macro definition as it is being expanded 2) returning
+tokens from an arbitrary buffer of tokens.  The later use is used by
+<code class="docutils literal"><span class="pre">_Pragma</span></code> and will most likely be used to handle unbounded look-ahead for the
+C++ parser.</p>
+</div>
+<div class="section" id="the-multipleincludeopt-class">
+<span id="multipleincludeopt"></span><h3><a class="toc-backref" href="#id24">The <code class="docutils literal"><span class="pre">MultipleIncludeOpt</span></code> class</a><a class="headerlink" href="#the-multipleincludeopt-class" title="Permalink to this headline">¶</a></h3>
+<p>The <code class="docutils literal"><span class="pre">MultipleIncludeOpt</span></code> class implements a really simple little state
+machine that is used to detect the standard “<code class="docutils literal"><span class="pre">#ifndef</span> <span class="pre">XX</span></code> / <code class="docutils literal"><span class="pre">#define</span> <span class="pre">XX</span></code>”
+idiom that people typically use to prevent multiple inclusion of headers.  If a
+buffer uses this idiom and is subsequently <code class="docutils literal"><span class="pre">#include</span></code>’d, the preprocessor can
+simply check to see whether the guarding condition is defined or not.  If so,
+the preprocessor can completely ignore the include of the header.</p>
+</div>
+</div>
+<div class="section" id="the-parser-library">
+<span id="parser"></span><h2><a class="toc-backref" href="#id25">The Parser Library</a><a class="headerlink" href="#the-parser-library" title="Permalink to this headline">¶</a></h2>
+<p>This library contains a recursive-descent parser that polls tokens from the
+preprocessor and notifies a client of the parsing progress.</p>
+<p>Historically, the parser used to talk to an abstract <code class="docutils literal"><span class="pre">Action</span></code> interface that
+had virtual methods for parse events, for example <code class="docutils literal"><span class="pre">ActOnBinOp()</span></code>.  When Clang
+grew C++ support, the parser stopped supporting general <code class="docutils literal"><span class="pre">Action</span></code> clients –
+it now always talks to the <a class="reference internal" href="#sema"><span class="std std-ref">Sema libray</span></a>.  However, the Parser
+still accesses AST objects only through opaque types like <code class="docutils literal"><span class="pre">ExprResult</span></code> and
+<code class="docutils literal"><span class="pre">StmtResult</span></code>.  Only <a class="reference internal" href="#sema"><span class="std std-ref">Sema</span></a> looks at the AST node contents of these
+wrappers.</p>
+</div>
+<div class="section" id="the-ast-library">
+<span id="ast"></span><h2><a class="toc-backref" href="#id26">The AST Library</a><a class="headerlink" href="#the-ast-library" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="the-type-class-and-its-subclasses">
+<span id="type"></span><h3><a class="toc-backref" href="#id27">The <code class="docutils literal"><span class="pre">Type</span></code> class and its subclasses</a><a class="headerlink" href="#the-type-class-and-its-subclasses" title="Permalink to this headline">¶</a></h3>
+<p>The <code class="docutils literal"><span class="pre">Type</span></code> class (and its subclasses) are an important part of the AST.
+Types are accessed through the <code class="docutils literal"><span class="pre">ASTContext</span></code> class, which implicitly creates
+and uniques them as they are needed.  Types have a couple of non-obvious
+features: 1) they do not capture type qualifiers like <code class="docutils literal"><span class="pre">const</span></code> or <code class="docutils literal"><span class="pre">volatile</span></code>
+(see <a class="reference internal" href="#qualtype"><span class="std std-ref">QualType</span></a>), and 2) they implicitly capture typedef
+information.  Once created, types are immutable (unlike decls).</p>
+<p>Typedefs in C make semantic analysis a bit more complex than it would be without
+them.  The issue is that we want to capture typedef information and represent it
+in the AST perfectly, but the semantics of operations need to “see through”
+typedefs.  For example, consider this code:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">func</span><span class="p">()</span> <span class="p">{</span>
+  <span class="k">typedef</span> <span class="kt">int</span> <span class="n">foo</span><span class="p">;</span>
+  <span class="n">foo</span> <span class="n">X</span><span class="p">,</span> <span class="o">*</span><span class="n">Y</span><span class="p">;</span>
+  <span class="k">typedef</span> <span class="n">foo</span> <span class="o">*</span><span class="n">bar</span><span class="p">;</span>
+  <span class="n">bar</span> <span class="n">Z</span><span class="p">;</span>
+  <span class="o">*</span><span class="n">X</span><span class="p">;</span> <span class="c1">// error</span>
+  <span class="o">**</span><span class="n">Y</span><span class="p">;</span> <span class="c1">// error</span>
+  <span class="o">**</span><span class="n">Z</span><span class="p">;</span> <span class="c1">// error</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The code above is illegal, and thus we expect there to be diagnostics emitted
+on the annotated lines.  In this example, we expect to get:</p>
+<div class="highlight-text"><div class="highlight"><pre><span></span>test.c:6:1: error: indirection requires pointer operand ('foo' invalid)
+  *X; // error
+  ^~
+test.c:7:1: error: indirection requires pointer operand ('foo' invalid)
+  **Y; // error
+  ^~~
+test.c:8:1: error: indirection requires pointer operand ('foo' invalid)
+  **Z; // error
+  ^~~
+</pre></div>
+</div>
+<p>While this example is somewhat silly, it illustrates the point: we want to
+retain typedef information where possible, so that we can emit errors about
+“<code class="docutils literal"><span class="pre">std::string</span></code>” instead of “<code class="docutils literal"><span class="pre">std::basic_string<char,</span> <span class="pre">std:...</span></code>”.  Doing this
+requires properly keeping typedef information (for example, the type of <code class="docutils literal"><span class="pre">X</span></code>
+is “<code class="docutils literal"><span class="pre">foo</span></code>”, not “<code class="docutils literal"><span class="pre">int</span></code>”), and requires properly propagating it through the
+various operators (for example, the type of <code class="docutils literal"><span class="pre">*Y</span></code> is “<code class="docutils literal"><span class="pre">foo</span></code>”, not
+“<code class="docutils literal"><span class="pre">int</span></code>”).  In order to retain this information, the type of these expressions
+is an instance of the <code class="docutils literal"><span class="pre">TypedefType</span></code> class, which indicates that the type of
+these expressions is a typedef for “<code class="docutils literal"><span class="pre">foo</span></code>”.</p>
+<p>Representing types like this is great for diagnostics, because the
+user-specified type is always immediately available.  There are two problems
+with this: first, various semantic checks need to make judgements about the
+<em>actual structure</em> of a type, ignoring typedefs.  Second, we need an efficient
+way to query whether two types are structurally identical to each other,
+ignoring typedefs.  The solution to both of these problems is the idea of
+canonical types.</p>
+<div class="section" id="canonical-types">
+<h4><a class="toc-backref" href="#id28">Canonical Types</a><a class="headerlink" href="#canonical-types" title="Permalink to this headline">¶</a></h4>
+<p>Every instance of the <code class="docutils literal"><span class="pre">Type</span></code> class contains a canonical type pointer.  For
+simple types with no typedefs involved (e.g., “<code class="docutils literal"><span class="pre">int</span></code>”, “<code class="docutils literal"><span class="pre">int*</span></code>”,
+“<code class="docutils literal"><span class="pre">int**</span></code>”), the type just points to itself.  For types that have a typedef
+somewhere in their structure (e.g., “<code class="docutils literal"><span class="pre">foo</span></code>”, “<code class="docutils literal"><span class="pre">foo*</span></code>”, “<code class="docutils literal"><span class="pre">foo**</span></code>”,
+“<code class="docutils literal"><span class="pre">bar</span></code>”), the canonical type pointer points to their structurally equivalent
+type without any typedefs (e.g., “<code class="docutils literal"><span class="pre">int</span></code>”, “<code class="docutils literal"><span class="pre">int*</span></code>”, “<code class="docutils literal"><span class="pre">int**</span></code>”, and
+“<code class="docutils literal"><span class="pre">int*</span></code>” respectively).</p>
+<p>This design provides a constant time operation (dereferencing the canonical type
+pointer) that gives us access to the structure of types.  For example, we can
+trivially tell that “<code class="docutils literal"><span class="pre">bar</span></code>” and “<code class="docutils literal"><span class="pre">foo*</span></code>” are the same type by dereferencing
+their canonical type pointers and doing a pointer comparison (they both point
+to the single “<code class="docutils literal"><span class="pre">int*</span></code>” type).</p>
+<p>Canonical types and typedef types bring up some complexities that must be
+carefully managed.  Specifically, the <code class="docutils literal"><span class="pre">isa</span></code>/<code class="docutils literal"><span class="pre">cast</span></code>/<code class="docutils literal"><span class="pre">dyn_cast</span></code> operators
+generally shouldn’t be used in code that is inspecting the AST.  For example,
+when type checking the indirection operator (unary “<code class="docutils literal"><span class="pre">*</span></code>” on a pointer), the
+type checker must verify that the operand has a pointer type.  It would not be
+correct to check that with “<code class="docutils literal"><span class="pre">isa<PointerType>(SubExpr->getType())</span></code>”, because
+this predicate would fail if the subexpression had a typedef type.</p>
+<p>The solution to this problem are a set of helper methods on <code class="docutils literal"><span class="pre">Type</span></code>, used to
+check their properties.  In this case, it would be correct to use
+“<code class="docutils literal"><span class="pre">SubExpr->getType()->isPointerType()</span></code>” to do the check.  This predicate will
+return true if the <em>canonical type is a pointer</em>, which is true any time the
+type is structurally a pointer type.  The only hard part here is remembering
+not to use the <code class="docutils literal"><span class="pre">isa</span></code>/<code class="docutils literal"><span class="pre">cast</span></code>/<code class="docutils literal"><span class="pre">dyn_cast</span></code> operations.</p>
+<p>The second problem we face is how to get access to the pointer type once we
+know it exists.  To continue the example, the result type of the indirection
+operator is the pointee type of the subexpression.  In order to determine the
+type, we need to get the instance of <code class="docutils literal"><span class="pre">PointerType</span></code> that best captures the
+typedef information in the program.  If the type of the expression is literally
+a <code class="docutils literal"><span class="pre">PointerType</span></code>, we can return that, otherwise we have to dig through the
+typedefs to find the pointer type.  For example, if the subexpression had type
+“<code class="docutils literal"><span class="pre">foo*</span></code>”, we could return that type as the result.  If the subexpression had
+type “<code class="docutils literal"><span class="pre">bar</span></code>”, we want to return “<code class="docutils literal"><span class="pre">foo*</span></code>” (note that we do <em>not</em> want
+“<code class="docutils literal"><span class="pre">int*</span></code>”).  In order to provide all of this, <code class="docutils literal"><span class="pre">Type</span></code> has a
+<code class="docutils literal"><span class="pre">getAsPointerType()</span></code> method that checks whether the type is structurally a
+<code class="docutils literal"><span class="pre">PointerType</span></code> and, if so, returns the best one.  If not, it returns a null
+pointer.</p>
+<p>This structure is somewhat mystical, but after meditating on it, it will make
+sense to you :).</p>
+</div>
+</div>
+<div class="section" id="the-qualtype-class">
+<span id="qualtype"></span><h3><a class="toc-backref" href="#id29">The <code class="docutils literal"><span class="pre">QualType</span></code> class</a><a class="headerlink" href="#the-qualtype-class" title="Permalink to this headline">¶</a></h3>
+<p>The <code class="docutils literal"><span class="pre">QualType</span></code> class is designed as a trivial value class that is small,
+passed by-value and is efficient to query.  The idea of <code class="docutils literal"><span class="pre">QualType</span></code> is that it
+stores the type qualifiers (<code class="docutils literal"><span class="pre">const</span></code>, <code class="docutils literal"><span class="pre">volatile</span></code>, <code class="docutils literal"><span class="pre">restrict</span></code>, plus some
+extended qualifiers required by language extensions) separately from the types
+themselves.  <code class="docutils literal"><span class="pre">QualType</span></code> is conceptually a pair of “<code class="docutils literal"><span class="pre">Type*</span></code>” and the bits
+for these type qualifiers.</p>
+<p>By storing the type qualifiers as bits in the conceptual pair, it is extremely
+efficient to get the set of qualifiers on a <code class="docutils literal"><span class="pre">QualType</span></code> (just return the field
+of the pair), add a type qualifier (which is a trivial constant-time operation
+that sets a bit), and remove one or more type qualifiers (just return a
+<code class="docutils literal"><span class="pre">QualType</span></code> with the bitfield set to empty).</p>
+<p>Further, because the bits are stored outside of the type itself, we do not need
+to create duplicates of types with different sets of qualifiers (i.e. there is
+only a single heap allocated “<code class="docutils literal"><span class="pre">int</span></code>” type: “<code class="docutils literal"><span class="pre">const</span> <span class="pre">int</span></code>” and “<code class="docutils literal"><span class="pre">volatile</span>
+<span class="pre">const</span> <span class="pre">int</span></code>” both point to the same heap allocated “<code class="docutils literal"><span class="pre">int</span></code>” type).  This
+reduces the heap size used to represent bits and also means we do not have to
+consider qualifiers when uniquing types (<a class="reference internal" href="#type"><span class="std std-ref">Type</span></a> does not even
+contain qualifiers).</p>
+<p>In practice, the two most common type qualifiers (<code class="docutils literal"><span class="pre">const</span></code> and <code class="docutils literal"><span class="pre">restrict</span></code>)
+are stored in the low bits of the pointer to the <code class="docutils literal"><span class="pre">Type</span></code> object, together with
+a flag indicating whether extended qualifiers are present (which must be
+heap-allocated).  This means that <code class="docutils literal"><span class="pre">QualType</span></code> is exactly the same size as a
+pointer.</p>
+</div>
+<div class="section" id="declaration-names">
+<span id="declarationname"></span><h3><a class="toc-backref" href="#id30">Declaration names</a><a class="headerlink" href="#declaration-names" title="Permalink to this headline">¶</a></h3>
+<p>The <code class="docutils literal"><span class="pre">DeclarationName</span></code> class represents the name of a declaration in Clang.
+Declarations in the C family of languages can take several different forms.
+Most declarations are named by simple identifiers, e.g., “<code class="docutils literal"><span class="pre">f</span></code>” and “<code class="docutils literal"><span class="pre">x</span></code>” in
+the function declaration <code class="docutils literal"><span class="pre">f(int</span> <span class="pre">x)</span></code>.  In C++, declaration names can also name
+class constructors (“<code class="docutils literal"><span class="pre">Class</span></code>” in <code class="docutils literal"><span class="pre">struct</span> <span class="pre">Class</span> <span class="pre">{</span> <span class="pre">Class();</span> <span class="pre">}</span></code>), class
+destructors (“<code class="docutils literal"><span class="pre">~Class</span></code>”), overloaded operator names (“<code class="docutils literal"><span class="pre">operator+</span></code>”), and
+conversion functions (“<code class="docutils literal"><span class="pre">operator</span> <span class="pre">void</span> <span class="pre">const</span> <span class="pre">*</span></code>”).  In Objective-C,
+declaration names can refer to the names of Objective-C methods, which involve
+the method name and the parameters, collectively called a <em>selector</em>, e.g.,
+“<code class="docutils literal"><span class="pre">setWidth:height:</span></code>”.  Since all of these kinds of entities — variables,
+functions, Objective-C methods, C++ constructors, destructors, and operators
+— are represented as subclasses of Clang’s common <code class="docutils literal"><span class="pre">NamedDecl</span></code> class,
+<code class="docutils literal"><span class="pre">DeclarationName</span></code> is designed to efficiently represent any kind of name.</p>
+<p>Given a <code class="docutils literal"><span class="pre">DeclarationName</span></code> <code class="docutils literal"><span class="pre">N</span></code>, <code class="docutils literal"><span class="pre">N.getNameKind()</span></code> will produce a value
+that describes what kind of name <code class="docutils literal"><span class="pre">N</span></code> stores.  There are 10 options (all of
+the names are inside the <code class="docutils literal"><span class="pre">DeclarationName</span></code> class).</p>
+<p><code class="docutils literal"><span class="pre">Identifier</span></code></p>
+<blockquote>
+<div>The name is a simple identifier.  Use <code class="docutils literal"><span class="pre">N.getAsIdentifierInfo()</span></code> to retrieve
+the corresponding <code class="docutils literal"><span class="pre">IdentifierInfo*</span></code> pointing to the actual identifier.</div></blockquote>
+<p><code class="docutils literal"><span class="pre">ObjCZeroArgSelector</span></code>, <code class="docutils literal"><span class="pre">ObjCOneArgSelector</span></code>, <code class="docutils literal"><span class="pre">ObjCMultiArgSelector</span></code></p>
+<blockquote>
+<div>The name is an Objective-C selector, which can be retrieved as a <code class="docutils literal"><span class="pre">Selector</span></code>
+instance via <code class="docutils literal"><span class="pre">N.getObjCSelector()</span></code>.  The three possible name kinds for
+Objective-C reflect an optimization within the <code class="docutils literal"><span class="pre">DeclarationName</span></code> class:
+both zero- and one-argument selectors are stored as a masked
+<code class="docutils literal"><span class="pre">IdentifierInfo</span></code> pointer, and therefore require very little space, since
+zero- and one-argument selectors are far more common than multi-argument
+selectors (which use a different structure).</div></blockquote>
+<p><code class="docutils literal"><span class="pre">CXXConstructorName</span></code></p>
+<blockquote>
+<div>The name is a C++ constructor name.  Use <code class="docutils literal"><span class="pre">N.getCXXNameType()</span></code> to retrieve
+the <a class="reference internal" href="#qualtype"><span class="std std-ref">type</span></a> that this constructor is meant to construct.  The
+type is always the canonical type, since all constructors for a given type
+have the same name.</div></blockquote>
+<p><code class="docutils literal"><span class="pre">CXXDestructorName</span></code></p>
+<blockquote>
+<div>The name is a C++ destructor name.  Use <code class="docutils literal"><span class="pre">N.getCXXNameType()</span></code> to retrieve
+the <a class="reference internal" href="#qualtype"><span class="std std-ref">type</span></a> whose destructor is being named.  This type is
+always a canonical type.</div></blockquote>
+<p><code class="docutils literal"><span class="pre">CXXConversionFunctionName</span></code></p>
+<blockquote>
+<div>The name is a C++ conversion function.  Conversion functions are named
+according to the type they convert to, e.g., “<code class="docutils literal"><span class="pre">operator</span> <span class="pre">void</span> <span class="pre">const</span> <span class="pre">*</span></code>”.
+Use <code class="docutils literal"><span class="pre">N.getCXXNameType()</span></code> to retrieve the type that this conversion function
+converts to.  This type is always a canonical type.</div></blockquote>
+<p><code class="docutils literal"><span class="pre">CXXOperatorName</span></code></p>
+<blockquote>
+<div>The name is a C++ overloaded operator name.  Overloaded operators are named
+according to their spelling, e.g., “<code class="docutils literal"><span class="pre">operator+</span></code>” or “<code class="docutils literal"><span class="pre">operator</span> <span class="pre">new</span> <span class="pre">[]</span></code>”.
+Use <code class="docutils literal"><span class="pre">N.getCXXOverloadedOperator()</span></code> to retrieve the overloaded operator (a
+value of type <code class="docutils literal"><span class="pre">OverloadedOperatorKind</span></code>).</div></blockquote>
+<p><code class="docutils literal"><span class="pre">CXXLiteralOperatorName</span></code></p>
+<blockquote>
+<div>The name is a C++11 user defined literal operator.  User defined
+Literal operators are named according to the suffix they define,
+e.g., “<code class="docutils literal"><span class="pre">_foo</span></code>” for “<code class="docutils literal"><span class="pre">operator</span> <span class="pre">""</span> <span class="pre">_foo</span></code>”.  Use
+<code class="docutils literal"><span class="pre">N.getCXXLiteralIdentifier()</span></code> to retrieve the corresponding
+<code class="docutils literal"><span class="pre">IdentifierInfo*</span></code> pointing to the identifier.</div></blockquote>
+<p><code class="docutils literal"><span class="pre">CXXUsingDirective</span></code></p>
+<blockquote>
+<div>The name is a C++ using directive.  Using directives are not really
+NamedDecls, in that they all have the same name, but they are
+implemented as such in order to store them in DeclContext
+effectively.</div></blockquote>
+<p><code class="docutils literal"><span class="pre">DeclarationName</span></code>s are cheap to create, copy, and compare.  They require
+only a single pointer’s worth of storage in the common cases (identifiers,
+zero- and one-argument Objective-C selectors) and use dense, uniqued storage
+for the other kinds of names.  Two <code class="docutils literal"><span class="pre">DeclarationName</span></code>s can be compared for
+equality (<code class="docutils literal"><span class="pre">==</span></code>, <code class="docutils literal"><span class="pre">!=</span></code>) using a simple bitwise comparison, can be ordered
+with <code class="docutils literal"><span class="pre"><</span></code>, <code class="docutils literal"><span class="pre">></span></code>, <code class="docutils literal"><span class="pre"><=</span></code>, and <code class="docutils literal"><span class="pre">>=</span></code> (which provide a lexicographical ordering
+for normal identifiers but an unspecified ordering for other kinds of names),
+and can be placed into LLVM <code class="docutils literal"><span class="pre">DenseMap</span></code>s and <code class="docutils literal"><span class="pre">DenseSet</span></code>s.</p>
+<p><code class="docutils literal"><span class="pre">DeclarationName</span></code> instances can be created in different ways depending on
+what kind of name the instance will store.  Normal identifiers
+(<code class="docutils literal"><span class="pre">IdentifierInfo</span></code> pointers) and Objective-C selectors (<code class="docutils literal"><span class="pre">Selector</span></code>) can be
+implicitly converted to <code class="docutils literal"><span class="pre">DeclarationNames</span></code>.  Names for C++ constructors,
+destructors, conversion functions, and overloaded operators can be retrieved
+from the <code class="docutils literal"><span class="pre">DeclarationNameTable</span></code>, an instance of which is available as
+<code class="docutils literal"><span class="pre">ASTContext::DeclarationNames</span></code>.  The member functions
+<code class="docutils literal"><span class="pre">getCXXConstructorName</span></code>, <code class="docutils literal"><span class="pre">getCXXDestructorName</span></code>,
+<code class="docutils literal"><span class="pre">getCXXConversionFunctionName</span></code>, and <code class="docutils literal"><span class="pre">getCXXOperatorName</span></code>, respectively,
+return <code class="docutils literal"><span class="pre">DeclarationName</span></code> instances for the four kinds of C++ special function
+names.</p>
+</div>
+<div class="section" id="declaration-contexts">
+<span id="declcontext"></span><h3><a class="toc-backref" href="#id31">Declaration contexts</a><a class="headerlink" href="#declaration-contexts" title="Permalink to this headline">¶</a></h3>
+<p>Every declaration in a program exists within some <em>declaration context</em>, such
+as a translation unit, namespace, class, or function.  Declaration contexts in
+Clang are represented by the <code class="docutils literal"><span class="pre">DeclContext</span></code> class, from which the various
+declaration-context AST nodes (<code class="docutils literal"><span class="pre">TranslationUnitDecl</span></code>, <code class="docutils literal"><span class="pre">NamespaceDecl</span></code>,
+<code class="docutils literal"><span class="pre">RecordDecl</span></code>, <code class="docutils literal"><span class="pre">FunctionDecl</span></code>, etc.) will derive.  The <code class="docutils literal"><span class="pre">DeclContext</span></code> class
+provides several facilities common to each declaration context:</p>
+<p>Source-centric vs. Semantics-centric View of Declarations</p>
+<blockquote>
+<div><code class="docutils literal"><span class="pre">DeclContext</span></code> provides two views of the declarations stored within a
+declaration context.  The source-centric view accurately represents the
+program source code as written, including multiple declarations of entities
+where present (see the section <a class="reference internal" href="#redeclarations"><span class="std std-ref">Redeclarations and Overloads</span></a>), while the semantics-centric view represents the program
+semantics.  The two views are kept synchronized by semantic analysis while
+the ASTs are being constructed.</div></blockquote>
+<p>Storage of declarations within that context</p>
+<blockquote>
+<div>Every declaration context can contain some number of declarations.  For
+example, a C++ class (represented by <code class="docutils literal"><span class="pre">RecordDecl</span></code>) contains various member
+functions, fields, nested types, and so on.  All of these declarations will
+be stored within the <code class="docutils literal"><span class="pre">DeclContext</span></code>, and one can iterate over the
+declarations via [<code class="docutils literal"><span class="pre">DeclContext::decls_begin()</span></code>,
+<code class="docutils literal"><span class="pre">DeclContext::decls_end()</span></code>).  This mechanism provides the source-centric
+view of declarations in the context.</div></blockquote>
+<p>Lookup of declarations within that context</p>
+<blockquote>
+<div>The <code class="docutils literal"><span class="pre">DeclContext</span></code> structure provides efficient name lookup for names within
+that declaration context.  For example, if <code class="docutils literal"><span class="pre">N</span></code> is a namespace we can look
+for the name <code class="docutils literal"><span class="pre">N::f</span></code> using <code class="docutils literal"><span class="pre">DeclContext::lookup</span></code>.  The lookup itself is
+based on a lazily-constructed array (for declaration contexts with a small
+number of declarations) or hash table (for declaration contexts with more
+declarations).  The lookup operation provides the semantics-centric view of
+the declarations in the context.</div></blockquote>
+<p>Ownership of declarations</p>
+<blockquote>
+<div>The <code class="docutils literal"><span class="pre">DeclContext</span></code> owns all of the declarations that were declared within
+its declaration context, and is responsible for the management of their
+memory as well as their (de-)serialization.</div></blockquote>
+<p>All declarations are stored within a declaration context, and one can query
+information about the context in which each declaration lives.  One can
+retrieve the <code class="docutils literal"><span class="pre">DeclContext</span></code> that contains a particular <code class="docutils literal"><span class="pre">Decl</span></code> using
+<code class="docutils literal"><span class="pre">Decl::getDeclContext</span></code>.  However, see the section
+<a class="reference internal" href="#lexicalandsemanticcontexts"><span class="std std-ref">Lexical and Semantic Contexts</span></a> for more information about how to interpret
+this context information.</p>
+<div class="section" id="redeclarations-and-overloads">
+<span id="redeclarations"></span><h4><a class="toc-backref" href="#id32">Redeclarations and Overloads</a><a class="headerlink" href="#redeclarations-and-overloads" title="Permalink to this headline">¶</a></h4>
+<p>Within a translation unit, it is common for an entity to be declared several
+times.  For example, we might declare a function “<code class="docutils literal"><span class="pre">f</span></code>” and then later
+re-declare it as part of an inlined definition:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">f</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="kt">int</span> <span class="n">z</span> <span class="o">=</span> <span class="mi">1</span><span class="p">);</span>
+
+<span class="kr">inline</span> <span class="kt">void</span> <span class="nf">f</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="kt">int</span> <span class="n">z</span><span class="p">)</span> <span class="p">{</span> <span class="cm">/* ...  */</span> <span class="p">}</span>
+</pre></div>
+</div>
+<p>The representation of “<code class="docutils literal"><span class="pre">f</span></code>” differs in the source-centric and
+semantics-centric views of a declaration context.  In the source-centric view,
+all redeclarations will be present, in the order they occurred in the source
+code, making this view suitable for clients that wish to see the structure of
+the source code.  In the semantics-centric view, only the most recent “<code class="docutils literal"><span class="pre">f</span></code>”
+will be found by the lookup, since it effectively replaces the first
+declaration of “<code class="docutils literal"><span class="pre">f</span></code>”.</p>
+<p>In the semantics-centric view, overloading of functions is represented
+explicitly.  For example, given two declarations of a function “<code class="docutils literal"><span class="pre">g</span></code>” that are
+overloaded, e.g.,</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">g</span><span class="p">();</span>
+<span class="kt">void</span> <span class="nf">g</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>the <code class="docutils literal"><span class="pre">DeclContext::lookup</span></code> operation will return a
+<code class="docutils literal"><span class="pre">DeclContext::lookup_result</span></code> that contains a range of iterators over
+declarations of “<code class="docutils literal"><span class="pre">g</span></code>”.  Clients that perform semantic analysis on a program
+that is not concerned with the actual source code will primarily use this
+semantics-centric view.</p>
+</div>
+<div class="section" id="lexical-and-semantic-contexts">
+<span id="lexicalandsemanticcontexts"></span><h4><a class="toc-backref" href="#id33">Lexical and Semantic Contexts</a><a class="headerlink" href="#lexical-and-semantic-contexts" title="Permalink to this headline">¶</a></h4>
+<p>Each declaration has two potentially different declaration contexts: a
+<em>lexical</em> context, which corresponds to the source-centric view of the
+declaration context, and a <em>semantic</em> context, which corresponds to the
+semantics-centric view.  The lexical context is accessible via
+<code class="docutils literal"><span class="pre">Decl::getLexicalDeclContext</span></code> while the semantic context is accessible via
+<code class="docutils literal"><span class="pre">Decl::getDeclContext</span></code>, both of which return <code class="docutils literal"><span class="pre">DeclContext</span></code> pointers.  For
+most declarations, the two contexts are identical.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">X</span> <span class="p">{</span>
+<span class="k">public</span><span class="o">:</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">);</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>Here, the semantic and lexical contexts of <code class="docutils literal"><span class="pre">X::f</span></code> are the <code class="docutils literal"><span class="pre">DeclContext</span></code>
+associated with the class <code class="docutils literal"><span class="pre">X</span></code> (itself stored as a <code class="docutils literal"><span class="pre">RecordDecl</span></code> AST node).
+However, we can now define <code class="docutils literal"><span class="pre">X::f</span></code> out-of-line:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="n">X</span><span class="o">::</span><span class="n">f</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span> <span class="o">=</span> <span class="mi">17</span><span class="p">)</span> <span class="p">{</span> <span class="cm">/* ...  */</span> <span class="p">}</span>
+</pre></div>
+</div>
+<p>This definition of “<code class="docutils literal"><span class="pre">f</span></code>” has different lexical and semantic contexts.  The
+lexical context corresponds to the declaration context in which the actual
+declaration occurred in the source code, e.g., the translation unit containing
+<code class="docutils literal"><span class="pre">X</span></code>.  Thus, this declaration of <code class="docutils literal"><span class="pre">X::f</span></code> can be found by traversing the
+declarations provided by [<code class="docutils literal"><span class="pre">decls_begin()</span></code>, <code class="docutils literal"><span class="pre">decls_end()</span></code>) in the
+translation unit.</p>
+<p>The semantic context of <code class="docutils literal"><span class="pre">X::f</span></code> corresponds to the class <code class="docutils literal"><span class="pre">X</span></code>, since this
+member function is (semantically) a member of <code class="docutils literal"><span class="pre">X</span></code>.  Lookup of the name <code class="docutils literal"><span class="pre">f</span></code>
+into the <code class="docutils literal"><span class="pre">DeclContext</span></code> associated with <code class="docutils literal"><span class="pre">X</span></code> will then return the definition
+of <code class="docutils literal"><span class="pre">X::f</span></code> (including information about the default argument).</p>
+</div>
+<div class="section" id="transparent-declaration-contexts">
+<h4><a class="toc-backref" href="#id34">Transparent Declaration Contexts</a><a class="headerlink" href="#transparent-declaration-contexts" title="Permalink to this headline">¶</a></h4>
+<p>In C and C++, there are several contexts in which names that are logically
+declared inside another declaration will actually “leak” out into the enclosing
+scope from the perspective of name lookup.  The most obvious instance of this
+behavior is in enumeration types, e.g.,</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">enum</span> <span class="n">Color</span> <span class="p">{</span>
+  <span class="n">Red</span><span class="p">,</span>
+  <span class="n">Green</span><span class="p">,</span>
+  <span class="n">Blue</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>Here, <code class="docutils literal"><span class="pre">Color</span></code> is an enumeration, which is a declaration context that contains
+the enumerators <code class="docutils literal"><span class="pre">Red</span></code>, <code class="docutils literal"><span class="pre">Green</span></code>, and <code class="docutils literal"><span class="pre">Blue</span></code>.  Thus, traversing the list of
+declarations contained in the enumeration <code class="docutils literal"><span class="pre">Color</span></code> will yield <code class="docutils literal"><span class="pre">Red</span></code>,
+<code class="docutils literal"><span class="pre">Green</span></code>, and <code class="docutils literal"><span class="pre">Blue</span></code>.  However, outside of the scope of <code class="docutils literal"><span class="pre">Color</span></code> one can
+name the enumerator <code class="docutils literal"><span class="pre">Red</span></code> without qualifying the name, e.g.,</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">Color</span> <span class="n">c</span> <span class="o">=</span> <span class="n">Red</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>There are other entities in C++ that provide similar behavior.  For example,
+linkage specifications that use curly braces:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">extern</span> <span class="s">"C"</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+  <span class="kt">void</span> <span class="nf">g</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+<span class="p">}</span>
+<span class="c1">// f and g are visible here</span>
+</pre></div>
+</div>
+<p>For source-level accuracy, we treat the linkage specification and enumeration
+type as a declaration context in which its enclosed declarations (“<code class="docutils literal"><span class="pre">Red</span></code>”,
+“<code class="docutils literal"><span class="pre">Green</span></code>”, and “<code class="docutils literal"><span class="pre">Blue</span></code>”; “<code class="docutils literal"><span class="pre">f</span></code>” and “<code class="docutils literal"><span class="pre">g</span></code>”) are declared.  However, these
+declarations are visible outside of the scope of the declaration context.</p>
+<p>These language features (and several others, described below) have roughly the
+same set of requirements: declarations are declared within a particular lexical
+context, but the declarations are also found via name lookup in scopes
+enclosing the declaration itself.  This feature is implemented via
+<em>transparent</em> declaration contexts (see
+<code class="docutils literal"><span class="pre">DeclContext::isTransparentContext()</span></code>), whose declarations are visible in the
+nearest enclosing non-transparent declaration context.  This means that the
+lexical context of the declaration (e.g., an enumerator) will be the
+transparent <code class="docutils literal"><span class="pre">DeclContext</span></code> itself, as will the semantic context, but the
+declaration will be visible in every outer context up to and including the
+first non-transparent declaration context (since transparent declaration
+contexts can be nested).</p>
+<p>The transparent <code class="docutils literal"><span class="pre">DeclContext</span></code>s are:</p>
+<ul>
+<li><p class="first">Enumerations (but not C++11 “scoped enumerations”):</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">enum</span> <span class="n">Color</span> <span class="p">{</span>
+  <span class="n">Red</span><span class="p">,</span>
+  <span class="n">Green</span><span class="p">,</span>
+  <span class="n">Blue</span>
+<span class="p">};</span>
+<span class="c1">// Red, Green, and Blue are in scope</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">C++ linkage specifications:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">extern</span> <span class="s">"C"</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+  <span class="kt">void</span> <span class="nf">g</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+<span class="p">}</span>
+<span class="c1">// f and g are in scope</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">Anonymous unions and structs:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">struct</span> <span class="n">LookupTable</span> <span class="p">{</span>
+  <span class="kt">bool</span> <span class="n">IsVector</span><span class="p">;</span>
+  <span class="k">union</span> <span class="p">{</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Item</span><span class="o">></span> <span class="o">*</span><span class="n">Vector</span><span class="p">;</span>
+    <span class="n">std</span><span class="o">::</span><span class="n">set</span><span class="o"><</span><span class="n">Item</span><span class="o">></span> <span class="o">*</span><span class="n">Set</span><span class="p">;</span>
+  <span class="p">};</span>
+<span class="p">};</span>
+
+<span class="n">LookupTable</span> <span class="n">LT</span><span class="p">;</span>
+<span class="n">LT</span><span class="p">.</span><span class="n">Vector</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">// Okay: finds Vector inside the unnamed union</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">C++11 inline namespaces:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">namespace</span> <span class="n">mylib</span> <span class="p">{</span>
+  <span class="kr">inline</span> <span class="k">namespace</span> <span class="n">debug</span> <span class="p">{</span>
+    <span class="k">class</span> <span class="nc">X</span><span class="p">;</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+<span class="n">mylib</span><span class="o">::</span><span class="n">X</span> <span class="o">*</span><span class="n">xp</span><span class="p">;</span> <span class="c1">// okay: mylib::X refers to mylib::debug::X</span>
+</pre></div>
+</div>
+</li>
+</ul>
+</div>
+<div class="section" id="multiply-defined-declaration-contexts">
+<span id="multideclcontext"></span><h4><a class="toc-backref" href="#id35">Multiply-Defined Declaration Contexts</a><a class="headerlink" href="#multiply-defined-declaration-contexts" title="Permalink to this headline">¶</a></h4>
+<p>C++ namespaces have the interesting — and, so far, unique — property that
+the namespace can be defined multiple times, and the declarations provided by
+each namespace definition are effectively merged (from the semantic point of
+view).  For example, the following two code snippets are semantically
+indistinguishable:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="c1">// Snippet #1:</span>
+<span class="k">namespace</span> <span class="n">N</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">();</span>
+<span class="p">}</span>
+<span class="k">namespace</span> <span class="n">N</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="c1">// Snippet #2:</span>
+<span class="k">namespace</span> <span class="n">N</span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">f</span><span class="p">();</span>
+  <span class="kt">void</span> <span class="nf">f</span><span class="p">(</span><span class="kt">int</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>In Clang’s representation, the source-centric view of declaration contexts will
+actually have two separate <code class="docutils literal"><span class="pre">NamespaceDecl</span></code> nodes in Snippet #1, each of which
+is a declaration context that contains a single declaration of “<code class="docutils literal"><span class="pre">f</span></code>”.
+However, the semantics-centric view provided by name lookup into the namespace
+<code class="docutils literal"><span class="pre">N</span></code> for “<code class="docutils literal"><span class="pre">f</span></code>” will return a <code class="docutils literal"><span class="pre">DeclContext::lookup_result</span></code> that contains a
+range of iterators over declarations of “<code class="docutils literal"><span class="pre">f</span></code>”.</p>
+<p><code class="docutils literal"><span class="pre">DeclContext</span></code> manages multiply-defined declaration contexts internally.  The
+function <code class="docutils literal"><span class="pre">DeclContext::getPrimaryContext</span></code> retrieves the “primary” context for
+a given <code class="docutils literal"><span class="pre">DeclContext</span></code> instance, which is the <code class="docutils literal"><span class="pre">DeclContext</span></code> responsible for
+maintaining the lookup table used for the semantics-centric view.  Given a
+DeclContext, one can obtain the set of declaration contexts that are semanticaly
+connected to this declaration context, in source order, including this context
+(which will be the only result, for non-namespace contexts) via
+<code class="docutils literal"><span class="pre">DeclContext::collectAllContexts</span></code>. Note that these functions are used
+internally within the lookup and insertion methods of the <code class="docutils literal"><span class="pre">DeclContext</span></code>, so
+the vast majority of clients can ignore them.</p>
+</div>
+</div>
+<div class="section" id="the-cfg-class">
+<span id="cfg"></span><h3><a class="toc-backref" href="#id36">The <code class="docutils literal"><span class="pre">CFG</span></code> class</a><a class="headerlink" href="#the-cfg-class" title="Permalink to this headline">¶</a></h3>
+<p>The <code class="docutils literal"><span class="pre">CFG</span></code> class is designed to represent a source-level control-flow graph
+for a single statement (<code class="docutils literal"><span class="pre">Stmt*</span></code>).  Typically instances of <code class="docutils literal"><span class="pre">CFG</span></code> are
+constructed for function bodies (usually an instance of <code class="docutils literal"><span class="pre">CompoundStmt</span></code>), but
+can also be instantiated to represent the control-flow of any class that
+subclasses <code class="docutils literal"><span class="pre">Stmt</span></code>, which includes simple expressions.  Control-flow graphs
+are especially useful for performing <a class="reference external" href="http://en.wikipedia.org/wiki/Data_flow_analysis#Sensitivities">flow- or path-sensitive</a> program
+analyses on a given function.</p>
+<div class="section" id="basic-blocks">
+<h4><a class="toc-backref" href="#id37">Basic Blocks</a><a class="headerlink" href="#basic-blocks" title="Permalink to this headline">¶</a></h4>
+<p>Concretely, an instance of <code class="docutils literal"><span class="pre">CFG</span></code> is a collection of basic blocks.  Each basic
+block is an instance of <code class="docutils literal"><span class="pre">CFGBlock</span></code>, which simply contains an ordered sequence
+of <code class="docutils literal"><span class="pre">Stmt*</span></code> (each referring to statements in the AST).  The ordering of
+statements within a block indicates unconditional flow of control from one
+statement to the next.  <a class="reference internal" href="#conditionalcontrolflow"><span class="std std-ref">Conditional control-flow</span></a> is represented using edges between basic blocks.  The
+statements within a given <code class="docutils literal"><span class="pre">CFGBlock</span></code> can be traversed using the
+<code class="docutils literal"><span class="pre">CFGBlock::*iterator</span></code> interface.</p>
+<p>A <code class="docutils literal"><span class="pre">CFG</span></code> object owns the instances of <code class="docutils literal"><span class="pre">CFGBlock</span></code> within the control-flow
+graph it represents.  Each <code class="docutils literal"><span class="pre">CFGBlock</span></code> within a CFG is also uniquely numbered
+(accessible via <code class="docutils literal"><span class="pre">CFGBlock::getBlockID()</span></code>).  Currently the number is based on
+the ordering the blocks were created, but no assumptions should be made on how
+<code class="docutils literal"><span class="pre">CFGBlocks</span></code> are numbered other than their numbers are unique and that they
+are numbered from 0..N-1 (where N is the number of basic blocks in the CFG).</p>
+</div>
+<div class="section" id="entry-and-exit-blocks">
+<h4><a class="toc-backref" href="#id38">Entry and Exit Blocks</a><a class="headerlink" href="#entry-and-exit-blocks" title="Permalink to this headline">¶</a></h4>
+<p>Each instance of <code class="docutils literal"><span class="pre">CFG</span></code> contains two special blocks: an <em>entry</em> block
+(accessible via <code class="docutils literal"><span class="pre">CFG::getEntry()</span></code>), which has no incoming edges, and an
+<em>exit</em> block (accessible via <code class="docutils literal"><span class="pre">CFG::getExit()</span></code>), which has no outgoing edges.
+Neither block contains any statements, and they serve the role of providing a
+clear entrance and exit for a body of code such as a function body.  The
+presence of these empty blocks greatly simplifies the implementation of many
+analyses built on top of CFGs.</p>
+</div>
+<div class="section" id="conditional-control-flow">
+<span id="conditionalcontrolflow"></span><h4><a class="toc-backref" href="#id39">Conditional Control-Flow</a><a class="headerlink" href="#conditional-control-flow" title="Permalink to this headline">¶</a></h4>
+<p>Conditional control-flow (such as those induced by if-statements and loops) is
+represented as edges between <code class="docutils literal"><span class="pre">CFGBlocks</span></code>.  Because different C language
+constructs can induce control-flow, each <code class="docutils literal"><span class="pre">CFGBlock</span></code> also records an extra
+<code class="docutils literal"><span class="pre">Stmt*</span></code> that represents the <em>terminator</em> of the block.  A terminator is
+simply the statement that caused the control-flow, and is used to identify the
+nature of the conditional control-flow between blocks.  For example, in the
+case of an if-statement, the terminator refers to the <code class="docutils literal"><span class="pre">IfStmt</span></code> object in the
+AST that represented the given branch.</p>
+<p>To illustrate, consider the following code example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">int</span> <span class="nf">foo</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">x</span> <span class="o">=</span> <span class="n">x</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">></span> <span class="mi">2</span><span class="p">)</span>
+    <span class="n">x</span><span class="o">++</span><span class="p">;</span>
+  <span class="k">else</span> <span class="p">{</span>
+    <span class="n">x</span> <span class="o">+=</span> <span class="mi">2</span><span class="p">;</span>
+    <span class="n">x</span> <span class="o">*=</span> <span class="mi">2</span><span class="p">;</span>
+  <span class="p">}</span>
+
+  <span class="k">return</span> <span class="n">x</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>After invoking the parser+semantic analyzer on this code fragment, the AST of
+the body of <code class="docutils literal"><span class="pre">foo</span></code> is referenced by a single <code class="docutils literal"><span class="pre">Stmt*</span></code>.  We can then construct
+an instance of <code class="docutils literal"><span class="pre">CFG</span></code> representing the control-flow graph of this function
+body by single call to a static class method:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">Stmt</span> <span class="o">*</span><span class="n">FooBody</span> <span class="o">=</span> <span class="p">...</span>
+<span class="n">std</span><span class="o">::</span><span class="n">unique_ptr</span><span class="o"><</span><span class="n">CFG</span><span class="o">></span> <span class="n">FooCFG</span> <span class="o">=</span> <span class="n">CFG</span><span class="o">::</span><span class="n">buildCFG</span><span class="p">(</span><span class="n">FooBody</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>Along with providing an interface to iterate over its <code class="docutils literal"><span class="pre">CFGBlocks</span></code>, the
+<code class="docutils literal"><span class="pre">CFG</span></code> class also provides methods that are useful for debugging and
+visualizing CFGs.  For example, the method <code class="docutils literal"><span class="pre">CFG::dump()</span></code> dumps a
+pretty-printed version of the CFG to standard error.  This is especially useful
+when one is using a debugger such as gdb.  For example, here is the output of
+<code class="docutils literal"><span class="pre">FooCFG->dump()</span></code>:</p>
+<div class="highlight-text"><div class="highlight"><pre><span></span>[ B5 (ENTRY) ]
+   Predecessors (0):
+   Successors (1): B4
+
+[ B4 ]
+   1: x = x + 1
+   2: (x > 2)
+   T: if [B4.2]
+   Predecessors (1): B5
+   Successors (2): B3 B2
+
+[ B3 ]
+   1: x++
+   Predecessors (1): B4
+   Successors (1): B1
+
+[ B2 ]
+   1: x += 2
+   2: x *= 2
+   Predecessors (1): B4
+   Successors (1): B1
+
+[ B1 ]
+   1: return x;
+   Predecessors (2): B2 B3
+   Successors (1): B0
+
+[ B0 (EXIT) ]
+   Predecessors (1): B1
+   Successors (0):
+</pre></div>
+</div>
+<p>For each block, the pretty-printed output displays for each block the number of
+<em>predecessor</em> blocks (blocks that have outgoing control-flow to the given
+block) and <em>successor</em> blocks (blocks that have control-flow that have incoming
+control-flow from the given block).  We can also clearly see the special entry
+and exit blocks at the beginning and end of the pretty-printed output.  For the
+entry block (block B5), the number of predecessor blocks is 0, while for the
+exit block (block B0) the number of successor blocks is 0.</p>
+<p>The most interesting block here is B4, whose outgoing control-flow represents
+the branching caused by the sole if-statement in <code class="docutils literal"><span class="pre">foo</span></code>.  Of particular
+interest is the second statement in the block, <code class="docutils literal"><span class="pre">(x</span> <span class="pre">></span> <span class="pre">2)</span></code>, and the terminator,
+printed as <code class="docutils literal"><span class="pre">if</span> <span class="pre">[B4.2]</span></code>.  The second statement represents the evaluation of
+the condition of the if-statement, which occurs before the actual branching of
+control-flow.  Within the <code class="docutils literal"><span class="pre">CFGBlock</span></code> for B4, the <code class="docutils literal"><span class="pre">Stmt*</span></code> for the second
+statement refers to the actual expression in the AST for <code class="docutils literal"><span class="pre">(x</span> <span class="pre">></span> <span class="pre">2)</span></code>.  Thus
+pointers to subclasses of <code class="docutils literal"><span class="pre">Expr</span></code> can appear in the list of statements in a
+block, and not just subclasses of <code class="docutils literal"><span class="pre">Stmt</span></code> that refer to proper C statements.</p>
+<p>The terminator of block B4 is a pointer to the <code class="docutils literal"><span class="pre">IfStmt</span></code> object in the AST.
+The pretty-printer outputs <code class="docutils literal"><span class="pre">if</span> <span class="pre">[B4.2]</span></code> because the condition expression of
+the if-statement has an actual place in the basic block, and thus the
+terminator is essentially <em>referring</em> to the expression that is the second
+statement of block B4 (i.e., B4.2).  In this manner, conditions for
+control-flow (which also includes conditions for loops and switch statements)
+are hoisted into the actual basic block.</p>
+</div>
+</div>
+<div class="section" id="constant-folding-in-the-clang-ast">
+<h3><a class="toc-backref" href="#id40">Constant Folding in the Clang AST</a><a class="headerlink" href="#constant-folding-in-the-clang-ast" title="Permalink to this headline">¶</a></h3>
+<p>There are several places where constants and constant folding matter a lot to
+the Clang front-end.  First, in general, we prefer the AST to retain the source
+code as close to how the user wrote it as possible.  This means that if they
+wrote “<code class="docutils literal"><span class="pre">5+4</span></code>”, we want to keep the addition and two constants in the AST, we
+don’t want to fold to “<code class="docutils literal"><span class="pre">9</span></code>”.  This means that constant folding in various
+ways turns into a tree walk that needs to handle the various cases.</p>
+<p>However, there are places in both C and C++ that require constants to be
+folded.  For example, the C standard defines what an “integer constant
+expression” (i-c-e) is with very precise and specific requirements.  The
+language then requires i-c-e’s in a lot of places (for example, the size of a
+bitfield, the value for a case statement, etc).  For these, we have to be able
+to constant fold the constants, to do semantic checks (e.g., verify bitfield
+size is non-negative and that case statements aren’t duplicated).  We aim for
+Clang to be very pedantic about this, diagnosing cases when the code does not
+use an i-c-e where one is required, but accepting the code unless running with
+<code class="docutils literal"><span class="pre">-pedantic-errors</span></code>.</p>
+<p>Things get a little bit more tricky when it comes to compatibility with
+real-world source code.  Specifically, GCC has historically accepted a huge
+superset of expressions as i-c-e’s, and a lot of real world code depends on
+this unfortuate accident of history (including, e.g., the glibc system
+headers).  GCC accepts anything its “fold” optimizer is capable of reducing to
+an integer constant, which means that the definition of what it accepts changes
+as its optimizer does.  One example is that GCC accepts things like “<code class="docutils literal"><span class="pre">case</span>
+<span class="pre">X-X:</span></code>” even when <code class="docutils literal"><span class="pre">X</span></code> is a variable, because it can fold this to 0.</p>
+<p>Another issue are how constants interact with the extensions we support, such
+as <code class="docutils literal"><span class="pre">__builtin_constant_p</span></code>, <code class="docutils literal"><span class="pre">__builtin_inf</span></code>, <code class="docutils literal"><span class="pre">__extension__</span></code> and many
+others.  C99 obviously does not specify the semantics of any of these
+extensions, and the definition of i-c-e does not include them.  However, these
+extensions are often used in real code, and we have to have a way to reason
+about them.</p>
+<p>Finally, this is not just a problem for semantic analysis.  The code generator
+and other clients have to be able to fold constants (e.g., to initialize global
+variables) and has to handle a superset of what C99 allows.  Further, these
+clients can benefit from extended information.  For example, we know that
+“<code class="docutils literal"><span class="pre">foo()</span> <span class="pre">||</span> <span class="pre">1</span></code>” always evaluates to <code class="docutils literal"><span class="pre">true</span></code>, but we can’t replace the
+expression with <code class="docutils literal"><span class="pre">true</span></code> because it has side effects.</p>
+<div class="section" id="implementation-approach">
+<h4><a class="toc-backref" href="#id41">Implementation Approach</a><a class="headerlink" href="#implementation-approach" title="Permalink to this headline">¶</a></h4>
+<p>After trying several different approaches, we’ve finally converged on a design
+(Note, at the time of this writing, not all of this has been implemented,
+consider this a design goal!).  Our basic approach is to define a single
+recursive method evaluation method (<code class="docutils literal"><span class="pre">Expr::Evaluate</span></code>), which is implemented
+in <code class="docutils literal"><span class="pre">AST/ExprConstant.cpp</span></code>.  Given an expression with “scalar” type (integer,
+fp, complex, or pointer) this method returns the following information:</p>
+<ul class="simple">
+<li>Whether the expression is an integer constant expression, a general constant
+that was folded but has no side effects, a general constant that was folded
+but that does have side effects, or an uncomputable/unfoldable value.</li>
+<li>If the expression was computable in any way, this method returns the
+<code class="docutils literal"><span class="pre">APValue</span></code> for the result of the expression.</li>
+<li>If the expression is not evaluatable at all, this method returns information
+on one of the problems with the expression.  This includes a
+<code class="docutils literal"><span class="pre">SourceLocation</span></code> for where the problem is, and a diagnostic ID that explains
+the problem.  The diagnostic should have <code class="docutils literal"><span class="pre">ERROR</span></code> type.</li>
+<li>If the expression is not an integer constant expression, this method returns
+information on one of the problems with the expression.  This includes a
+<code class="docutils literal"><span class="pre">SourceLocation</span></code> for where the problem is, and a diagnostic ID that
+explains the problem.  The diagnostic should have <code class="docutils literal"><span class="pre">EXTENSION</span></code> type.</li>
+</ul>
+<p>This information gives various clients the flexibility that they want, and we
+will eventually have some helper methods for various extensions.  For example,
+<code class="docutils literal"><span class="pre">Sema</span></code> should have a <code class="docutils literal"><span class="pre">Sema::VerifyIntegerConstantExpression</span></code> method, which
+calls <code class="docutils literal"><span class="pre">Evaluate</span></code> on the expression.  If the expression is not foldable, the
+error is emitted, and it would return <code class="docutils literal"><span class="pre">true</span></code>.  If the expression is not an
+i-c-e, the <code class="docutils literal"><span class="pre">EXTENSION</span></code> diagnostic is emitted.  Finally it would return
+<code class="docutils literal"><span class="pre">false</span></code> to indicate that the AST is OK.</p>
+<p>Other clients can use the information in other ways, for example, codegen can
+just use expressions that are foldable in any way.</p>
+</div>
+<div class="section" id="extensions">
+<h4><a class="toc-backref" href="#id42">Extensions</a><a class="headerlink" href="#extensions" title="Permalink to this headline">¶</a></h4>
+<p>This section describes how some of the various extensions Clang supports
+interacts with constant evaluation:</p>
+<ul class="simple">
+<li><code class="docutils literal"><span class="pre">__extension__</span></code>: The expression form of this extension causes any
+evaluatable subexpression to be accepted as an integer constant expression.</li>
+<li><code class="docutils literal"><span class="pre">__builtin_constant_p</span></code>: This returns true (as an integer constant
+expression) if the operand evaluates to either a numeric value (that is, not
+a pointer cast to integral type) of integral, enumeration, floating or
+complex type, or if it evaluates to the address of the first character of a
+string literal (possibly cast to some other type).  As a special case, if
+<code class="docutils literal"><span class="pre">__builtin_constant_p</span></code> is the (potentially parenthesized) condition of a
+conditional operator expression (“<code class="docutils literal"><span class="pre">?:</span></code>”), only the true side of the
+conditional operator is considered, and it is evaluated with full constant
+folding.</li>
+<li><code class="docutils literal"><span class="pre">__builtin_choose_expr</span></code>: The condition is required to be an integer
+constant expression, but we accept any constant as an “extension of an
+extension”.  This only evaluates one operand depending on which way the
+condition evaluates.</li>
+<li><code class="docutils literal"><span class="pre">__builtin_classify_type</span></code>: This always returns an integer constant
+expression.</li>
+<li><code class="docutils literal"><span class="pre">__builtin_inf,</span> <span class="pre">nan,</span> <span class="pre">...</span></code>: These are treated just like a floating-point
+literal.</li>
+<li><code class="docutils literal"><span class="pre">__builtin_abs,</span> <span class="pre">copysign,</span> <span class="pre">...</span></code>: These are constant folded as general
+constant expressions.</li>
+<li><code class="docutils literal"><span class="pre">__builtin_strlen</span></code> and <code class="docutils literal"><span class="pre">strlen</span></code>: These are constant folded as integer
+constant expressions if the argument is a string literal.</li>
+</ul>
+</div>
+</div>
+</div>
+<div class="section" id="the-sema-library">
+<span id="sema"></span><h2><a class="toc-backref" href="#id43">The Sema Library</a><a class="headerlink" href="#the-sema-library" title="Permalink to this headline">¶</a></h2>
+<p>This library is called by the <a class="reference internal" href="#parser"><span class="std std-ref">Parser library</span></a> during parsing to
+do semantic analysis of the input.  For valid programs, Sema builds an AST for
+parsed constructs.</p>
+</div>
+<div class="section" id="the-codegen-library">
+<span id="codegen"></span><h2><a class="toc-backref" href="#id44">The CodeGen Library</a><a class="headerlink" href="#the-codegen-library" title="Permalink to this headline">¶</a></h2>
+<p>CodeGen takes an <a class="reference internal" href="#ast"><span class="std std-ref">AST</span></a> as input and produces <a class="reference external" href="//llvm.org/docs/LangRef.html">LLVM IR code</a> from it.</p>
+</div>
+<div class="section" id="how-to-change-clang">
+<h2><a class="toc-backref" href="#id45">How to change Clang</a><a class="headerlink" href="#how-to-change-clang" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="how-to-add-an-attribute">
+<h3><a class="toc-backref" href="#id46">How to add an attribute</a><a class="headerlink" href="#how-to-add-an-attribute" title="Permalink to this headline">¶</a></h3>
+<p>Attributes are a form of metadata that can be attached to a program construct,
+allowing the programmer to pass semantic information along to the compiler for
+various uses. For example, attributes may be used to alter the code generation
+for a program construct, or to provide extra semantic information for static
+analysis. This document explains how to add a custom attribute to Clang.
+Documentation on existing attributes can be found <a class="reference external" href="//clang.llvm.org/docs/AttributeReference.html">here</a>.</p>
+<div class="section" id="attribute-basics">
+<h4><a class="toc-backref" href="#id47">Attribute Basics</a><a class="headerlink" href="#attribute-basics" title="Permalink to this headline">¶</a></h4>
+<p>Attributes in Clang are handled in three stages: parsing into a parsed attribute
+representation, conversion from a parsed attribute into a semantic attribute,
+and then the semantic handling of the attribute.</p>
+<p>Parsing of the attribute is determined by the various syntactic forms attributes
+can take, such as GNU, C++11, and Microsoft style attributes, as well as other
+information provided by the table definition of the attribute. Ultimately, the
+parsed representation of an attribute object is an <code class="docutils literal"><span class="pre">AttributeList</span></code> object.
+These parsed attributes chain together as a list of parsed attributes attached
+to a declarator or declaration specifier. The parsing of attributes is handled
+automatically by Clang, except for attributes spelled as keywords. When
+implementing a keyword attribute, the parsing of the keyword and creation of the
+<code class="docutils literal"><span class="pre">AttributeList</span></code> object must be done manually.</p>
+<p>Eventually, <code class="docutils literal"><span class="pre">Sema::ProcessDeclAttributeList()</span></code> is called with a <code class="docutils literal"><span class="pre">Decl</span></code> and
+an <code class="docutils literal"><span class="pre">AttributeList</span></code>, at which point the parsed attribute can be transformed
+into a semantic attribute. The process by which a parsed attribute is converted
+into a semantic attribute depends on the attribute definition and semantic
+requirements of the attribute. The end result, however, is that the semantic
+attribute object is attached to the <code class="docutils literal"><span class="pre">Decl</span></code> object, and can be obtained by a
+call to <code class="docutils literal"><span class="pre">Decl::getAttr<T>()</span></code>.</p>
+<p>The structure of the semantic attribute is also governed by the attribute
+definition given in Attr.td. This definition is used to automatically generate
+functionality used for the implementation of the attribute, such as a class
+derived from <code class="docutils literal"><span class="pre">clang::Attr</span></code>, information for the parser to use, automated
+semantic checking for some attributes, etc.</p>
+</div>
+<div class="section" id="include-clang-basic-attr-td">
+<h4><a class="toc-backref" href="#id48"><code class="docutils literal"><span class="pre">include/clang/Basic/Attr.td</span></code></a><a class="headerlink" href="#include-clang-basic-attr-td" title="Permalink to this headline">¶</a></h4>
+<p>The first step to adding a new attribute to Clang is to add its definition to
+<a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Attr.td?view=markup">include/clang/Basic/Attr.td</a>.
+This tablegen definition must derive from the <code class="docutils literal"><span class="pre">Attr</span></code> (tablegen, not
+semantic) type, or one of its derivatives. Most attributes will derive from the
+<code class="docutils literal"><span class="pre">InheritableAttr</span></code> type, which specifies that the attribute can be inherited by
+later redeclarations of the <code class="docutils literal"><span class="pre">Decl</span></code> it is associated with.
+<code class="docutils literal"><span class="pre">InheritableParamAttr</span></code> is similar to <code class="docutils literal"><span class="pre">InheritableAttr</span></code>, except that the
+attribute is written on a parameter instead of a declaration. If the attribute
+is intended to apply to a type instead of a declaration, such an attribute
+should derive from <code class="docutils literal"><span class="pre">TypeAttr</span></code>, and will generally not be given an AST
+representation. (Note that this document does not cover the creation of type
+attributes.) An attribute that inherits from <code class="docutils literal"><span class="pre">IgnoredAttr</span></code> is parsed, but will
+generate an ignored attribute diagnostic when used, which may be useful when an
+attribute is supported by another vendor but not supported by clang.</p>
+<p>The definition will specify several key pieces of information, such as the
+semantic name of the attribute, the spellings the attribute supports, the
+arguments the attribute expects, and more. Most members of the <code class="docutils literal"><span class="pre">Attr</span></code> tablegen
+type do not require definitions in the derived definition as the default
+suffice. However, every attribute must specify at least a spelling list, a
+subject list, and a documentation list.</p>
+<div class="section" id="spellings">
+<h5><a class="toc-backref" href="#id49">Spellings</a><a class="headerlink" href="#spellings" title="Permalink to this headline">¶</a></h5>
+<p>All attributes are required to specify a spelling list that denotes the ways in
+which the attribute can be spelled. For instance, a single semantic attribute
+may have a keyword spelling, as well as a C++11 spelling and a GNU spelling. An
+empty spelling list is also permissible and may be useful for attributes which
+are created implicitly. The following spellings are accepted:</p>
+<blockquote>
+<div><table border="1" class="docutils">
+<colgroup>
+<col width="16%" />
+<col width="84%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">Spelling</th>
+<th class="head">Description</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td><code class="docutils literal"><span class="pre">GNU</span></code></td>
+<td>Spelled with a GNU-style <code class="docutils literal"><span class="pre">__attribute__((attr))</span></code> syntax and
+placement.</td>
+</tr>
+<tr class="row-odd"><td><code class="docutils literal"><span class="pre">CXX11</span></code></td>
+<td>Spelled with a C++-style <code class="docutils literal"><span class="pre">[[attr]]</span></code> syntax. If the attribute
+is meant to be used by Clang, it should set the namespace to
+<code class="docutils literal"><span class="pre">"clang"</span></code>.</td>
+</tr>
+<tr class="row-even"><td><code class="docutils literal"><span class="pre">Declspec</span></code></td>
+<td>Spelled with a Microsoft-style <code class="docutils literal"><span class="pre">__declspec(attr)</span></code> syntax.</td>
+</tr>
+<tr class="row-odd"><td><code class="docutils literal"><span class="pre">Keyword</span></code></td>
+<td>The attribute is spelled as a keyword, and required custom
+parsing.</td>
+</tr>
+<tr class="row-even"><td><code class="docutils literal"><span class="pre">GCC</span></code></td>
+<td>Specifies two spellings: the first is a GNU-style spelling, and
+the second is a C++-style spelling with the <code class="docutils literal"><span class="pre">gnu</span></code> namespace.
+Attributes should only specify this spelling for attributes
+supported by GCC.</td>
+</tr>
+<tr class="row-odd"><td><code class="docutils literal"><span class="pre">Pragma</span></code></td>
+<td>The attribute is spelled as a <code class="docutils literal"><span class="pre">#pragma</span></code>, and requires custom
+processing within the preprocessor. If the attribute is meant to
+be used by Clang, it should set the namespace to <code class="docutils literal"><span class="pre">"clang"</span></code>.
+Note that this spelling is not used for declaration attributes.</td>
+</tr>
+</tbody>
+</table>
+</div></blockquote>
+</div>
+<div class="section" id="subjects">
+<h5><a class="toc-backref" href="#id50">Subjects</a><a class="headerlink" href="#subjects" title="Permalink to this headline">¶</a></h5>
+<p>Attributes appertain to one or more <code class="docutils literal"><span class="pre">Decl</span></code> subjects. If the attribute attempts
+to attach to a subject that is not in the subject list, a diagnostic is issued
+automatically. Whether the diagnostic is a warning or an error depends on how
+the attribute’s <code class="docutils literal"><span class="pre">SubjectList</span></code> is defined, but the default behavior is to warn.
+The diagnostics displayed to the user are automatically determined based on the
+subjects in the list, but a custom diagnostic parameter can also be specified in
+the <code class="docutils literal"><span class="pre">SubjectList</span></code>. The diagnostics generated for subject list violations are
+either <code class="docutils literal"><span class="pre">diag::warn_attribute_wrong_decl_type</span></code> or
+<code class="docutils literal"><span class="pre">diag::err_attribute_wrong_decl_type</span></code>, and the parameter enumeration is found
+in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/AttributeList.h?view=markup">include/clang/Sema/AttributeList.h</a>
+If a previously unused Decl node is added to the <code class="docutils literal"><span class="pre">SubjectList</span></code>, the logic used
+to automatically determine the diagnostic parameter in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?view=markup">utils/TableGen/ClangAttrEmitter.cpp</a>
+may need to be updated.</p>
+<p>By default, all subjects in the SubjectList must either be a Decl node defined
+in <code class="docutils literal"><span class="pre">DeclNodes.td</span></code>, or a statement node defined in <code class="docutils literal"><span class="pre">StmtNodes.td</span></code>. However,
+more complex subjects can be created by creating a <code class="docutils literal"><span class="pre">SubsetSubject</span></code> object.
+Each such object has a base subject which it appertains to (which must be a
+Decl or Stmt node, and not a SubsetSubject node), and some custom code which is
+called when determining whether an attribute appertains to the subject. For
+instance, a <code class="docutils literal"><span class="pre">NonBitField</span></code> SubsetSubject appertains to a <code class="docutils literal"><span class="pre">FieldDecl</span></code>, and
+tests whether the given FieldDecl is a bit field. When a SubsetSubject is
+specified in a SubjectList, a custom diagnostic parameter must also be provided.</p>
+<p>Diagnostic checking for attribute subject lists is automated except when
+<code class="docutils literal"><span class="pre">HasCustomParsing</span></code> is set to <code class="docutils literal"><span class="pre">1</span></code>.</p>
+</div>
+<div class="section" id="documentation">
+<h5><a class="toc-backref" href="#id51">Documentation</a><a class="headerlink" href="#documentation" title="Permalink to this headline">¶</a></h5>
+<p>All attributes must have some form of documentation associated with them.
+Documentation is table generated on the public web server by a server-side
+process that runs daily. Generally, the documentation for an attribute is a
+stand-alone definition in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/AttdDocs.td?view=markup">include/clang/Basic/AttrDocs.td</a>
+that is named after the attribute being documented.</p>
+<p>If the attribute is not for public consumption, or is an implicitly-created
+attribute that has no visible spelling, the documentation list can specify the
+<code class="docutils literal"><span class="pre">Undocumented</span></code> object. Otherwise, the attribute should have its documentation
+added to AttrDocs.td.</p>
+<p>Documentation derives from the <code class="docutils literal"><span class="pre">Documentation</span></code> tablegen type. All derived
+types must specify a documentation category and the actual documentation itself.
+Additionally, it can specify a custom heading for the attribute, though a
+default heading will be chosen when possible.</p>
+<p>There are four predefined documentation categories: <code class="docutils literal"><span class="pre">DocCatFunction</span></code> for
+attributes that appertain to function-like subjects, <code class="docutils literal"><span class="pre">DocCatVariable</span></code> for
+attributes that appertain to variable-like subjects, <code class="docutils literal"><span class="pre">DocCatType</span></code> for type
+attributes, and <code class="docutils literal"><span class="pre">DocCatStmt</span></code> for statement attributes. A custom documentation
+category should be used for groups of attributes with similar functionality.
+Custom categories are good for providing overview information for the attributes
+grouped under it. For instance, the consumed annotation attributes define a
+custom category, <code class="docutils literal"><span class="pre">DocCatConsumed</span></code>, that explains what consumed annotations are
+at a high level.</p>
+<p>Documentation content (whether it is for an attribute or a category) is written
+using reStructuredText (RST) syntax.</p>
+<p>After writing the documentation for the attribute, it should be locally tested
+to ensure that there are no issues generating the documentation on the server.
+Local testing requires a fresh build of clang-tblgen. To generate the attribute
+documentation, execute the following command:</p>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">clang</span><span class="o">-</span><span class="n">tblgen</span> <span class="o">-</span><span class="n">gen</span><span class="o">-</span><span class="n">attr</span><span class="o">-</span><span class="n">docs</span> <span class="o">-</span><span class="n">I</span> <span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">clang</span><span class="o">/</span><span class="n">include</span> <span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">clang</span><span class="o">/</span><span class="n">include</span><span class="o">/</span><span class="n">clang</span><span class="o">/</span><span class="n">Basic</span><span class="o">/</span><span class="n">Attr</span><span class="o">.</span><span class="n">td</span> <span class="o">-</span><span class="n">o</span> <span class="o">/</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">clang</span><span class="o">/</span><span class="n">docs</span><span class="o">/</span><span class="n">AttributeReference</span><span class="o">.</span><span class="n">rst</span>
+</pre></div>
+</div>
+<p>When testing locally, <em>do not</em> commit changes to <code class="docutils literal"><span class="pre">AttributeReference.rst</span></code>.
+This file is generated by the server automatically, and any changes made to this
+file will be overwritten.</p>
+</div>
+<div class="section" id="arguments">
+<h5><a class="toc-backref" href="#id52">Arguments</a><a class="headerlink" href="#arguments" title="Permalink to this headline">¶</a></h5>
+<p>Attributes may optionally specify a list of arguments that can be passed to the
+attribute. Attribute arguments specify both the parsed form and the semantic
+form of the attribute. For example, if <code class="docutils literal"><span class="pre">Args</span></code> is
+<code class="docutils literal"><span class="pre">[StringArgument<"Arg1">,</span> <span class="pre">IntArgument<"Arg2">]</span></code> then
+<code class="docutils literal"><span class="pre">__attribute__((myattribute("Hello",</span> <span class="pre">3)))</span></code> will be a valid use; it requires
+two arguments while parsing, and the Attr subclass’ constructor for the
+semantic attribute will require a string and integer argument.</p>
+<p>All arguments have a name and a flag that specifies whether the argument is
+optional. The associated C++ type of the argument is determined by the argument
+definition type. If the existing argument types are insufficient, new types can
+be created, but it requires modifying <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/TableGen/ClangAttrEmitter.cpp?view=markup">utils/TableGen/ClangAttrEmitter.cpp</a>
+to properly support the type.</p>
+</div>
+<div class="section" id="other-properties">
+<h5><a class="toc-backref" href="#id53">Other Properties</a><a class="headerlink" href="#other-properties" title="Permalink to this headline">¶</a></h5>
+<p>The <code class="docutils literal"><span class="pre">Attr</span></code> definition has other members which control the behavior of the
+attribute. Many of them are special-purpose and beyond the scope of this
+document, however a few deserve mention.</p>
+<p>If the parsed form of the attribute is more complex, or differs from the
+semantic form, the <code class="docutils literal"><span class="pre">HasCustomParsing</span></code> bit can be set to <code class="docutils literal"><span class="pre">1</span></code> for the class,
+and the parsing code in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?view=markup">Parser::ParseGNUAttributeArgs()</a>
+can be updated for the special case. Note that this only applies to arguments
+with a GNU spelling – attributes with a __declspec spelling currently ignore
+this flag and are handled by <code class="docutils literal"><span class="pre">Parser::ParseMicrosoftDeclSpec</span></code>.</p>
+<p>Note that setting this member to 1 will opt out of common attribute semantic
+handling, requiring extra implementation efforts to ensure the attribute
+appertains to the appropriate subject, etc.</p>
+<p>If the attribute should not be propagated from from a template declaration to an
+instantiation of the template, set the <code class="docutils literal"><span class="pre">Clone</span></code> member to 0. By default, all
+attributes will be cloned to template instantiations.</p>
+<p>Attributes that do not require an AST node should set the <code class="docutils literal"><span class="pre">ASTNode</span></code> field to
+<code class="docutils literal"><span class="pre">0</span></code> to avoid polluting the AST. Note that anything inheriting from
+<code class="docutils literal"><span class="pre">TypeAttr</span></code> or <code class="docutils literal"><span class="pre">IgnoredAttr</span></code> automatically do not generate an AST node. All
+other attributes generate an AST node by default. The AST node is the semantic
+representation of the attribute.</p>
+<p>The <code class="docutils literal"><span class="pre">LangOpts</span></code> field specifies a list of language options required by the
+attribute.  For instance, all of the CUDA-specific attributes specify <code class="docutils literal"><span class="pre">[CUDA]</span></code>
+for the <code class="docutils literal"><span class="pre">LangOpts</span></code> field, and when the CUDA language option is not enabled, an
+“attribute ignored” warning diagnostic is emitted. Since language options are
+not table generated nodes, new language options must be created manually and
+should specify the spelling used by <code class="docutils literal"><span class="pre">LangOptions</span></code> class.</p>
+<p>Custom accessors can be generated for an attribute based on the spelling list
+for that attribute. For instance, if an attribute has two different spellings:
+‘Foo’ and ‘Bar’, accessors can be created:
+<code class="docutils literal"><span class="pre">[Accessor<"isFoo",</span> <span class="pre">[GNU<"Foo">]>,</span> <span class="pre">Accessor<"isBar",</span> <span class="pre">[GNU<"Bar">]>]</span></code>
+These accessors will be generated on the semantic form of the attribute,
+accepting no arguments and returning a <code class="docutils literal"><span class="pre">bool</span></code>.</p>
+<p>Attributes that do not require custom semantic handling should set the
+<code class="docutils literal"><span class="pre">SemaHandler</span></code> field to <code class="docutils literal"><span class="pre">0</span></code>. Note that anything inheriting from
+<code class="docutils literal"><span class="pre">IgnoredAttr</span></code> automatically do not get a semantic handler. All other
+attributes are assumed to use a semantic handler by default. Attributes
+without a semantic handler are not given a parsed attribute <code class="docutils literal"><span class="pre">Kind</span></code> enumerator.</p>
+<p>Target-specific attributes may share a spelling with other attributes in
+different targets. For instance, the ARM and MSP430 targets both have an
+attribute spelled <code class="docutils literal"><span class="pre">GNU<"interrupt"></span></code>, but with different parsing and semantic
+requirements. To support this feature, an attribute inheriting from
+<code class="docutils literal"><span class="pre">TargetSpecificAttribute</span></code> may specify a <code class="docutils literal"><span class="pre">ParseKind</span></code> field. This field
+should be the same value between all arguments sharing a spelling, and
+corresponds to the parsed attribute’s <code class="docutils literal"><span class="pre">Kind</span></code> enumerator. This allows
+attributes to share a parsed attribute kind, but have distinct semantic
+attribute classes. For instance, <code class="docutils literal"><span class="pre">AttributeList::AT_Interrupt</span></code> is the shared
+parsed attribute kind, but ARMInterruptAttr and MSP430InterruptAttr are the
+semantic attributes generated.</p>
+<p>By default, when declarations are merging attributes, an attribute will not be
+duplicated. However, if an attribute can be duplicated during this merging
+stage, set <code class="docutils literal"><span class="pre">DuplicatesAllowedWhileMerging</span></code> to <code class="docutils literal"><span class="pre">1</span></code>, and the attribute will
+be merged.</p>
+<p>By default, attribute arguments are parsed in an evaluated context. If the
+arguments for an attribute should be parsed in an unevaluated context (akin to
+the way the argument to a <code class="docutils literal"><span class="pre">sizeof</span></code> expression is parsed), set
+<code class="docutils literal"><span class="pre">ParseArgumentsAsUnevaluated</span></code> to <code class="docutils literal"><span class="pre">1</span></code>.</p>
+<p>If additional functionality is desired for the semantic form of the attribute,
+the <code class="docutils literal"><span class="pre">AdditionalMembers</span></code> field specifies code to be copied verbatim into the
+semantic attribute class object, with <code class="docutils literal"><span class="pre">public</span></code> access.</p>
+</div>
+</div>
+<div class="section" id="boilerplate">
+<h4><a class="toc-backref" href="#id54">Boilerplate</a><a class="headerlink" href="#boilerplate" title="Permalink to this headline">¶</a></h4>
+<p>All semantic processing of declaration attributes happens in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?view=markup">lib/Sema/SemaDeclAttr.cpp</a>,
+and generally starts in the <code class="docutils literal"><span class="pre">ProcessDeclAttribute()</span></code> function. If the
+attribute is a “simple” attribute – meaning that it requires no custom semantic
+processing aside from what is automatically  provided, add a call to
+<code class="docutils literal"><span class="pre">handleSimpleAttribute<YourAttr>(S,</span> <span class="pre">D,</span> <span class="pre">Attr);</span></code> to the switch statement.
+Otherwise, write a new <code class="docutils literal"><span class="pre">handleYourAttr()</span></code> function, and add that to the switch
+statement. Please do not implement handling logic directly in the <code class="docutils literal"><span class="pre">case</span></code> for
+the attribute.</p>
+<p>Unless otherwise specified by the attribute definition, common semantic checking
+of the parsed attribute is handled automatically. This includes diagnosing
+parsed attributes that do not appertain to the given <code class="docutils literal"><span class="pre">Decl</span></code>, ensuring the
+correct minimum number of arguments are passed, etc.</p>
+<p>If the attribute adds additional warnings, define a <code class="docutils literal"><span class="pre">DiagGroup</span></code> in
+<a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?view=markup">include/clang/Basic/DiagnosticGroups.td</a>
+named after the attribute’s <code class="docutils literal"><span class="pre">Spelling</span></code> with “_”s replaced by “-“s. If there
+is only a single diagnostic, it is permissible to use <code class="docutils literal"><span class="pre">InGroup<DiagGroup<"your-attribute">></span></code>
+directly in <a class="reference external" href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?view=markup">DiagnosticSemaKinds.td</a></p>
+<p>All semantic diagnostics generated for your attribute, including automatically-
+generated ones (such as subjects and argument counts), should have a
+corresponding test case.</p>
+</div>
+<div class="section" id="semantic-handling">
+<h4><a class="toc-backref" href="#id55">Semantic handling</a><a class="headerlink" href="#semantic-handling" title="Permalink to this headline">¶</a></h4>
+<p>Most attributes are implemented to have some effect on the compiler. For
+instance, to modify the way code is generated, or to add extra semantic checks
+for an analysis pass, etc. Having added the attribute definition and conversion
+to the semantic representation for the attribute, what remains is to implement
+the custom logic requiring use of the attribute.</p>
+<p>The <code class="docutils literal"><span class="pre">clang::Decl</span></code> object can be queried for the presence or absence of an
+attribute using <code class="docutils literal"><span class="pre">hasAttr<T>()</span></code>. To obtain a pointer to the semantic
+representation of the attribute, <code class="docutils literal"><span class="pre">getAttr<T></span></code> may be used.</p>
+</div>
+</div>
+<div class="section" id="how-to-add-an-expression-or-statement">
+<h3><a class="toc-backref" href="#id56">How to add an expression or statement</a><a class="headerlink" href="#how-to-add-an-expression-or-statement" title="Permalink to this headline">¶</a></h3>
+<p>Expressions and statements are one of the most fundamental constructs within a
+compiler, because they interact with many different parts of the AST, semantic
+analysis, and IR generation.  Therefore, adding a new expression or statement
+kind into Clang requires some care.  The following list details the various
+places in Clang where an expression or statement needs to be introduced, along
+with patterns to follow to ensure that the new expression or statement works
+well across all of the C languages.  We focus on expressions, but statements
+are similar.</p>
+<ol class="arabic simple">
+<li>Introduce parsing actions into the parser.  Recursive-descent parsing is
+mostly self-explanatory, but there are a few things that are worth keeping
+in mind:<ul>
+<li>Keep as much source location information as possible! You’ll want it later
+to produce great diagnostics and support Clang’s various features that map
+between source code and the AST.</li>
+<li>Write tests for all of the “bad” parsing cases, to make sure your recovery
+is good.  If you have matched delimiters (e.g., parentheses, square
+brackets, etc.), use <code class="docutils literal"><span class="pre">Parser::BalancedDelimiterTracker</span></code> to give nice
+diagnostics when things go wrong.</li>
+</ul>
+</li>
+<li>Introduce semantic analysis actions into <code class="docutils literal"><span class="pre">Sema</span></code>.  Semantic analysis should
+always involve two functions: an <code class="docutils literal"><span class="pre">ActOnXXX</span></code> function that will be called
+directly from the parser, and a <code class="docutils literal"><span class="pre">BuildXXX</span></code> function that performs the
+actual semantic analysis and will (eventually!) build the AST node.  It’s
+fairly common for the <code class="docutils literal"><span class="pre">ActOnCXX</span></code> function to do very little (often just
+some minor translation from the parser’s representation to <code class="docutils literal"><span class="pre">Sema</span></code>’s
+representation of the same thing), but the separation is still important:
+C++ template instantiation, for example, should always call the <code class="docutils literal"><span class="pre">BuildXXX</span></code>
+variant.  Several notes on semantic analysis before we get into construction
+of the AST:<ul>
+<li>Your expression probably involves some types and some subexpressions.
+Make sure to fully check that those types, and the types of those
+subexpressions, meet your expectations.  Add implicit conversions where
+necessary to make sure that all of the types line up exactly the way you
+want them.  Write extensive tests to check that you’re getting good
+diagnostics for mistakes and that you can use various forms of
+subexpressions with your expression.</li>
+<li>When type-checking a type or subexpression, make sure to first check
+whether the type is “dependent” (<code class="docutils literal"><span class="pre">Type::isDependentType()</span></code>) or whether a
+subexpression is type-dependent (<code class="docutils literal"><span class="pre">Expr::isTypeDependent()</span></code>).  If any of
+these return <code class="docutils literal"><span class="pre">true</span></code>, then you’re inside a template and you can’t do much
+type-checking now.  That’s normal, and your AST node (when you get there)
+will have to deal with this case.  At this point, you can write tests that
+use your expression within templates, but don’t try to instantiate the
+templates.</li>
+<li>For each subexpression, be sure to call <code class="docutils literal"><span class="pre">Sema::CheckPlaceholderExpr()</span></code>
+to deal with “weird” expressions that don’t behave well as subexpressions.
+Then, determine whether you need to perform lvalue-to-rvalue conversions
+(<code class="docutils literal"><span class="pre">Sema::DefaultLvalueConversions</span></code>) or the usual unary conversions
+(<code class="docutils literal"><span class="pre">Sema::UsualUnaryConversions</span></code>), for places where the subexpression is
+producing a value you intend to use.</li>
+<li>Your <code class="docutils literal"><span class="pre">BuildXXX</span></code> function will probably just return <code class="docutils literal"><span class="pre">ExprError()</span></code> at
+this point, since you don’t have an AST.  That’s perfectly fine, and
+shouldn’t impact your testing.</li>
+</ul>
+</li>
+<li>Introduce an AST node for your new expression.  This starts with declaring
+the node in <code class="docutils literal"><span class="pre">include/Basic/StmtNodes.td</span></code> and creating a new class for your
+expression in the appropriate <code class="docutils literal"><span class="pre">include/AST/Expr*.h</span></code> header.  It’s best to
+look at the class for a similar expression to get ideas, and there are some
+specific things to watch for:<ul>
+<li>If you need to allocate memory, use the <code class="docutils literal"><span class="pre">ASTContext</span></code> allocator to
+allocate memory.  Never use raw <code class="docutils literal"><span class="pre">malloc</span></code> or <code class="docutils literal"><span class="pre">new</span></code>, and never hold any
+resources in an AST node, because the destructor of an AST node is never
+called.</li>
+<li>Make sure that <code class="docutils literal"><span class="pre">getSourceRange()</span></code> covers the exact source range of your
+expression.  This is needed for diagnostics and for IDE support.</li>
+<li>Make sure that <code class="docutils literal"><span class="pre">children()</span></code> visits all of the subexpressions.  This is
+important for a number of features (e.g., IDE support, C++ variadic
+templates).  If you have sub-types, you’ll also need to visit those
+sub-types in <code class="docutils literal"><span class="pre">RecursiveASTVisitor</span></code>.</li>
+<li>Add printing support (<code class="docutils literal"><span class="pre">StmtPrinter.cpp</span></code>) for your expression.</li>
+<li>Add profiling support (<code class="docutils literal"><span class="pre">StmtProfile.cpp</span></code>) for your AST node, noting the
+distinguishing (non-source location) characteristics of an instance of
+your expression.  Omitting this step will lead to hard-to-diagnose
+failures regarding matching of template declarations.</li>
+<li>Add serialization support (<code class="docutils literal"><span class="pre">ASTReaderStmt.cpp</span></code>, <code class="docutils literal"><span class="pre">ASTWriterStmt.cpp</span></code>)
+for your AST node.</li>
+</ul>
+</li>
+<li>Teach semantic analysis to build your AST node.  At this point, you can wire
+up your <code class="docutils literal"><span class="pre">Sema::BuildXXX</span></code> function to actually create your AST.  A few
+things to check at this point:<ul>
+<li>If your expression can construct a new C++ class or return a new
+Objective-C object, be sure to update and then call
+<code class="docutils literal"><span class="pre">Sema::MaybeBindToTemporary</span></code> for your just-created AST node to be sure
+that the object gets properly destructed.  An easy way to test this is to
+return a C++ class with a private destructor: semantic analysis should
+flag an error here with the attempt to call the destructor.</li>
+<li>Inspect the generated AST by printing it using <code class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span> <span class="pre">-ast-print</span></code>,
+to make sure you’re capturing all of the important information about how
+the AST was written.</li>
+<li>Inspect the generated AST under <code class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span> <span class="pre">-ast-dump</span></code> to verify that
+all of the types in the generated AST line up the way you want them.
+Remember that clients of the AST should never have to “think” to
+understand what’s going on.  For example, all implicit conversions should
+show up explicitly in the AST.</li>
+<li>Write tests that use your expression as a subexpression of other,
+well-known expressions.  Can you call a function using your expression as
+an argument?  Can you use the ternary operator?</li>
+</ul>
+</li>
+<li>Teach code generation to create IR to your AST node.  This step is the first
+(and only) that requires knowledge of LLVM IR.  There are several things to
+keep in mind:<ul>
+<li>Code generation is separated into scalar/aggregate/complex and
+lvalue/rvalue paths, depending on what kind of result your expression
+produces.  On occasion, this requires some careful factoring of code to
+avoid duplication.</li>
+<li><code class="docutils literal"><span class="pre">CodeGenFunction</span></code> contains functions <code class="docutils literal"><span class="pre">ConvertType</span></code> and
+<code class="docutils literal"><span class="pre">ConvertTypeForMem</span></code> that convert Clang’s types (<code class="docutils literal"><span class="pre">clang::Type*</span></code> or
+<code class="docutils literal"><span class="pre">clang::QualType</span></code>) to LLVM types.  Use the former for values, and the
+later for memory locations: test with the C++ “<code class="docutils literal"><span class="pre">bool</span></code>” type to check
+this.  If you find that you are having to use LLVM bitcasts to make the
+subexpressions of your expression have the type that your expression
+expects, STOP!  Go fix semantic analysis and the AST so that you don’t
+need these bitcasts.</li>
+<li>The <code class="docutils literal"><span class="pre">CodeGenFunction</span></code> class has a number of helper functions to make
+certain operations easy, such as generating code to produce an lvalue or
+an rvalue, or to initialize a memory location with a given value.  Prefer
+to use these functions rather than directly writing loads and stores,
+because these functions take care of some of the tricky details for you
+(e.g., for exceptions).</li>
+<li>If your expression requires some special behavior in the event of an
+exception, look at the <code class="docutils literal"><span class="pre">push*Cleanup</span></code> functions in <code class="docutils literal"><span class="pre">CodeGenFunction</span></code>
+to introduce a cleanup.  You shouldn’t have to deal with
+exception-handling directly.</li>
+<li>Testing is extremely important in IR generation.  Use <code class="docutils literal"><span class="pre">clang</span> <span class="pre">-cc1</span>
+<span class="pre">-emit-llvm</span></code> and <a class="reference external" href="http://llvm.org/docs/CommandGuide/FileCheck.html">FileCheck</a> to verify that you’re
+generating the right IR.</li>
+</ul>
+</li>
+<li>Teach template instantiation how to cope with your AST node, which requires
+some fairly simple code:<ul>
+<li>Make sure that your expression’s constructor properly computes the flags
+for type dependence (i.e., the type your expression produces can change
+from one instantiation to the next), value dependence (i.e., the constant
+value your expression produces can change from one instantiation to the
+next), instantiation dependence (i.e., a template parameter occurs
+anywhere in your expression), and whether your expression contains a
+parameter pack (for variadic templates).  Often, computing these flags
+just means combining the results from the various types and
+subexpressions.</li>
+<li>Add <code class="docutils literal"><span class="pre">TransformXXX</span></code> and <code class="docutils literal"><span class="pre">RebuildXXX</span></code> functions to the <code class="docutils literal"><span class="pre">TreeTransform</span></code>
+class template in <code class="docutils literal"><span class="pre">Sema</span></code>.  <code class="docutils literal"><span class="pre">TransformXXX</span></code> should (recursively)
+transform all of the subexpressions and types within your expression,
+using <code class="docutils literal"><span class="pre">getDerived().TransformYYY</span></code>.  If all of the subexpressions and
+types transform without error, it will then call the <code class="docutils literal"><span class="pre">RebuildXXX</span></code>
+function, which will in turn call <code class="docutils literal"><span class="pre">getSema().BuildXXX</span></code> to perform
+semantic analysis and build your expression.</li>
+<li>To test template instantiation, take those tests you wrote to make sure
+that you were type checking with type-dependent expressions and dependent
+types (from step #2) and instantiate those templates with various types,
+some of which type-check and some that don’t, and test the error messages
+in each case.</li>
+</ul>
+</li>
+<li>There are some “extras” that make other features work better.  It’s worth
+handling these extras to give your expression complete integration into
+Clang:<ul>
+<li>Add code completion support for your expression in
+<code class="docutils literal"><span class="pre">SemaCodeComplete.cpp</span></code>.</li>
+<li>If your expression has types in it, or has any “interesting” features
+other than subexpressions, extend libclang’s <code class="docutils literal"><span class="pre">CursorVisitor</span></code> to provide
+proper visitation for your expression, enabling various IDE features such
+as syntax highlighting, cross-referencing, and so on.  The
+<code class="docutils literal"><span class="pre">c-index-test</span></code> helper program can be used to test these features.</li>
+</ul>
+</li>
+</ol>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav" role="navigation" aria-label="bottom navigation">
+      
+        <p>
+        «  <a href="ClangFormatStyleOptions.html">Clang-Format Style Options</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="DriverInternals.html">Driver Design & Internals</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer" role="contentinfo">
+        © Copyright 2007-2017, The Clang Team.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/5.0.1/tools/clang/docs/IntroductionToTheClangAST.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/5.0.1/tools/clang/docs/IntroductionToTheClangAST.html?rev=321287&view=auto
==============================================================================
--- www-releases/trunk/5.0.1/tools/clang/docs/IntroductionToTheClangAST.html (added)
+++ www-releases/trunk/5.0.1/tools/clang/docs/IntroductionToTheClangAST.html Thu Dec 21 10:09:53 2017
@@ -0,0 +1,178 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Introduction to the Clang AST — Clang 5 documentation</title>
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="LibTooling" href="LibTooling.html" />
+    <link rel="prev" title="External Clang Examples" href="ExternalClangExamples.html" /> 
+  </head>
+  <body>
+      <div class="header" role="banner"><h1 class="heading"><a href="index.html">
+          <span>Clang 5 documentation</span></a></h1>
+        <h2 class="heading"><span>Introduction to the Clang AST</span></h2>
+      </div>
+      <div class="topnav" role="navigation" aria-label="top navigation">
+      
+        <p>
+        «  <a href="ExternalClangExamples.html">External Clang Examples</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="LibTooling.html">LibTooling</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="introduction-to-the-clang-ast">
+<h1>Introduction to the Clang AST<a class="headerlink" href="#introduction-to-the-clang-ast" title="Permalink to this headline">¶</a></h1>
+<p>This document gives a gentle introduction to the mysteries of the Clang
+AST. It is targeted at developers who either want to contribute to
+Clang, or use tools that work based on Clang’s AST, like the AST
+matchers.</p>
+<center><iframe width="560" height="315" src="http://www.youtube.com/embed/VqCkCDFLSsc?vq=hd720" frameborder="0" allowfullscreen></iframe></center><p><a class="reference external" href="http://llvm.org/devmtg/2013-04/klimek-slides.pdf">Slides</a></p>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>Clang’s AST is different from ASTs produced by some other compilers in
+that it closely resembles both the written C++ code and the C++
+standard. For example, parenthesis expressions and compile time
+constants are available in an unreduced form in the AST. This makes
+Clang’s AST a good fit for refactoring tools.</p>
+<p>Documentation for all Clang AST nodes is available via the generated
+<a class="reference external" href="http://clang.llvm.org/doxygen">Doxygen</a>. The doxygen online
+documentation is also indexed by your favorite search engine, which will
+make a search for clang and the AST node’s class name usually turn up
+the doxygen of the class you’re looking for (for example, search for:
+clang ParenExpr).</p>
+</div>
+<div class="section" id="examining-the-ast">
+<h2>Examining the AST<a class="headerlink" href="#examining-the-ast" title="Permalink to this headline">¶</a></h2>
+<p>A good way to familarize yourself with the Clang AST is to actually look
+at it on some simple example code. Clang has a builtin AST-dump mode,
+which can be enabled with the flag <code class="docutils literal"><span class="pre">-ast-dump</span></code>.</p>
+<p>Let’s look at a simple example AST:</p>
+<div class="highlight-default"><div class="highlight"><pre><span></span>$ cat test.cc
+int f(int x) {
+  int result = (x / 42);
+  return result;
+}
+
+# Clang by default is a frontend for many tools; -Xclang is used to pass
+# options directly to the C++ frontend.
+$ clang -Xclang -ast-dump -fsyntax-only test.cc
+TranslationUnitDecl 0x5aea0d0 <<invalid sloc>>
+... cutting out internal declarations of clang ...
+`-FunctionDecl 0x5aeab50 <test.cc:1:1, line:4:1> f 'int (int)'
+  |-ParmVarDecl 0x5aeaa90 <line:1:7, col:11> x 'int'
+  `-CompoundStmt 0x5aead88 <col:14, line:4:1>
+    |-DeclStmt 0x5aead10 <line:2:3, col:24>
+    | `-VarDecl 0x5aeac10 <col:3, col:23> result 'int'
+    |   `-ParenExpr 0x5aeacf0 <col:16, col:23> 'int'
+    |     `-BinaryOperator 0x5aeacc8 <col:17, col:21> 'int' '/'
+    |       |-ImplicitCastExpr 0x5aeacb0 <col:17> 'int' <LValueToRValue>
+    |       | `-DeclRefExpr 0x5aeac68 <col:17> 'int' lvalue ParmVar 0x5aeaa90 'x' 'int'
+    |       `-IntegerLiteral 0x5aeac90 <col:21> 'int' 42
+    `-ReturnStmt 0x5aead68 <line:3:3, col:10>
+      `-ImplicitCastExpr 0x5aead50 <col:10> 'int' <LValueToRValue>
+        `-DeclRefExpr 0x5aead28 <col:10> 'int' lvalue Var 0x5aeac10 'result' 'int'
+</pre></div>
+</div>
+<p>The toplevel declaration in
+a translation unit is always the <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html">translation unit
+declaration</a>.
+In this example, our first user written declaration is the <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">function
+declaration</a>
+of “<code class="docutils literal"><span class="pre">f</span></code>”. The body of “<code class="docutils literal"><span class="pre">f</span></code>” is a <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html">compound
+statement</a>,
+whose child nodes are a <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">declaration
+statement</a>
+that declares our result variable, and the <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1ReturnStmt.html">return
+statement</a>.</p>
+</div>
+<div class="section" id="ast-context">
+<h2>AST Context<a class="headerlink" href="#ast-context" title="Permalink to this headline">¶</a></h2>
+<p>All information about the AST for a translation unit is bundled up in
+the class
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html">ASTContext</a>.
+It allows traversal of the whole translation unit starting from
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#abd909fb01ef10cfd0244832a67b1dd64">getTranslationUnitDecl</a>,
+or to access Clang’s <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1ASTContext.html#a4f95adb9958e22fbe55212ae6482feb4">table of
+identifiers</a>
+for the parsed translation unit.</p>
+</div>
+<div class="section" id="ast-nodes">
+<h2>AST Nodes<a class="headerlink" href="#ast-nodes" title="Permalink to this headline">¶</a></h2>
+<p>Clang’s AST nodes are modeled on a class hierarchy that does not have a
+common ancestor. Instead, there are multiple larger hierarchies for
+basic node types like
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a> and
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>. Many
+important AST nodes derive from
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>,
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>,
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1DeclContext.html">DeclContext</a>
+or <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>, with
+some classes deriving from both Decl and DeclContext.</p>
+<p>There are also a multitude of nodes in the AST that are not part of a
+larger hierarchy, and are only reachable from specific other nodes, like
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1CXXBaseSpecifier.html">CXXBaseSpecifier</a>.</p>
+<p>Thus, to traverse the full AST, one starts from the
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html">TranslationUnitDecl</a>
+and then recursively traverses everything that can be reached from that
+node - this information has to be encoded for each specific node type.
+This algorithm is encoded in the
+<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html">RecursiveASTVisitor</a>.
+See the <a class="reference external" href="http://clang.llvm.org/docs/RAVFrontendAction.html">RecursiveASTVisitor
+tutorial</a>.</p>
+<p>The two most basic nodes in the Clang AST are statements
+(<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>) and
+declarations
+(<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>). Note
+that expressions
+(<a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>) are
+also statements in Clang’s AST.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav" role="navigation" aria-label="bottom navigation">
+      
+        <p>
+        «  <a href="ExternalClangExamples.html">External Clang Examples</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="LibTooling.html">LibTooling</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer" role="contentinfo">
+        © Copyright 2007-2017, The Clang Team.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/5.0.1/tools/clang/docs/ItaniumMangleAbiTags.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/5.0.1/tools/clang/docs/ItaniumMangleAbiTags.html?rev=321287&view=auto
==============================================================================
--- www-releases/trunk/5.0.1/tools/clang/docs/ItaniumMangleAbiTags.html (added)
+++ www-releases/trunk/5.0.1/tools/clang/docs/ItaniumMangleAbiTags.html Thu Dec 21 10:09:53 2017
@@ -0,0 +1,148 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>ABI tags — Clang 5 documentation</title>
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="prev" title="Precompiled Header and Modules Internals" href="PCHInternals.html" /> 
+  </head>
+  <body>
+      <div class="header" role="banner"><h1 class="heading"><a href="index.html">
+          <span>Clang 5 documentation</span></a></h1>
+        <h2 class="heading"><span>ABI tags</span></h2>
+      </div>
+      <div class="topnav" role="navigation" aria-label="top navigation">
+      
+        <p>
+        «  <a href="PCHInternals.html">Precompiled Header and Modules Internals</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="abi-tags">
+<h1>ABI tags<a class="headerlink" href="#abi-tags" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>This text tries to describe gcc semantic for mangling “abi_tag” attributes
+described in <a class="reference external" href="https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html">https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html</a></p>
+<p>There is no guarantee the following rules are correct, complete or make sense
+in any way as they were determined empirically by experiments with gcc5.</p>
+</div>
+<div class="section" id="declaration">
+<h2>Declaration<a class="headerlink" href="#declaration" title="Permalink to this headline">¶</a></h2>
+<p>ABI tags are declared in an abi_tag attribute and can be applied to a
+function, variable, class or inline namespace declaration. The attribute takes
+one or more strings (called tags); the order does not matter.</p>
+<p>See <a class="reference external" href="https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html">https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Attributes.html</a> for
+details.</p>
+<p>Tags on an inline namespace are called “implicit tags”, all other tags are
+“explicit tags”.</p>
+</div>
+<div class="section" id="mangling">
+<h2>Mangling<a class="headerlink" href="#mangling" title="Permalink to this headline">¶</a></h2>
+<p>All tags that are “active” on an <unqualified-name> are emitted after the
+<unqualified-name>, before <template-args> or <discriminator>, and are part of
+the same <substitution> the <unqualified-name> is.</p>
+<p>They are mangled as:</p>
+<div class="highlight-none"><div class="highlight"><pre><span></span><abi-tags> ::= <abi-tag>*   # sort by name
+<abi-tag> ::= B <tag source-name>
+</pre></div>
+</div>
+<p>Example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">__attribute__</span><span class="p">((</span><span class="n">abi_tag</span><span class="p">(</span><span class="s">"test"</span><span class="p">)))</span>
+<span class="kt">void</span> <span class="n">Func</span><span class="p">();</span>
+<span class="c1">// gets mangled as: _Z4FuncB4testv (prettified as `Func[abi:test]()`)</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="active-tags">
+<h2>Active tags<a class="headerlink" href="#active-tags" title="Permalink to this headline">¶</a></h2>
+<p>A namespace does not have any active tags. For types (class / struct / union /
+enum), the explicit tags are the active tags.</p>
+<p>For variables and functions, the active tags are the explicit tags plus any
+“required tags” which are not in the “available tags” set:</p>
+<div class="highlight-none"><div class="highlight"><pre><span></span>derived-tags := (required-tags - available-tags)
+active-tags := explicit-tags + derived-tags
+</pre></div>
+</div>
+</div>
+<div class="section" id="required-tags-for-a-function">
+<h2>Required tags for a function<a class="headerlink" href="#required-tags-for-a-function" title="Permalink to this headline">¶</a></h2>
+<p>If a function is used as a local scope for another name, and is part of
+another function as local scope, it doesn’t have any required tags.</p>
+<p>If a function is used as a local scope for a guard variable name, it doesn’t
+have any required tags.</p>
+<p>Otherwise the function requires any implicit or explicit tag used in the name
+for the return type.</p>
+<p>Example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">namespace</span> <span class="n">A</span> <span class="p">{</span>
+  <span class="kr">inline</span> <span class="k">namespace</span> <span class="n">B</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">abi_tag</span><span class="p">))</span> <span class="p">{</span>
+    <span class="k">struct</span> <span class="n">C</span> <span class="p">{</span> <span class="kt">int</span> <span class="n">x</span><span class="p">;</span> <span class="p">};</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="n">A</span><span class="o">::</span><span class="n">C</span> <span class="n">foo</span><span class="p">();</span> <span class="c1">// gets mangled as: _Z3fooB1Bv (prettified as `foo[abi:B]()`)</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="required-tags-for-a-variable">
+<h2>Required tags for a variable<a class="headerlink" href="#required-tags-for-a-variable" title="Permalink to this headline">¶</a></h2>
+<p>A variable requires any implicit or explicit tag used in its type.</p>
+</div>
+<div class="section" id="available-tags">
+<h2>Available tags<a class="headerlink" href="#available-tags" title="Permalink to this headline">¶</a></h2>
+<p>All tags used in the prefix and in the template arguments for a name are
+available. Also, for functions, all tags from the <bare-function-type>
+(which might include the return type for template functions) are available.</p>
+<p>For <local-name>s all active tags used in the local part (<function-
+encoding>) are available, but not implicit tags which were not active.</p>
+<p>Implicit and explicit tags used in the <unqualified-name> for a function (as
+in the type of a cast operator) are NOT available.</p>
+<p>Example: a cast operator to std::string (which is
+std::__cxx11::basic_string<…>) will use ‘cxx11’ as an active tag, as it is
+required from the return type <cite>std::string</cite> but not available.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav" role="navigation" aria-label="bottom navigation">
+      
+        <p>
+        «  <a href="PCHInternals.html">Precompiled Header and Modules Internals</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+        </p>
+
+      </div>
+
+    <div class="footer" role="contentinfo">
+        © Copyright 2007-2017, The Clang Team.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/5.0.1/tools/clang/docs/JSONCompilationDatabase.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/5.0.1/tools/clang/docs/JSONCompilationDatabase.html?rev=321287&view=auto
==============================================================================
--- www-releases/trunk/5.0.1/tools/clang/docs/JSONCompilationDatabase.html (added)
+++ www-releases/trunk/5.0.1/tools/clang/docs/JSONCompilationDatabase.html Thu Dec 21 10:09:53 2017
@@ -0,0 +1,153 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>JSON Compilation Database Format Specification — Clang 5 documentation</title>
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="Overview" href="ClangTools.html" />
+    <link rel="prev" title="How To Setup Clang Tooling For LLVM" href="HowToSetupToolingForLLVM.html" /> 
+  </head>
+  <body>
+      <div class="header" role="banner"><h1 class="heading"><a href="index.html">
+          <span>Clang 5 documentation</span></a></h1>
+        <h2 class="heading"><span>JSON Compilation Database Format Specification</span></h2>
+      </div>
+      <div class="topnav" role="navigation" aria-label="top navigation">
+      
+        <p>
+        «  <a href="HowToSetupToolingForLLVM.html">How To Setup Clang Tooling For LLVM</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ClangTools.html">Overview</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="json-compilation-database-format-specification">
+<h1>JSON Compilation Database Format Specification<a class="headerlink" href="#json-compilation-database-format-specification" title="Permalink to this headline">¶</a></h1>
+<p>This document describes a format for specifying how to replay single
+compilations independently of the build system.</p>
+<div class="section" id="background">
+<h2>Background<a class="headerlink" href="#background" title="Permalink to this headline">¶</a></h2>
+<p>Tools based on the C++ Abstract Syntax Tree need full information how to
+parse a translation unit. Usually this information is implicitly
+available in the build system, but running tools as part of the build
+system is not necessarily the best solution:</p>
+<ul class="simple">
+<li>Build systems are inherently change driven, so running multiple tools
+over the same code base without changing the code does not fit into
+the architecture of many build systems.</li>
+<li>Figuring out whether things have changed is often an IO bound
+process; this makes it hard to build low latency end user tools based
+on the build system.</li>
+<li>Build systems are inherently sequential in the build graph, for
+example due to generated source code. While tools that run
+independently of the build still need the generated source code to
+exist, running tools multiple times over unchanging source does not
+require serialization of the runs according to the build dependency
+graph.</li>
+</ul>
+</div>
+<div class="section" id="supported-systems">
+<h2>Supported Systems<a class="headerlink" href="#supported-systems" title="Permalink to this headline">¶</a></h2>
+<p>Currently <a class="reference external" href="http://cmake.org">CMake</a> (since 2.8.5) supports generation
+of compilation databases for Unix Makefile builds (Ninja builds in the
+works) with the option <code class="docutils literal"><span class="pre">CMAKE_EXPORT_COMPILE_COMMANDS</span></code>.</p>
+<p>For projects on Linux, there is an alternative to intercept compiler
+calls with a tool called <a class="reference external" href="https://github.com/rizsotto/Bear">Bear</a>.</p>
+<p>Clang’s tooling interface supports reading compilation databases; see
+the <a class="reference internal" href="LibTooling.html"><span class="doc">LibTooling documentation</span></a>. libclang and its
+python bindings also support this (since clang 3.2); see
+<a class="reference external" href="/doxygen/group__COMPILATIONDB.html">CXCompilationDatabase.h</a>.</p>
+</div>
+<div class="section" id="format">
+<h2>Format<a class="headerlink" href="#format" title="Permalink to this headline">¶</a></h2>
+<p>A compilation database is a JSON file, which consist of an array of
+“command objects”, where each command object specifies one way a
+translation unit is compiled in the project.</p>
+<p>Each command object contains the translation unit’s main file, the
+working directory of the compile run and the actual compile command.</p>
+<p>Example:</p>
+<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span>
+  <span class="p">{</span> <span class="s2">"directory"</span><span class="p">:</span> <span class="s2">"/home/user/llvm/build"</span><span class="p">,</span>
+    <span class="s2">"command"</span><span class="p">:</span> <span class="s2">"/usr/bin/clang++ -Irelative -DSOMEDEF=</span><span class="se">\"</span><span class="s2">With spaces, quotes and </span><span class="se">\\</span><span class="s2">-es.</span><span class="se">\"</span><span class="s2"> -c -o file.o file.cc"</span><span class="p">,</span>
+    <span class="s2">"file"</span><span class="p">:</span> <span class="s2">"file.cc"</span> <span class="p">},</span>
+  <span class="o">...</span>
+<span class="p">]</span>
+</pre></div>
+</div>
+<p>The contracts for each field in the command object are:</p>
+<ul class="simple">
+<li><strong>directory:</strong> The working directory of the compilation. All paths
+specified in the <strong>command</strong> or <strong>file</strong> fields must be either
+absolute or relative to this directory.</li>
+<li><strong>file:</strong> The main translation unit source processed by this
+compilation step. This is used by tools as the key into the
+compilation database. There can be multiple command objects for the
+same file, for example if the same source file is compiled with
+different configurations.</li>
+<li><strong>command:</strong> The compile command executed. After JSON unescaping,
+this must be a valid command to rerun the exact compilation step for
+the translation unit in the environment the build system uses.
+Parameters use shell quoting and shell escaping of quotes, with ‘<code class="docutils literal"><span class="pre">"</span></code>’
+and ‘<code class="docutils literal"><span class="pre">\</span></code>’ being the only special characters. Shell expansion is not
+supported.</li>
+<li><strong>arguments:</strong> The compile command executed as list of strings.
+Either <strong>arguments</strong> or <strong>command</strong> is required.</li>
+<li><strong>output:</strong> The name of the output created by this compilation step.
+This field is optional. It can be used to distinguish different processing
+modes of the same input file.</li>
+</ul>
+</div>
+<div class="section" id="build-system-integration">
+<h2>Build System Integration<a class="headerlink" href="#build-system-integration" title="Permalink to this headline">¶</a></h2>
+<p>The convention is to name the file compile_commands.json and put it at
+the top of the build directory. Clang tools are pointed to the top of
+the build directory to detect the file and use the compilation database
+to parse C++ code in the source tree.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav" role="navigation" aria-label="bottom navigation">
+      
+        <p>
+        «  <a href="HowToSetupToolingForLLVM.html">How To Setup Clang Tooling For LLVM</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ClangTools.html">Overview</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer" role="contentinfo">
+        © Copyright 2007-2017, The Clang Team.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/5.0.1/tools/clang/docs/LTOVisibility.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/5.0.1/tools/clang/docs/LTOVisibility.html?rev=321287&view=auto
==============================================================================
--- www-releases/trunk/5.0.1/tools/clang/docs/LTOVisibility.html (added)
+++ www-releases/trunk/5.0.1/tools/clang/docs/LTOVisibility.html Thu Dec 21 10:09:53 2017
@@ -0,0 +1,169 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>LTO Visibility — Clang 5 documentation</title>
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="SafeStack" href="SafeStack.html" />
+    <link rel="prev" title="Control Flow Integrity Design Documentation" href="ControlFlowIntegrityDesign.html" /> 
+  </head>
+  <body>
+      <div class="header" role="banner"><h1 class="heading"><a href="index.html">
+          <span>Clang 5 documentation</span></a></h1>
+        <h2 class="heading"><span>LTO Visibility</span></h2>
+      </div>
+      <div class="topnav" role="navigation" aria-label="top navigation">
+      
+        <p>
+        «  <a href="ControlFlowIntegrityDesign.html">Control Flow Integrity Design Documentation</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="SafeStack.html">SafeStack</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="lto-visibility">
+<h1>LTO Visibility<a class="headerlink" href="#lto-visibility" title="Permalink to this headline">¶</a></h1>
+<p><em>LTO visibility</em> is a property of an entity that specifies whether it can be
+referenced from outside the current LTO unit. A <em>linkage unit</em> is a set of
+translation units linked together into an executable or DSO, and a linkage
+unit’s <em>LTO unit</em> is the subset of the linkage unit that is linked together
+using link-time optimization; in the case where LTO is not being used, the
+linkage unit’s LTO unit is empty. Each linkage unit has only a single LTO unit.</p>
+<p>The LTO visibility of a class is used by the compiler to determine which
+classes the whole-program devirtualization (<code class="docutils literal"><span class="pre">-fwhole-program-vtables</span></code>) and
+control flow integrity (<code class="docutils literal"><span class="pre">-fsanitize=cfi-vcall</span></code>) features apply to. These
+features use whole-program information, so they require the entire class
+hierarchy to be visible in order to work correctly.</p>
+<p>If any translation unit in the program uses either of the whole-program
+devirtualization or control flow integrity features, it is effectively an ODR
+violation to define a class with hidden LTO visibility in multiple linkage
+units. A class with public LTO visibility may be defined in multiple linkage
+units, but the tradeoff is that the whole-program devirtualization and
+control flow integrity features can only be applied to classes with hidden LTO
+visibility. A class’s LTO visibility is treated as an ODR-relevant property
+of its definition, so it must be consistent between translation units.</p>
+<p>In translation units built with LTO, LTO visibility is based on the
+class’s symbol visibility as expressed at the source level (i.e. the
+<code class="docutils literal"><span class="pre">__attribute__((visibility("...")))</span></code> attribute, or the <code class="docutils literal"><span class="pre">-fvisibility=</span></code>
+flag) or, on the Windows platform, the dllimport and dllexport attributes. When
+targeting non-Windows platforms, classes with a visibility other than hidden
+visibility receive public LTO visibility. When targeting Windows, classes
+with dllimport or dllexport attributes receive public LTO visibility. All
+other classes receive hidden LTO visibility. Classes with internal linkage
+(e.g. classes declared in unnamed namespaces) also receive hidden LTO
+visibility.</p>
+<p>A class defined in a translation unit built without LTO receives public
+LTO visibility regardless of its object file visibility, linkage or other
+attributes.</p>
+<p>This mechanism will produce the correct result in most cases, but there are
+two cases where it may wrongly infer hidden LTO visibility.</p>
+<ol class="arabic simple">
+<li>As a corollary of the above rules, if a linkage unit is produced from a
+combination of LTO object files and non-LTO object files, any hidden
+visibility class defined in both a translation unit built with LTO and
+a translation unit built without LTO must be defined with public LTO
+visibility in order to avoid an ODR violation.</li>
+<li>Some ABIs provide the ability to define an abstract base class without
+visibility attributes in multiple linkage units and have virtual calls
+to derived classes in other linkage units work correctly. One example of
+this is COM on Windows platforms. If the ABI allows this, any base class
+used in this way must be defined with public LTO visibility.</li>
+</ol>
+<p>Classes that fall into either of these categories can be marked up with the
+<code class="docutils literal"><span class="pre">[[clang::lto_visibility_public]]</span></code> attribute. To specifically handle the
+COM case, classes with the <code class="docutils literal"><span class="pre">__declspec(uuid())</span></code> attribute receive public
+LTO visibility. On Windows platforms, clang-cl’s <code class="docutils literal"><span class="pre">/MT</span></code> and <code class="docutils literal"><span class="pre">/MTd</span></code>
+flags statically link the program against a prebuilt standard library;
+these flags imply public LTO visibility for every class declared in the
+<code class="docutils literal"><span class="pre">std</span></code> and <code class="docutils literal"><span class="pre">stdext</span></code> namespaces.</p>
+<div class="section" id="example">
+<h2>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h2>
+<p>The following example shows how LTO visibility works in practice in several
+cases involving two linkage units, <code class="docutils literal"><span class="pre">main</span></code> and <code class="docutils literal"><span class="pre">dso.so</span></code>.</p>
+<div class="highlight-none"><div class="highlight"><pre><span></span>+-----------------------------------------------------------+  +----------------------------------------------------+
+| main (clang++ -fvisibility=hidden):                       |  | dso.so (clang++ -fvisibility=hidden):              |
+|                                                           |  |                                                    |
+|  +-----------------------------------------------------+  |  |  struct __attribute__((visibility("default"))) C { |
+|  | LTO unit (clang++ -fvisibility=hidden -flto):       |  |  |    virtual void f();                               |
+|  |                                                     |  |  |  }                                                 |
+|  |  struct A { ... };                                  |  |  |  void C::f() {}                                    |
+|  |  struct [[clang::lto_visibility_public]] B { ... }; |  |  |  struct D {                                        |
+|  |  struct __attribute__((visibility("default"))) C {  |  |  |    virtual void g() = 0;                           |
+|  |    virtual void f();                                |  |  |  };                                                |
+|  |  };                                                 |  |  |  struct E : D {                                    |
+|  |  struct [[clang::lto_visibility_public]] D {        |  |  |    virtual void g() { ... }                        |
+|  |    virtual void g() = 0;                            |  |  |  };                                                |
+|  |  };                                                 |  |  |  __attribute__(visibility("default"))) D *mkE() {  |
+|  |                                                     |  |  |    return new E;                                   |
+|  +-----------------------------------------------------+  |  |  }                                                 |
+|                                                           |  |                                                    |
+|  struct B { ... };                                        |  +----------------------------------------------------+
+|                                                           |
++-----------------------------------------------------------+
+</pre></div>
+</div>
+<p>We will now describe the LTO visibility of each of the classes defined in
+these linkage units.</p>
+<p>Class <code class="docutils literal"><span class="pre">A</span></code> is not defined outside of <code class="docutils literal"><span class="pre">main</span></code>’s LTO unit, so it can have
+hidden LTO visibility. This is inferred from the object file visibility
+specified on the command line.</p>
+<p>Class <code class="docutils literal"><span class="pre">B</span></code> is defined in <code class="docutils literal"><span class="pre">main</span></code>, both inside and outside its LTO unit. The
+definition outside the LTO unit has public LTO visibility, so the definition
+inside the LTO unit must also have public LTO visibility in order to avoid
+an ODR violation.</p>
+<p>Class <code class="docutils literal"><span class="pre">C</span></code> is defined in both <code class="docutils literal"><span class="pre">main</span></code> and <code class="docutils literal"><span class="pre">dso.so</span></code> and therefore must
+have public LTO visibility. This is correctly inferred from the <code class="docutils literal"><span class="pre">visibility</span></code>
+attribute.</p>
+<p>Class <code class="docutils literal"><span class="pre">D</span></code> is an abstract base class with a derived class <code class="docutils literal"><span class="pre">E</span></code> defined
+in <code class="docutils literal"><span class="pre">dso.so</span></code>.  This is an example of the COM scenario; the definition of
+<code class="docutils literal"><span class="pre">D</span></code> in <code class="docutils literal"><span class="pre">main</span></code>’s LTO unit must have public LTO visibility in order to be
+compatible with the definition of <code class="docutils literal"><span class="pre">D</span></code> in <code class="docutils literal"><span class="pre">dso.so</span></code>, which is observable
+by calling the function <code class="docutils literal"><span class="pre">mkE</span></code>.</p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav" role="navigation" aria-label="bottom navigation">
+      
+        <p>
+        «  <a href="ControlFlowIntegrityDesign.html">Control Flow Integrity Design Documentation</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="SafeStack.html">SafeStack</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer" role="contentinfo">
+        © Copyright 2007-2017, The Clang Team.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/5.0.1/tools/clang/docs/LanguageExtensions.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/5.0.1/tools/clang/docs/LanguageExtensions.html?rev=321287&view=auto
==============================================================================
--- www-releases/trunk/5.0.1/tools/clang/docs/LanguageExtensions.html (added)
+++ www-releases/trunk/5.0.1/tools/clang/docs/LanguageExtensions.html Thu Dec 21 10:09:53 2017
@@ -0,0 +1,2367 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Clang Language Extensions — Clang 5 documentation</title>
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="Objective-C Literals" href="ObjectiveCLiterals.html" />
+    <link rel="prev" title="Assembling a Complete Toolchain" href="Toolchain.html" /> 
+  </head>
+  <body>
+      <div class="header" role="banner"><h1 class="heading"><a href="index.html">
+          <span>Clang 5 documentation</span></a></h1>
+        <h2 class="heading"><span>Clang Language Extensions</span></h2>
+      </div>
+      <div class="topnav" role="navigation" aria-label="top navigation">
+      
+        <p>
+        «  <a href="Toolchain.html">Assembling a Complete Toolchain</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ObjectiveCLiterals.html">Objective-C Literals</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="clang-language-extensions">
+<h1>Clang Language Extensions<a class="headerlink" href="#clang-language-extensions" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
+<li><a class="reference internal" href="#feature-checking-macros" id="id2">Feature Checking Macros</a></li>
+<li><a class="reference internal" href="#include-file-checking-macros" id="id3">Include File Checking Macros</a></li>
+<li><a class="reference internal" href="#builtin-macros" id="id4">Builtin Macros</a></li>
+<li><a class="reference internal" href="#vectors-and-extended-vectors" id="id5">Vectors and Extended Vectors</a></li>
+<li><a class="reference internal" href="#messages-on-deprecated-and-unavailable-attributes" id="id6">Messages on <code class="docutils literal"><span class="pre">deprecated</span></code> and <code class="docutils literal"><span class="pre">unavailable</span></code> Attributes</a></li>
+<li><a class="reference internal" href="#attributes-on-enumerators" id="id7">Attributes on Enumerators</a></li>
+<li><a class="reference internal" href="#user-specified-system-frameworks" id="id8">‘User-Specified’ System Frameworks</a></li>
+<li><a class="reference internal" href="#checks-for-standard-language-features" id="id9">Checks for Standard Language Features</a></li>
+<li><a class="reference internal" href="#checks-for-type-trait-primitives" id="id10">Checks for Type Trait Primitives</a></li>
+<li><a class="reference internal" href="#blocks" id="id11">Blocks</a></li>
+<li><a class="reference internal" href="#objective-c-features" id="id12">Objective-C Features</a></li>
+<li><a class="reference internal" href="#initializer-lists-for-complex-numbers-in-c" id="id13">Initializer lists for complex numbers in C</a></li>
+<li><a class="reference internal" href="#builtin-functions" id="id14">Builtin Functions</a></li>
+<li><a class="reference internal" href="#non-standard-c-11-attributes" id="id15">Non-standard C++11 Attributes</a></li>
+<li><a class="reference internal" href="#target-specific-extensions" id="id16">Target-Specific Extensions</a></li>
+<li><a class="reference internal" href="#extensions-for-static-analysis" id="id17">Extensions for Static Analysis</a></li>
+<li><a class="reference internal" href="#extensions-for-dynamic-analysis" id="id18">Extensions for Dynamic Analysis</a></li>
+<li><a class="reference internal" href="#extensions-for-selectively-disabling-optimization" id="id19">Extensions for selectively disabling optimization</a></li>
+<li><a class="reference internal" href="#extensions-for-loop-hint-optimizations" id="id20">Extensions for loop hint optimizations</a></li>
+<li><a class="reference internal" href="#extensions-to-specify-floating-point-flags" id="id21">Extensions to specify floating-point flags</a></li>
+<li><a class="reference internal" href="#specifying-an-attribute-for-multiple-declarations-pragma-clang-attribute" id="id22">Specifying an attribute for multiple declarations (#pragma clang attribute)</a></li>
+<li><a class="reference internal" href="#specifying-section-names-for-global-objects-pragma-clang-section" id="id23">Specifying section names for global objects (#pragma clang section)</a></li>
+</ul>
+</div>
+<div class="toctree-wrapper compound">
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id1">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>This document describes the language extensions provided by Clang.  In addition
+to the language extensions listed here, Clang aims to support a broad range of
+GCC extensions.  Please see the <a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html">GCC manual</a> for more information on
+these extensions.</p>
+</div>
+<div class="section" id="feature-checking-macros">
+<span id="langext-feature-check"></span><h2><a class="toc-backref" href="#id2">Feature Checking Macros</a><a class="headerlink" href="#feature-checking-macros" title="Permalink to this headline">¶</a></h2>
+<p>Language extensions can be very useful, but only if you know you can depend on
+them.  In order to allow fine-grain features checks, we support three builtin
+function-like macros.  This allows you to directly test for a feature in your
+code without having to resort to something like autoconf or fragile “compiler
+version checks”.</p>
+<div class="section" id="has-builtin">
+<h3><code class="docutils literal"><span class="pre">__has_builtin</span></code><a class="headerlink" href="#has-builtin" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single identifier argument that is the name of
+a builtin function.  It evaluates to 1 if the builtin is supported or 0 if not.
+It can be used like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#ifndef __has_builtin         </span><span class="c1">// Optional of course.</span>
+  <span class="cp">#define __has_builtin(x) 0  </span><span class="c1">// Compatibility with non-clang compilers.</span>
+<span class="cp">#endif</span>
+
+<span class="p">...</span>
+<span class="cp">#if __has_builtin(__builtin_trap)</span>
+  <span class="n">__builtin_trap</span><span class="p">();</span>
+<span class="cp">#else</span>
+  <span class="n">abort</span><span class="p">();</span>
+<span class="cp">#endif</span>
+<span class="p">...</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="has-feature-and-has-extension">
+<span id="langext-has-feature-has-extension"></span><h3><code class="docutils literal"><span class="pre">__has_feature</span></code> and <code class="docutils literal"><span class="pre">__has_extension</span></code><a class="headerlink" href="#has-feature-and-has-extension" title="Permalink to this headline">¶</a></h3>
+<p>These function-like macros take a single identifier argument that is the name
+of a feature.  <code class="docutils literal"><span class="pre">__has_feature</span></code> evaluates to 1 if the feature is both
+supported by Clang and standardized in the current language standard or 0 if
+not (but see <a class="reference internal" href="#langext-has-feature-back-compat"><span class="std std-ref">below</span></a>), while
+<code class="docutils literal"><span class="pre">__has_extension</span></code> evaluates to 1 if the feature is supported by Clang in the
+current language (either as a language extension or a standard language
+feature) or 0 if not.  They can be used like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#ifndef __has_feature         </span><span class="c1">// Optional of course.</span>
+  <span class="cp">#define __has_feature(x) 0  </span><span class="c1">// Compatibility with non-clang compilers.</span>
+<span class="cp">#endif</span>
+<span class="cp">#ifndef __has_extension</span>
+  <span class="cp">#define __has_extension __has_feature </span><span class="c1">// Compatibility with pre-3.0 compilers.</span>
+<span class="cp">#endif</span>
+
+<span class="p">...</span>
+<span class="cp">#if __has_feature(cxx_rvalue_references)</span>
+<span class="c1">// This code will only be compiled with the -std=c++11 and -std=gnu++11</span>
+<span class="c1">// options, because rvalue references are only standardized in C++11.</span>
+<span class="cp">#endif</span>
+
+<span class="cp">#if __has_extension(cxx_rvalue_references)</span>
+<span class="c1">// This code will be compiled with the -std=c++11, -std=gnu++11, -std=c++98</span>
+<span class="c1">// and -std=gnu++98 options, because rvalue references are supported as a</span>
+<span class="c1">// language extension in C++98.</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+<p id="langext-has-feature-back-compat">For backward compatibility, <code class="docutils literal"><span class="pre">__has_feature</span></code> can also be used to test
+for support for non-standardized features, i.e. features not prefixed <code class="docutils literal"><span class="pre">c_</span></code>,
+<code class="docutils literal"><span class="pre">cxx_</span></code> or <code class="docutils literal"><span class="pre">objc_</span></code>.</p>
+<p>Another use of <code class="docutils literal"><span class="pre">__has_feature</span></code> is to check for compiler features not related
+to the language standard, such as e.g. <a class="reference internal" href="AddressSanitizer.html"><span class="doc">AddressSanitizer</span></a>.</p>
+<p>If the <code class="docutils literal"><span class="pre">-pedantic-errors</span></code> option is given, <code class="docutils literal"><span class="pre">__has_extension</span></code> is equivalent
+to <code class="docutils literal"><span class="pre">__has_feature</span></code>.</p>
+<p>The feature tag is described along with the language feature below.</p>
+<p>The feature name or extension name can also be specified with a preceding and
+following <code class="docutils literal"><span class="pre">__</span></code> (double underscore) to avoid interference from a macro with
+the same name.  For instance, <code class="docutils literal"><span class="pre">__cxx_rvalue_references__</span></code> can be used instead
+of <code class="docutils literal"><span class="pre">cxx_rvalue_references</span></code>.</p>
+</div>
+<div class="section" id="has-cpp-attribute">
+<h3><code class="docutils literal"><span class="pre">__has_cpp_attribute</span></code><a class="headerlink" href="#has-cpp-attribute" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single argument that is the name of a
+C++11-style attribute. The argument can either be a single identifier, or a
+scoped identifier. If the attribute is supported, a nonzero value is returned.
+If the attribute is a standards-based attribute, this macro returns a nonzero
+value based on the year and month in which the attribute was voted into the
+working draft. If the attribute is not supported by the current compliation
+target, this macro evaluates to 0.  It can be used like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#ifndef __has_cpp_attribute         </span><span class="c1">// Optional of course.</span>
+  <span class="cp">#define __has_cpp_attribute(x) 0  </span><span class="c1">// Compatibility with non-clang compilers.</span>
+<span class="cp">#endif</span>
+
+<span class="p">...</span>
+<span class="cp">#if __has_cpp_attribute(clang::fallthrough)</span>
+<span class="cp">#define FALLTHROUGH [[clang::fallthrough]]</span>
+<span class="cp">#else</span>
+<span class="cp">#define FALLTHROUGH</span>
+<span class="cp">#endif</span>
+<span class="p">...</span>
+</pre></div>
+</div>
+<p>The attribute identifier (but not scope) can also be specified with a preceding
+and following <code class="docutils literal"><span class="pre">__</span></code> (double underscore) to avoid interference from a macro with
+the same name.  For instance, <code class="docutils literal"><span class="pre">gnu::__const__</span></code> can be used instead of
+<code class="docutils literal"><span class="pre">gnu::const</span></code>.</p>
+</div>
+<div class="section" id="has-attribute">
+<h3><code class="docutils literal"><span class="pre">__has_attribute</span></code><a class="headerlink" href="#has-attribute" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single identifier argument that is the name of
+a GNU-style attribute.  It evaluates to 1 if the attribute is supported by the
+current compilation target, or 0 if not.  It can be used like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#ifndef __has_attribute         </span><span class="c1">// Optional of course.</span>
+  <span class="cp">#define __has_attribute(x) 0  </span><span class="c1">// Compatibility with non-clang compilers.</span>
+<span class="cp">#endif</span>
+
+<span class="p">...</span>
+<span class="cp">#if __has_attribute(always_inline)</span>
+<span class="cp">#define ALWAYS_INLINE __attribute__((always_inline))</span>
+<span class="cp">#else</span>
+<span class="cp">#define ALWAYS_INLINE</span>
+<span class="cp">#endif</span>
+<span class="p">...</span>
+</pre></div>
+</div>
+<p>The attribute name can also be specified with a preceding and following <code class="docutils literal"><span class="pre">__</span></code>
+(double underscore) to avoid interference from a macro with the same name.  For
+instance, <code class="docutils literal"><span class="pre">__always_inline__</span></code> can be used instead of <code class="docutils literal"><span class="pre">always_inline</span></code>.</p>
+</div>
+<div class="section" id="has-declspec-attribute">
+<h3><code class="docutils literal"><span class="pre">__has_declspec_attribute</span></code><a class="headerlink" href="#has-declspec-attribute" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single identifier argument that is the name of
+an attribute implemented as a Microsoft-style <code class="docutils literal"><span class="pre">__declspec</span></code> attribute.  It
+evaluates to 1 if the attribute is supported by the current compilation target,
+or 0 if not.  It can be used like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#ifndef __has_declspec_attribute         </span><span class="c1">// Optional of course.</span>
+  <span class="cp">#define __has_declspec_attribute(x) 0  </span><span class="c1">// Compatibility with non-clang compilers.</span>
+<span class="cp">#endif</span>
+
+<span class="p">...</span>
+<span class="cp">#if __has_declspec_attribute(dllexport)</span>
+<span class="cp">#define DLLEXPORT __declspec(dllexport)</span>
+<span class="cp">#else</span>
+<span class="cp">#define DLLEXPORT</span>
+<span class="cp">#endif</span>
+<span class="p">...</span>
+</pre></div>
+</div>
+<p>The attribute name can also be specified with a preceding and following <code class="docutils literal"><span class="pre">__</span></code>
+(double underscore) to avoid interference from a macro with the same name.  For
+instance, <code class="docutils literal"><span class="pre">__dllexport__</span></code> can be used instead of <code class="docutils literal"><span class="pre">dllexport</span></code>.</p>
+</div>
+<div class="section" id="is-identifier">
+<h3><code class="docutils literal"><span class="pre">__is_identifier</span></code><a class="headerlink" href="#is-identifier" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single identifier argument that might be either
+a reserved word or a regular identifier. It evaluates to 1 if the argument is just
+a regular identifier and not a reserved word, in the sense that it can then be
+used as the name of a user-defined function or variable. Otherwise it evaluates
+to 0.  It can be used like this:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="p">...</span>
+<span class="cp">#ifdef __is_identifier          </span><span class="c1">// Compatibility with non-clang compilers.</span>
+  <span class="cp">#if __is_identifier(__wchar_t)</span>
+    <span class="k">typedef</span> <span class="kt">wchar_t</span> <span class="kr">__wchar_t</span><span class="p">;</span>
+  <span class="cp">#endif</span>
+<span class="cp">#endif</span>
+
+<span class="kr">__wchar_t</span> <span class="n">WideCharacter</span><span class="p">;</span>
+<span class="p">...</span>
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="include-file-checking-macros">
+<h2><a class="toc-backref" href="#id3">Include File Checking Macros</a><a class="headerlink" href="#include-file-checking-macros" title="Permalink to this headline">¶</a></h2>
+<p>Not all developments systems have the same include files.  The
+<a class="reference internal" href="#langext-has-include"><span class="std std-ref">__has_include</span></a> and <a class="reference internal" href="#langext-has-include-next"><span class="std std-ref">__has_include_next</span></a> macros allow
+you to check for the existence of an include file before doing a possibly
+failing <code class="docutils literal"><span class="pre">#include</span></code> directive.  Include file checking macros must be used
+as expressions in <code class="docutils literal"><span class="pre">#if</span></code> or <code class="docutils literal"><span class="pre">#elif</span></code> preprocessing directives.</p>
+<div class="section" id="has-include">
+<span id="langext-has-include"></span><h3><code class="docutils literal"><span class="pre">__has_include</span></code><a class="headerlink" href="#has-include" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single file name string argument that is the
+name of an include file.  It evaluates to 1 if the file can be found using the
+include paths, or 0 otherwise:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="c1">// Note the two possible file name string formats.</span>
+<span class="cp">#if __has_include("myinclude.h") && __has_include(<stdint.h>)</span>
+<span class="cp"># include "myinclude.h"</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+<p>To test for this feature, use <code class="docutils literal"><span class="pre">#if</span> <span class="pre">defined(__has_include)</span></code>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="c1">// To avoid problem with non-clang compilers not having this macro.</span>
+<span class="cp">#if defined(__has_include)</span>
+<span class="cp">#if __has_include("myinclude.h")</span>
+<span class="cp"># include "myinclude.h"</span>
+<span class="cp">#endif</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="has-include-next">
+<span id="langext-has-include-next"></span><h3><code class="docutils literal"><span class="pre">__has_include_next</span></code><a class="headerlink" href="#has-include-next" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a single file name string argument that is the
+name of an include file.  It is like <code class="docutils literal"><span class="pre">__has_include</span></code> except that it looks for
+the second instance of the given file found in the include paths.  It evaluates
+to 1 if the second instance of the file can be found using the include paths,
+or 0 otherwise:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="c1">// Note the two possible file name string formats.</span>
+<span class="cp">#if __has_include_next("myinclude.h") && __has_include_next(<stdint.h>)</span>
+<span class="cp"># include_next "myinclude.h"</span>
+<span class="cp">#endif</span>
+
+<span class="c1">// To avoid problem with non-clang compilers not having this macro.</span>
+<span class="cp">#if defined(__has_include_next)</span>
+<span class="cp">#if __has_include_next("myinclude.h")</span>
+<span class="cp"># include_next "myinclude.h"</span>
+<span class="cp">#endif</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+<p>Note that <code class="docutils literal"><span class="pre">__has_include_next</span></code>, like the GNU extension <code class="docutils literal"><span class="pre">#include_next</span></code>
+directive, is intended for use in headers only, and will issue a warning if
+used in the top-level compilation file.  A warning will also be issued if an
+absolute path is used in the file argument.</p>
+</div>
+<div class="section" id="has-warning">
+<h3><code class="docutils literal"><span class="pre">__has_warning</span></code><a class="headerlink" href="#has-warning" title="Permalink to this headline">¶</a></h3>
+<p>This function-like macro takes a string literal that represents a command line
+option for a warning and returns true if that is a valid warning option.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#if __has_warning("-Wformat")</span>
+<span class="p">...</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="builtin-macros">
+<h2><a class="toc-backref" href="#id4">Builtin Macros</a><a class="headerlink" href="#builtin-macros" title="Permalink to this headline">¶</a></h2>
+<dl class="docutils">
+<dt><code class="docutils literal"><span class="pre">__BASE_FILE__</span></code></dt>
+<dd>Defined to a string that contains the name of the main input file passed to
+Clang.</dd>
+<dt><code class="docutils literal"><span class="pre">__COUNTER__</span></code></dt>
+<dd>Defined to an integer value that starts at zero and is incremented each time
+the <code class="docutils literal"><span class="pre">__COUNTER__</span></code> macro is expanded.</dd>
+<dt><code class="docutils literal"><span class="pre">__INCLUDE_LEVEL__</span></code></dt>
+<dd>Defined to an integral value that is the include depth of the file currently
+being translated.  For the main file, this value is zero.</dd>
+<dt><code class="docutils literal"><span class="pre">__TIMESTAMP__</span></code></dt>
+<dd>Defined to the date and time of the last modification of the current source
+file.</dd>
+<dt><code class="docutils literal"><span class="pre">__clang__</span></code></dt>
+<dd>Defined when compiling with Clang</dd>
+<dt><code class="docutils literal"><span class="pre">__clang_major__</span></code></dt>
+<dd>Defined to the major marketing version number of Clang (e.g., the 2 in
+2.0.1).  Note that marketing version numbers should not be used to check for
+language features, as different vendors use different numbering schemes.
+Instead, use the <a class="reference internal" href="#langext-feature-check"><span class="std std-ref">Feature Checking Macros</span></a>.</dd>
+<dt><code class="docutils literal"><span class="pre">__clang_minor__</span></code></dt>
+<dd>Defined to the minor version number of Clang (e.g., the 0 in 2.0.1).  Note
+that marketing version numbers should not be used to check for language
+features, as different vendors use different numbering schemes.  Instead, use
+the <a class="reference internal" href="#langext-feature-check"><span class="std std-ref">Feature Checking Macros</span></a>.</dd>
+<dt><code class="docutils literal"><span class="pre">__clang_patchlevel__</span></code></dt>
+<dd>Defined to the marketing patch level of Clang (e.g., the 1 in 2.0.1).</dd>
+<dt><code class="docutils literal"><span class="pre">__clang_version__</span></code></dt>
+<dd>Defined to a string that captures the Clang marketing version, including the
+Subversion tag or revision number, e.g., “<code class="docutils literal"><span class="pre">1.5</span> <span class="pre">(trunk</span> <span class="pre">102332)</span></code>”.</dd>
+</dl>
+</div>
+<div class="section" id="vectors-and-extended-vectors">
+<span id="langext-vectors"></span><h2><a class="toc-backref" href="#id5">Vectors and Extended Vectors</a><a class="headerlink" href="#vectors-and-extended-vectors" title="Permalink to this headline">¶</a></h2>
+<p>Supports the GCC, OpenCL, AltiVec and NEON vector extensions.</p>
+<p>OpenCL vector types are created using <code class="docutils literal"><span class="pre">ext_vector_type</span></code> attribute.  It
+support for <code class="docutils literal"><span class="pre">V.xyzw</span></code> syntax and other tidbits as seen in OpenCL.  An example
+is:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">typedef</span> <span class="kt">float</span> <span class="n">float4</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">ext_vector_type</span><span class="p">(</span><span class="mi">4</span><span class="p">)));</span>
+<span class="k">typedef</span> <span class="kt">float</span> <span class="n">float2</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">ext_vector_type</span><span class="p">(</span><span class="mi">2</span><span class="p">)));</span>
+
+<span class="n">float4</span> <span class="nf">foo</span><span class="p">(</span><span class="n">float2</span> <span class="n">a</span><span class="p">,</span> <span class="n">float2</span> <span class="n">b</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">float4</span> <span class="n">c</span><span class="p">;</span>
+  <span class="n">c</span><span class="p">.</span><span class="n">xz</span> <span class="o">=</span> <span class="n">a</span><span class="p">;</span>
+  <span class="n">c</span><span class="p">.</span><span class="n">yw</span> <span class="o">=</span> <span class="n">b</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">c</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Query for this feature with <code class="docutils literal"><span class="pre">__has_extension(attribute_ext_vector_type)</span></code>.</p>
+<p>Giving <code class="docutils literal"><span class="pre">-maltivec</span></code> option to clang enables support for AltiVec vector syntax
+and functions.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">vector</span> <span class="kt">float</span> <span class="nf">foo</span><span class="p">(</span><span class="n">vector</span> <span class="kt">int</span> <span class="n">a</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">vector</span> <span class="kt">int</span> <span class="n">b</span><span class="p">;</span>
+  <span class="n">b</span> <span class="o">=</span> <span class="n">vec_add</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span> <span class="o">+</span> <span class="n">a</span><span class="p">;</span>
+  <span class="k">return</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">float</span><span class="p">)</span><span class="n">b</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>NEON vector types are created using <code class="docutils literal"><span class="pre">neon_vector_type</span></code> and
+<code class="docutils literal"><span class="pre">neon_polyvector_type</span></code> attributes.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">typedef</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">neon_vector_type</span><span class="p">(</span><span class="mi">8</span><span class="p">)))</span> <span class="kt">int8_t</span> <span class="n">int8x8_t</span><span class="p">;</span>
+<span class="k">typedef</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">neon_polyvector_type</span><span class="p">(</span><span class="mi">16</span><span class="p">)))</span> <span class="n">poly8_t</span> <span class="n">poly8x16_t</span><span class="p">;</span>
+
+<span class="n">int8x8_t</span> <span class="nf">foo</span><span class="p">(</span><span class="n">int8x8_t</span> <span class="n">a</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">int8x8_t</span> <span class="n">v</span><span class="p">;</span>
+  <span class="n">v</span> <span class="o">=</span> <span class="n">a</span><span class="p">;</span>
+  <span class="k">return</span> <span class="n">v</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<div class="section" id="vector-literals">
+<h3>Vector Literals<a class="headerlink" href="#vector-literals" title="Permalink to this headline">¶</a></h3>
+<p>Vector literals can be used to create vectors from a set of scalars, or
+vectors.  Either parentheses or braces form can be used.  In the parentheses
+form the number of literal values specified must be one, i.e. referring to a
+scalar value, or must match the size of the vector type being created.  If a
+single scalar literal value is specified, the scalar literal value will be
+replicated to all the components of the vector type.  In the brackets form any
+number of literals can be specified.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">typedef</span> <span class="kt">int</span> <span class="n">v4si</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">__vector_size__</span><span class="p">(</span><span class="mi">16</span><span class="p">)));</span>
+<span class="k">typedef</span> <span class="kt">float</span> <span class="n">float4</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">ext_vector_type</span><span class="p">(</span><span class="mi">4</span><span class="p">)));</span>
+<span class="k">typedef</span> <span class="kt">float</span> <span class="n">float2</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">ext_vector_type</span><span class="p">(</span><span class="mi">2</span><span class="p">)));</span>
+
+<span class="n">v4si</span> <span class="n">vsi</span> <span class="o">=</span> <span class="p">(</span><span class="n">v4si</span><span class="p">){</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">};</span>
+<span class="n">float4</span> <span class="n">vf</span> <span class="o">=</span> <span class="p">(</span><span class="n">float4</span><span class="p">)(</span><span class="mf">1.0f</span><span class="p">,</span> <span class="mf">2.0f</span><span class="p">,</span> <span class="mf">3.0f</span><span class="p">,</span> <span class="mf">4.0f</span><span class="p">);</span>
+<span class="n">vector</span> <span class="kt">int</span> <span class="n">vi1</span> <span class="o">=</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">int</span><span class="p">)(</span><span class="mi">1</span><span class="p">);</span>    <span class="c1">// vi1 will be (1, 1, 1, 1).</span>
+<span class="n">vector</span> <span class="kt">int</span> <span class="n">vi2</span> <span class="o">=</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">int</span><span class="p">){</span><span class="mi">1</span><span class="p">};</span>    <span class="c1">// vi2 will be (1, 0, 0, 0).</span>
+<span class="n">vector</span> <span class="kt">int</span> <span class="n">vi3</span> <span class="o">=</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">int</span><span class="p">)(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">);</span> <span class="c1">// error</span>
+<span class="n">vector</span> <span class="kt">int</span> <span class="n">vi4</span> <span class="o">=</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">int</span><span class="p">){</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">};</span> <span class="c1">// vi4 will be (1, 2, 0, 0).</span>
+<span class="n">vector</span> <span class="kt">int</span> <span class="n">vi5</span> <span class="o">=</span> <span class="p">(</span><span class="n">vector</span> <span class="kt">int</span><span class="p">)(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">);</span>
+<span class="n">float4</span> <span class="n">vf</span> <span class="o">=</span> <span class="p">(</span><span class="n">float4</span><span class="p">)((</span><span class="n">float2</span><span class="p">)(</span><span class="mf">1.0f</span><span class="p">,</span> <span class="mf">2.0f</span><span class="p">),</span> <span class="p">(</span><span class="n">float2</span><span class="p">)(</span><span class="mf">3.0f</span><span class="p">,</span> <span class="mf">4.0f</span><span class="p">));</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="vector-operations">
+<h3>Vector Operations<a class="headerlink" href="#vector-operations" title="Permalink to this headline">¶</a></h3>
+<p>The table below shows the support for each operation by vector extension.  A
+dash indicates that an operation is not accepted according to a corresponding
+specification.</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="52%" />
+<col width="12%" />
+<col width="12%" />
+<col width="12%" />
+<col width="12%" />
+</colgroup>
+<thead valign="bottom">
+<tr class="row-odd"><th class="head">Operator</th>
+<th class="head">OpenCL</th>
+<th class="head">AltiVec</th>
+<th class="head">GCC</th>
+<th class="head">NEON</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr class="row-even"><td>[]</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-odd"><td>unary operators +, –</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-even"><td>++, – –</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-odd"><td>+,–,*,/,%</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-even"><td>bitwise operators &,|,^,~</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-odd"><td>>>,<<</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+</tr>
+<tr class="row-even"><td>!, &&, ||</td>
+<td>yes</td>
+<td>–</td>
+<td>–</td>
+<td>–</td>
+</tr>
+<tr class="row-odd"><td>==, !=, >, <, >=, <=</td>
+<td>yes</td>
+<td>yes</td>
+<td>–</td>
+<td>–</td>
+</tr>
+<tr class="row-even"><td>=</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+</tr>
+<tr class="row-odd"><td>:?</td>
+<td>yes</td>
+<td>–</td>
+<td>–</td>
+<td>–</td>
+</tr>
+<tr class="row-even"><td>sizeof</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+</tr>
+<tr class="row-odd"><td>C-style cast</td>
+<td>yes</td>
+<td>yes</td>
+<td>yes</td>
+<td>no</td>
+</tr>
+<tr class="row-even"><td>reinterpret_cast</td>
+<td>yes</td>
+<td>no</td>
+<td>yes</td>
+<td>no</td>
+</tr>
+<tr class="row-odd"><td>static_cast</td>
+<td>yes</td>
+<td>no</td>
+<td>yes</td>
+<td>no</td>
+</tr>
+<tr class="row-even"><td>const_cast</td>
+<td>no</td>
+<td>no</td>
+<td>no</td>
+<td>no</td>
+</tr>
+</tbody>
+</table>
+<p>See also <a class="reference internal" href="#langext-builtin-shufflevector"><span class="std std-ref">__builtin_shufflevector</span></a>, <a class="reference internal" href="#langext-builtin-convertvector"><span class="std std-ref">__builtin_convertvector</span></a>.</p>
+</div>
+</div>
+<div class="section" id="messages-on-deprecated-and-unavailable-attributes">
+<h2><a class="toc-backref" href="#id6">Messages on <code class="docutils literal"><span class="pre">deprecated</span></code> and <code class="docutils literal"><span class="pre">unavailable</span></code> Attributes</a><a class="headerlink" href="#messages-on-deprecated-and-unavailable-attributes" title="Permalink to this headline">¶</a></h2>
+<p>An optional string message can be added to the <code class="docutils literal"><span class="pre">deprecated</span></code> and
+<code class="docutils literal"><span class="pre">unavailable</span></code> attributes.  For example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">explode</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">deprecated</span><span class="p">(</span><span class="s">"extremely unsafe, use 'combust' instead!!!"</span><span class="p">)));</span>
+</pre></div>
+</div>
+<p>If the deprecated or unavailable declaration is used, the message will be
+incorporated into the appropriate diagnostic:</p>
+<div class="highlight-none"><div class="highlight"><pre><span></span>harmless.c:4:3: warning: 'explode' is deprecated: extremely unsafe, use 'combust' instead!!!
+      [-Wdeprecated-declarations]
+  explode();
+  ^
+</pre></div>
+</div>
+<p>Query for this feature with
+<code class="docutils literal"><span class="pre">__has_extension(attribute_deprecated_with_message)</span></code> and
+<code class="docutils literal"><span class="pre">__has_extension(attribute_unavailable_with_message)</span></code>.</p>
+</div>
+<div class="section" id="attributes-on-enumerators">
+<h2><a class="toc-backref" href="#id7">Attributes on Enumerators</a><a class="headerlink" href="#attributes-on-enumerators" title="Permalink to this headline">¶</a></h2>
+<p>Clang allows attributes to be written on individual enumerators.  This allows
+enumerators to be deprecated, made unavailable, etc.  The attribute must appear
+after the enumerator name and before any initializer, like so:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">enum</span> <span class="n">OperationMode</span> <span class="p">{</span>
+  <span class="n">OM_Invalid</span><span class="p">,</span>
+  <span class="n">OM_Normal</span><span class="p">,</span>
+  <span class="n">OM_Terrified</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">deprecated</span><span class="p">)),</span>
+  <span class="n">OM_AbortOnError</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">deprecated</span><span class="p">))</span> <span class="o">=</span> <span class="mi">4</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>Attributes on the <code class="docutils literal"><span class="pre">enum</span></code> declaration do not apply to individual enumerators.</p>
+<p>Query for this feature with <code class="docutils literal"><span class="pre">__has_extension(enumerator_attributes)</span></code>.</p>
+</div>
+<div class="section" id="user-specified-system-frameworks">
+<h2><a class="toc-backref" href="#id8">‘User-Specified’ System Frameworks</a><a class="headerlink" href="#user-specified-system-frameworks" title="Permalink to this headline">¶</a></h2>
+<p>Clang provides a mechanism by which frameworks can be built in such a way that
+they will always be treated as being “system frameworks”, even if they are not
+present in a system framework directory.  This can be useful to system
+framework developers who want to be able to test building other applications
+with development builds of their framework, including the manner in which the
+compiler changes warning behavior for system headers.</p>
+<p>Framework developers can opt-in to this mechanism by creating a
+“<code class="docutils literal"><span class="pre">.system_framework</span></code>” file at the top-level of their framework.  That is, the
+framework should have contents like:</p>
+<div class="highlight-none"><div class="highlight"><pre><span></span>.../TestFramework.framework
+.../TestFramework.framework/.system_framework
+.../TestFramework.framework/Headers
+.../TestFramework.framework/Headers/TestFramework.h
+...
+</pre></div>
+</div>
+<p>Clang will treat the presence of this file as an indicator that the framework
+should be treated as a system framework, regardless of how it was found in the
+framework search path.  For consistency, we recommend that such files never be
+included in installed versions of the framework.</p>
+</div>
+<div class="section" id="checks-for-standard-language-features">
+<h2><a class="toc-backref" href="#id9">Checks for Standard Language Features</a><a class="headerlink" href="#checks-for-standard-language-features" title="Permalink to this headline">¶</a></h2>
+<p>The <code class="docutils literal"><span class="pre">__has_feature</span></code> macro can be used to query if certain standard language
+features are enabled.  The <code class="docutils literal"><span class="pre">__has_extension</span></code> macro can be used to query if
+language features are available as an extension when compiling for a standard
+which does not provide them.  The features which can be tested are listed here.</p>
+<p>Since Clang 3.4, the C++ SD-6 feature test macros are also supported.
+These are macros with names of the form <code class="docutils literal"><span class="pre">__cpp_<feature_name></span></code>, and are
+intended to be a portable way to query the supported features of the compiler.
+See <a class="reference external" href="http://clang.llvm.org/cxx_status.html#ts">the C++ status page</a> for
+information on the version of SD-6 supported by each Clang release, and the
+macros provided by that revision of the recommendations.</p>
+<div class="section" id="c-98">
+<h3>C++98<a class="headerlink" href="#c-98" title="Permalink to this headline">¶</a></h3>
+<p>The features listed below are part of the C++98 standard.  These features are
+enabled by default when compiling C++ code.</p>
+<div class="section" id="c-exceptions">
+<h4>C++ exceptions<a class="headerlink" href="#c-exceptions" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_exceptions)</span></code> to determine if C++ exceptions have been
+enabled.  For example, compiling code with <code class="docutils literal"><span class="pre">-fno-exceptions</span></code> disables C++
+exceptions.</p>
+</div>
+<div class="section" id="c-rtti">
+<h4>C++ RTTI<a class="headerlink" href="#c-rtti" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_rtti)</span></code> to determine if C++ RTTI has been enabled.  For
+example, compiling code with <code class="docutils literal"><span class="pre">-fno-rtti</span></code> disables the use of RTTI.</p>
+</div>
+</div>
+<div class="section" id="c-11">
+<h3>C++11<a class="headerlink" href="#c-11" title="Permalink to this headline">¶</a></h3>
+<p>The features listed below are part of the C++11 standard.  As a result, all
+these features are enabled with the <code class="docutils literal"><span class="pre">-std=c++11</span></code> or <code class="docutils literal"><span class="pre">-std=gnu++11</span></code> option
+when compiling C++ code.</p>
+<div class="section" id="c-11-sfinae-includes-access-control">
+<h4>C++11 SFINAE includes access control<a class="headerlink" href="#c-11-sfinae-includes-access-control" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_access_control_sfinae)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_access_control_sfinae)</span></code> to determine whether
+access-control errors (e.g., calling a private constructor) are considered to
+be template argument deduction errors (aka SFINAE errors), per <a class="reference external" href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1170">C++ DR1170</a>.</p>
+</div>
+<div class="section" id="c-11-alias-templates">
+<h4>C++11 alias templates<a class="headerlink" href="#c-11-alias-templates" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_alias_templates)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_alias_templates)</span></code> to determine if support for C++11’s
+alias declarations and alias templates is enabled.</p>
+</div>
+<div class="section" id="c-11-alignment-specifiers">
+<h4>C++11 alignment specifiers<a class="headerlink" href="#c-11-alignment-specifiers" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_alignas)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(cxx_alignas)</span></code> to
+determine if support for alignment specifiers using <code class="docutils literal"><span class="pre">alignas</span></code> is enabled.</p>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_alignof)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(cxx_alignof)</span></code> to
+determine if support for the <code class="docutils literal"><span class="pre">alignof</span></code> keyword is enabled.</p>
+</div>
+<div class="section" id="c-11-attributes">
+<h4>C++11 attributes<a class="headerlink" href="#c-11-attributes" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_attributes)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(cxx_attributes)</span></code> to
+determine if support for attribute parsing with C++11’s square bracket notation
+is enabled.</p>
+</div>
+<div class="section" id="c-11-generalized-constant-expressions">
+<h4>C++11 generalized constant expressions<a class="headerlink" href="#c-11-generalized-constant-expressions" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_constexpr)</span></code> to determine if support for generalized
+constant expressions (e.g., <code class="docutils literal"><span class="pre">constexpr</span></code>) is enabled.</p>
+</div>
+<div class="section" id="c-11-decltype">
+<h4>C++11 <code class="docutils literal"><span class="pre">decltype()</span></code><a class="headerlink" href="#c-11-decltype" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_decltype)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(cxx_decltype)</span></code> to
+determine if support for the <code class="docutils literal"><span class="pre">decltype()</span></code> specifier is enabled.  C++11’s
+<code class="docutils literal"><span class="pre">decltype</span></code> does not require type-completeness of a function call expression.
+Use <code class="docutils literal"><span class="pre">__has_feature(cxx_decltype_incomplete_return_types)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_decltype_incomplete_return_types)</span></code> to determine if
+support for this feature is enabled.</p>
+</div>
+<div class="section" id="c-11-default-template-arguments-in-function-templates">
+<h4>C++11 default template arguments in function templates<a class="headerlink" href="#c-11-default-template-arguments-in-function-templates" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_default_function_template_args)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_default_function_template_args)</span></code> to determine if support
+for default template arguments in function templates is enabled.</p>
+</div>
+<div class="section" id="c-11-defaulted-functions">
+<h4>C++11 <code class="docutils literal"><span class="pre">default</span></code>ed functions<a class="headerlink" href="#c-11-defaulted-functions" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_defaulted_functions)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_defaulted_functions)</span></code> to determine if support for
+defaulted function definitions (with <code class="docutils literal"><span class="pre">=</span> <span class="pre">default</span></code>) is enabled.</p>
+</div>
+<div class="section" id="c-11-delegating-constructors">
+<h4>C++11 delegating constructors<a class="headerlink" href="#c-11-delegating-constructors" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_delegating_constructors)</span></code> to determine if support for
+delegating constructors is enabled.</p>
+</div>
+<div class="section" id="c-11-deleted-functions">
+<h4>C++11 <code class="docutils literal"><span class="pre">deleted</span></code> functions<a class="headerlink" href="#c-11-deleted-functions" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_deleted_functions)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_deleted_functions)</span></code> to determine if support for deleted
+function definitions (with <code class="docutils literal"><span class="pre">=</span> <span class="pre">delete</span></code>) is enabled.</p>
+</div>
+<div class="section" id="c-11-explicit-conversion-functions">
+<h4>C++11 explicit conversion functions<a class="headerlink" href="#c-11-explicit-conversion-functions" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_explicit_conversions)</span></code> to determine if support for
+<code class="docutils literal"><span class="pre">explicit</span></code> conversion functions is enabled.</p>
+</div>
+<div class="section" id="c-11-generalized-initializers">
+<h4>C++11 generalized initializers<a class="headerlink" href="#c-11-generalized-initializers" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_generalized_initializers)</span></code> to determine if support for
+generalized initializers (using braced lists and <code class="docutils literal"><span class="pre">std::initializer_list</span></code>) is
+enabled.</p>
+</div>
+<div class="section" id="c-11-implicit-move-constructors-assignment-operators">
+<h4>C++11 implicit move constructors/assignment operators<a class="headerlink" href="#c-11-implicit-move-constructors-assignment-operators" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_implicit_moves)</span></code> to determine if Clang will implicitly
+generate move constructors and move assignment operators where needed.</p>
+</div>
+<div class="section" id="c-11-inheriting-constructors">
+<h4>C++11 inheriting constructors<a class="headerlink" href="#c-11-inheriting-constructors" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_inheriting_constructors)</span></code> to determine if support for
+inheriting constructors is enabled.</p>
+</div>
+<div class="section" id="c-11-inline-namespaces">
+<h4>C++11 inline namespaces<a class="headerlink" href="#c-11-inline-namespaces" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_inline_namespaces)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_inline_namespaces)</span></code> to determine if support for inline
+namespaces is enabled.</p>
+</div>
+<div class="section" id="c-11-lambdas">
+<h4>C++11 lambdas<a class="headerlink" href="#c-11-lambdas" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_lambdas)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(cxx_lambdas)</span></code> to
+determine if support for lambdas is enabled.</p>
+</div>
+<div class="section" id="c-11-local-and-unnamed-types-as-template-arguments">
+<h4>C++11 local and unnamed types as template arguments<a class="headerlink" href="#c-11-local-and-unnamed-types-as-template-arguments" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_local_type_template_args)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_local_type_template_args)</span></code> to determine if support for
+local and unnamed types as template arguments is enabled.</p>
+</div>
+<div class="section" id="c-11-noexcept">
+<h4>C++11 noexcept<a class="headerlink" href="#c-11-noexcept" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_noexcept)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(cxx_noexcept)</span></code> to
+determine if support for noexcept exception specifications is enabled.</p>
+</div>
+<div class="section" id="c-11-in-class-non-static-data-member-initialization">
+<h4>C++11 in-class non-static data member initialization<a class="headerlink" href="#c-11-in-class-non-static-data-member-initialization" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_nonstatic_member_init)</span></code> to determine whether in-class
+initialization of non-static data members is enabled.</p>
+</div>
+<div class="section" id="c-11-nullptr">
+<h4>C++11 <code class="docutils literal"><span class="pre">nullptr</span></code><a class="headerlink" href="#c-11-nullptr" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_nullptr)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(cxx_nullptr)</span></code> to
+determine if support for <code class="docutils literal"><span class="pre">nullptr</span></code> is enabled.</p>
+</div>
+<div class="section" id="c-11-override-control">
+<h4>C++11 <code class="docutils literal"><span class="pre">override</span> <span class="pre">control</span></code><a class="headerlink" href="#c-11-override-control" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_override_control)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_override_control)</span></code> to determine if support for the
+override control keywords is enabled.</p>
+</div>
+<div class="section" id="c-11-reference-qualified-functions">
+<h4>C++11 reference-qualified functions<a class="headerlink" href="#c-11-reference-qualified-functions" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_reference_qualified_functions)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_reference_qualified_functions)</span></code> to determine if support
+for reference-qualified functions (e.g., member functions with <code class="docutils literal"><span class="pre">&</span></code> or <code class="docutils literal"><span class="pre">&&</span></code>
+applied to <code class="docutils literal"><span class="pre">*this</span></code>) is enabled.</p>
+</div>
+<div class="section" id="c-11-range-based-for-loop">
+<h4>C++11 range-based <code class="docutils literal"><span class="pre">for</span></code> loop<a class="headerlink" href="#c-11-range-based-for-loop" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_range_for)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(cxx_range_for)</span></code> to
+determine if support for the range-based for loop is enabled.</p>
+</div>
+<div class="section" id="c-11-raw-string-literals">
+<h4>C++11 raw string literals<a class="headerlink" href="#c-11-raw-string-literals" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_raw_string_literals)</span></code> to determine if support for raw
+string literals (e.g., <code class="docutils literal"><span class="pre">R"x(foo\bar)x"</span></code>) is enabled.</p>
+</div>
+<div class="section" id="c-11-rvalue-references">
+<h4>C++11 rvalue references<a class="headerlink" href="#c-11-rvalue-references" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_rvalue_references)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_rvalue_references)</span></code> to determine if support for rvalue
+references is enabled.</p>
+</div>
+<div class="section" id="c-11-static-assert">
+<h4>C++11 <code class="docutils literal"><span class="pre">static_assert()</span></code><a class="headerlink" href="#c-11-static-assert" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_static_assert)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_static_assert)</span></code> to determine if support for compile-time
+assertions using <code class="docutils literal"><span class="pre">static_assert</span></code> is enabled.</p>
+</div>
+<div class="section" id="c-11-thread-local">
+<h4>C++11 <code class="docutils literal"><span class="pre">thread_local</span></code><a class="headerlink" href="#c-11-thread-local" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_thread_local)</span></code> to determine if support for
+<code class="docutils literal"><span class="pre">thread_local</span></code> variables is enabled.</p>
+</div>
+<div class="section" id="c-11-type-inference">
+<h4>C++11 type inference<a class="headerlink" href="#c-11-type-inference" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_auto_type)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(cxx_auto_type)</span></code> to
+determine C++11 type inference is supported using the <code class="docutils literal"><span class="pre">auto</span></code> specifier.  If
+this is disabled, <code class="docutils literal"><span class="pre">auto</span></code> will instead be a storage class specifier, as in C
+or C++98.</p>
+</div>
+<div class="section" id="c-11-strongly-typed-enumerations">
+<h4>C++11 strongly typed enumerations<a class="headerlink" href="#c-11-strongly-typed-enumerations" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_strong_enums)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_strong_enums)</span></code> to determine if support for strongly
+typed, scoped enumerations is enabled.</p>
+</div>
+<div class="section" id="c-11-trailing-return-type">
+<h4>C++11 trailing return type<a class="headerlink" href="#c-11-trailing-return-type" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_trailing_return)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_trailing_return)</span></code> to determine if support for the
+alternate function declaration syntax with trailing return type is enabled.</p>
+</div>
+<div class="section" id="c-11-unicode-string-literals">
+<h4>C++11 Unicode string literals<a class="headerlink" href="#c-11-unicode-string-literals" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_unicode_literals)</span></code> to determine if support for Unicode
+string literals is enabled.</p>
+</div>
+<div class="section" id="c-11-unrestricted-unions">
+<h4>C++11 unrestricted unions<a class="headerlink" href="#c-11-unrestricted-unions" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_unrestricted_unions)</span></code> to determine if support for
+unrestricted unions is enabled.</p>
+</div>
+<div class="section" id="c-11-user-defined-literals">
+<h4>C++11 user-defined literals<a class="headerlink" href="#c-11-user-defined-literals" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_user_literals)</span></code> to determine if support for
+user-defined literals is enabled.</p>
+</div>
+<div class="section" id="c-11-variadic-templates">
+<h4>C++11 variadic templates<a class="headerlink" href="#c-11-variadic-templates" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_variadic_templates)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_variadic_templates)</span></code> to determine if support for
+variadic templates is enabled.</p>
+</div>
+</div>
+<div class="section" id="c-14">
+<h3>C++14<a class="headerlink" href="#c-14" title="Permalink to this headline">¶</a></h3>
+<p>The features listed below are part of the C++14 standard.  As a result, all
+these features are enabled with the <code class="docutils literal"><span class="pre">-std=C++14</span></code> or <code class="docutils literal"><span class="pre">-std=gnu++14</span></code> option
+when compiling C++ code.</p>
+<div class="section" id="c-14-binary-literals">
+<h4>C++14 binary literals<a class="headerlink" href="#c-14-binary-literals" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_binary_literals)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_binary_literals)</span></code> to determine whether
+binary literals (for instance, <code class="docutils literal"><span class="pre">0b10010</span></code>) are recognized. Clang supports this
+feature as an extension in all language modes.</p>
+</div>
+<div class="section" id="c-14-contextual-conversions">
+<h4>C++14 contextual conversions<a class="headerlink" href="#c-14-contextual-conversions" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_contextual_conversions)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_contextual_conversions)</span></code> to determine if the C++14 rules
+are used when performing an implicit conversion for an array bound in a
+<em>new-expression</em>, the operand of a <em>delete-expression</em>, an integral constant
+expression, or a condition in a <code class="docutils literal"><span class="pre">switch</span></code> statement.</p>
+</div>
+<div class="section" id="c-14-decltype-auto">
+<h4>C++14 decltype(auto)<a class="headerlink" href="#c-14-decltype-auto" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_decltype_auto)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_decltype_auto)</span></code> to determine if support
+for the <code class="docutils literal"><span class="pre">decltype(auto)</span></code> placeholder type is enabled.</p>
+</div>
+<div class="section" id="c-14-default-initializers-for-aggregates">
+<h4>C++14 default initializers for aggregates<a class="headerlink" href="#c-14-default-initializers-for-aggregates" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_aggregate_nsdmi)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_aggregate_nsdmi)</span></code> to determine if support
+for default initializers in aggregate members is enabled.</p>
+</div>
+<div class="section" id="c-14-digit-separators">
+<h4>C++14 digit separators<a class="headerlink" href="#c-14-digit-separators" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__cpp_digit_separators</span></code> to determine if support for digit separators
+using single quotes (for instance, <code class="docutils literal"><span class="pre">10'000</span></code>) is enabled. At this time, there
+is no corresponding <code class="docutils literal"><span class="pre">__has_feature</span></code> name</p>
+</div>
+<div class="section" id="c-14-generalized-lambda-capture">
+<h4>C++14 generalized lambda capture<a class="headerlink" href="#c-14-generalized-lambda-capture" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_init_captures)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_init_captures)</span></code> to determine if support for
+lambda captures with explicit initializers is enabled
+(for instance, <code class="docutils literal"><span class="pre">[n(0)]</span> <span class="pre">{</span> <span class="pre">return</span> <span class="pre">++n;</span> <span class="pre">}</span></code>).</p>
+</div>
+<div class="section" id="c-14-generic-lambdas">
+<h4>C++14 generic lambdas<a class="headerlink" href="#c-14-generic-lambdas" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_generic_lambdas)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_generic_lambdas)</span></code> to determine if support for generic
+(polymorphic) lambdas is enabled
+(for instance, <code class="docutils literal"><span class="pre">[]</span> <span class="pre">(auto</span> <span class="pre">x)</span> <span class="pre">{</span> <span class="pre">return</span> <span class="pre">x</span> <span class="pre">+</span> <span class="pre">1;</span> <span class="pre">}</span></code>).</p>
+</div>
+<div class="section" id="c-14-relaxed-constexpr">
+<h4>C++14 relaxed constexpr<a class="headerlink" href="#c-14-relaxed-constexpr" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_relaxed_constexpr)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_relaxed_constexpr)</span></code> to determine if variable
+declarations, local variable modification, and control flow constructs
+are permitted in <code class="docutils literal"><span class="pre">constexpr</span></code> functions.</p>
+</div>
+<div class="section" id="c-14-return-type-deduction">
+<h4>C++14 return type deduction<a class="headerlink" href="#c-14-return-type-deduction" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_return_type_deduction)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_return_type_deduction)</span></code> to determine if support
+for return type deduction for functions (using <code class="docutils literal"><span class="pre">auto</span></code> as a return type)
+is enabled.</p>
+</div>
+<div class="section" id="c-14-runtime-sized-arrays">
+<h4>C++14 runtime-sized arrays<a class="headerlink" href="#c-14-runtime-sized-arrays" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_runtime_array)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_runtime_array)</span></code> to determine if support
+for arrays of runtime bound (a restricted form of variable-length arrays)
+is enabled.
+Clang’s implementation of this feature is incomplete.</p>
+</div>
+<div class="section" id="c-14-variable-templates">
+<h4>C++14 variable templates<a class="headerlink" href="#c-14-variable-templates" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(cxx_variable_templates)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(cxx_variable_templates)</span></code> to determine if support for
+templated variable declarations is enabled.</p>
+</div>
+</div>
+<div class="section" id="c11">
+<h3>C11<a class="headerlink" href="#c11" title="Permalink to this headline">¶</a></h3>
+<p>The features listed below are part of the C11 standard.  As a result, all these
+features are enabled with the <code class="docutils literal"><span class="pre">-std=c11</span></code> or <code class="docutils literal"><span class="pre">-std=gnu11</span></code> option when
+compiling C code.  Additionally, because these features are all
+backward-compatible, they are available as extensions in all language modes.</p>
+<div class="section" id="c11-alignment-specifiers">
+<h4>C11 alignment specifiers<a class="headerlink" href="#c11-alignment-specifiers" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(c_alignas)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(c_alignas)</span></code> to determine
+if support for alignment specifiers using <code class="docutils literal"><span class="pre">_Alignas</span></code> is enabled.</p>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(c_alignof)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(c_alignof)</span></code> to determine
+if support for the <code class="docutils literal"><span class="pre">_Alignof</span></code> keyword is enabled.</p>
+</div>
+<div class="section" id="c11-atomic-operations">
+<h4>C11 atomic operations<a class="headerlink" href="#c11-atomic-operations" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(c_atomic)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(c_atomic)</span></code> to determine
+if support for atomic types using <code class="docutils literal"><span class="pre">_Atomic</span></code> is enabled.  Clang also provides
+<a class="reference internal" href="#langext-c11-atomic"><span class="std std-ref">a set of builtins</span></a> which can be used to implement
+the <code class="docutils literal"><span class="pre"><stdatomic.h></span></code> operations on <code class="docutils literal"><span class="pre">_Atomic</span></code> types. Use
+<code class="docutils literal"><span class="pre">__has_include(<stdatomic.h>)</span></code> to determine if C11’s <code class="docutils literal"><span class="pre"><stdatomic.h></span></code> header
+is available.</p>
+<p>Clang will use the system’s <code class="docutils literal"><span class="pre"><stdatomic.h></span></code> header when one is available, and
+will otherwise use its own. When using its own, implementations of the atomic
+operations are provided as macros. In the cases where C11 also requires a real
+function, this header provides only the declaration of that function (along
+with a shadowing macro implementation), and you must link to a library which
+provides a definition of the function if you use it instead of the macro.</p>
+</div>
+<div class="section" id="c11-generic-selections">
+<h4>C11 generic selections<a class="headerlink" href="#c11-generic-selections" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(c_generic_selections)</span></code> or
+<code class="docutils literal"><span class="pre">__has_extension(c_generic_selections)</span></code> to determine if support for generic
+selections is enabled.</p>
+<p>As an extension, the C11 generic selection expression is available in all
+languages supported by Clang.  The syntax is the same as that given in the C11
+standard.</p>
+<p>In C, type compatibility is decided according to the rules given in the
+appropriate standard, but in C++, which lacks the type compatibility rules used
+in C, types are considered compatible only if they are equivalent.</p>
+</div>
+<div class="section" id="c11-static-assert">
+<h4>C11 <code class="docutils literal"><span class="pre">_Static_assert()</span></code><a class="headerlink" href="#c11-static-assert" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(c_static_assert)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(c_static_assert)</span></code>
+to determine if support for compile-time assertions using <code class="docutils literal"><span class="pre">_Static_assert</span></code> is
+enabled.</p>
+</div>
+<div class="section" id="c11-thread-local">
+<h4>C11 <code class="docutils literal"><span class="pre">_Thread_local</span></code><a class="headerlink" href="#c11-thread-local" title="Permalink to this headline">¶</a></h4>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(c_thread_local)</span></code> or <code class="docutils literal"><span class="pre">__has_extension(c_thread_local)</span></code>
+to determine if support for <code class="docutils literal"><span class="pre">_Thread_local</span></code> variables is enabled.</p>
+</div>
+</div>
+<div class="section" id="modules">
+<h3>Modules<a class="headerlink" href="#modules" title="Permalink to this headline">¶</a></h3>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(modules)</span></code> to determine if Modules have been enabled.
+For example, compiling code with <code class="docutils literal"><span class="pre">-fmodules</span></code> enables the use of Modules.</p>
+<p>More information could be found <a class="reference external" href="http://clang.llvm.org/docs/Modules.html">here</a>.</p>
+</div>
+</div>
+<div class="section" id="checks-for-type-trait-primitives">
+<h2><a class="toc-backref" href="#id10">Checks for Type Trait Primitives</a><a class="headerlink" href="#checks-for-type-trait-primitives" title="Permalink to this headline">¶</a></h2>
+<p>Type trait primitives are special builtin constant expressions that can be used
+by the standard C++ library to facilitate or simplify the implementation of
+user-facing type traits in the <type_traits> header.</p>
+<p>They are not intended to be used directly by user code because they are
+implementation-defined and subject to change – as such they’re tied closely to
+the supported set of system headers, currently:</p>
+<ul class="simple">
+<li>LLVM’s own libc++</li>
+<li>GNU libstdc++</li>
+<li>The Microsoft standard C++ library</li>
+</ul>
+<p>Clang supports the <a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html">GNU C++ type traits</a> and a subset of the
+<a class="reference external" href="http://msdn.microsoft.com/en-us/library/ms177194(v=VS.100).aspx">Microsoft Visual C++ Type traits</a>.</p>
+<p>Feature detection is supported only for some of the primitives at present. User
+code should not use these checks because they bear no direct relation to the
+actual set of type traits supported by the C++ standard library.</p>
+<p>For type trait <code class="docutils literal"><span class="pre">__X</span></code>, <code class="docutils literal"><span class="pre">__has_extension(X)</span></code> indicates the presence of the
+type trait primitive in the compiler. A simplistic usage example as might be
+seen in standard C++ headers follows:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#if __has_extension(is_convertible_to)</span>
+<span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">From</span><span class="p">,</span> <span class="k">typename</span> <span class="n">To</span><span class="o">></span>
+<span class="k">struct</span> <span class="n">is_convertible_to</span> <span class="p">{</span>
+  <span class="k">static</span> <span class="k">const</span> <span class="kt">bool</span> <span class="n">value</span> <span class="o">=</span> <span class="n">__is_convertible_to</span><span class="p">(</span><span class="n">From</span><span class="p">,</span> <span class="n">To</span><span class="p">);</span>
+<span class="p">};</span>
+<span class="cp">#else</span>
+<span class="c1">// Emulate type trait for compatibility with other compilers.</span>
+<span class="cp">#endif</span>
+</pre></div>
+</div>
+<p>The following type trait primitives are supported by Clang:</p>
+<ul class="simple">
+<li><code class="docutils literal"><span class="pre">__has_nothrow_assign</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__has_nothrow_copy</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__has_nothrow_constructor</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__has_trivial_assign</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__has_trivial_copy</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__has_trivial_constructor</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__has_trivial_destructor</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__has_virtual_destructor</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_abstract</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_aggregate</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_base_of</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_class</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_convertible_to</span></code> (Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_empty</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_enum</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_interface_class</span></code> (Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_pod</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_polymorphic</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_union</span></code> (GNU, Microsoft)</li>
+<li><code class="docutils literal"><span class="pre">__is_literal(type)</span></code>: Determines whether the given type is a literal type</li>
+<li><code class="docutils literal"><span class="pre">__is_final</span></code>: Determines whether the given type is declared with a
+<code class="docutils literal"><span class="pre">final</span></code> class-virt-specifier.</li>
+<li><code class="docutils literal"><span class="pre">__underlying_type(type)</span></code>: Retrieves the underlying type for a given
+<code class="docutils literal"><span class="pre">enum</span></code> type.  This trait is required to implement the C++11 standard
+library.</li>
+<li><code class="docutils literal"><span class="pre">__is_trivially_assignable(totype,</span> <span class="pre">fromtype)</span></code>: Determines whether a value
+of type <code class="docutils literal"><span class="pre">totype</span></code> can be assigned to from a value of type <code class="docutils literal"><span class="pre">fromtype</span></code> such
+that no non-trivial functions are called as part of that assignment.  This
+trait is required to implement the C++11 standard library.</li>
+<li><code class="docutils literal"><span class="pre">__is_trivially_constructible(type,</span> <span class="pre">argtypes...)</span></code>: Determines whether a
+value of type <code class="docutils literal"><span class="pre">type</span></code> can be direct-initialized with arguments of types
+<code class="docutils literal"><span class="pre">argtypes...</span></code> such that no non-trivial functions are called as part of
+that initialization.  This trait is required to implement the C++11 standard
+library.</li>
+<li><code class="docutils literal"><span class="pre">__is_destructible</span></code> (MSVC 2013)</li>
+<li><code class="docutils literal"><span class="pre">__is_nothrow_destructible</span></code> (MSVC 2013)</li>
+<li><code class="docutils literal"><span class="pre">__is_nothrow_assignable</span></code> (MSVC 2013, clang)</li>
+<li><code class="docutils literal"><span class="pre">__is_constructible</span></code> (MSVC 2013, clang)</li>
+<li><code class="docutils literal"><span class="pre">__is_nothrow_constructible</span></code> (MSVC 2013, clang)</li>
+<li><code class="docutils literal"><span class="pre">__is_assignable</span></code> (MSVC 2015, clang)</li>
+</ul>
+</div>
+<div class="section" id="blocks">
+<h2><a class="toc-backref" href="#id11">Blocks</a><a class="headerlink" href="#blocks" title="Permalink to this headline">¶</a></h2>
+<p>The syntax and high level language feature description is in
+<a class="reference internal" href="BlockLanguageSpec.html"><span class="doc">BlockLanguageSpec</span></a>. Implementation and ABI details for
+the clang implementation are in <a class="reference internal" href="Block-ABI-Apple.html"><span class="doc">Block-ABI-Apple</span></a>.</p>
+<p>Query for this feature with <code class="docutils literal"><span class="pre">__has_extension(blocks)</span></code>.</p>
+</div>
+<div class="section" id="objective-c-features">
+<h2><a class="toc-backref" href="#id12">Objective-C Features</a><a class="headerlink" href="#objective-c-features" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="related-result-types">
+<h3>Related result types<a class="headerlink" href="#related-result-types" title="Permalink to this headline">¶</a></h3>
+<p>According to Cocoa conventions, Objective-C methods with certain names
+(“<code class="docutils literal"><span class="pre">init</span></code>”, “<code class="docutils literal"><span class="pre">alloc</span></code>”, etc.) always return objects that are an instance of
+the receiving class’s type.  Such methods are said to have a “related result
+type”, meaning that a message send to one of these methods will have the same
+static type as an instance of the receiver class.  For example, given the
+following classes:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="k">@interface</span> <span class="bp">NSObject</span>
+<span class="p">+</span> <span class="p">(</span><span class="kt">id</span><span class="p">)</span><span class="nf">alloc</span><span class="p">;</span>
+<span class="p">-</span> <span class="p">(</span><span class="kt">id</span><span class="p">)</span><span class="nf">init</span><span class="p">;</span>
+<span class="k">@end</span>
+
+<span class="k">@interface</span> <span class="bp">NSArray</span> : <span class="bp">NSObject</span>
+<span class="k">@end</span>
+</pre></div>
+</div>
+<p>and this common initialization pattern</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="bp">NSArray</span> <span class="o">*</span><span class="n">array</span> <span class="o">=</span> <span class="p">[[</span><span class="bp">NSArray</span> <span class="n">alloc</span><span class="p">]</span> <span class="n">init</span><span class="p">];</span>
+</pre></div>
+</div>
+<p>the type of the expression <code class="docutils literal"><span class="pre">[NSArray</span> <span class="pre">alloc]</span></code> is <code class="docutils literal"><span class="pre">NSArray*</span></code> because
+<code class="docutils literal"><span class="pre">alloc</span></code> implicitly has a related result type.  Similarly, the type of the
+expression <code class="docutils literal"><span class="pre">[[NSArray</span> <span class="pre">alloc]</span> <span class="pre">init]</span></code> is <code class="docutils literal"><span class="pre">NSArray*</span></code>, since <code class="docutils literal"><span class="pre">init</span></code> has a
+related result type and its receiver is known to have the type <code class="docutils literal"><span class="pre">NSArray</span> <span class="pre">*</span></code>.
+If neither <code class="docutils literal"><span class="pre">alloc</span></code> nor <code class="docutils literal"><span class="pre">init</span></code> had a related result type, the expressions
+would have had type <code class="docutils literal"><span class="pre">id</span></code>, as declared in the method signature.</p>
+<p>A method with a related result type can be declared by using the type
+<code class="docutils literal"><span class="pre">instancetype</span></code> as its result type.  <code class="docutils literal"><span class="pre">instancetype</span></code> is a contextual keyword
+that is only permitted in the result type of an Objective-C method, e.g.</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="k">@interface</span> <span class="nc">A</span>
+<span class="p">+</span> <span class="p">(</span><span class="kt">instancetype</span><span class="p">)</span><span class="nf">constructAnA</span><span class="p">;</span>
+<span class="k">@end</span>
+</pre></div>
+</div>
+<p>The related result type can also be inferred for some methods.  To determine
+whether a method has an inferred related result type, the first word in the
+camel-case selector (e.g., “<code class="docutils literal"><span class="pre">init</span></code>” in “<code class="docutils literal"><span class="pre">initWithObjects</span></code>”) is considered,
+and the method will have a related result type if its return type is compatible
+with the type of its class and if:</p>
+<ul class="simple">
+<li>the first word is “<code class="docutils literal"><span class="pre">alloc</span></code>” or “<code class="docutils literal"><span class="pre">new</span></code>”, and the method is a class method,
+or</li>
+<li>the first word is “<code class="docutils literal"><span class="pre">autorelease</span></code>”, “<code class="docutils literal"><span class="pre">init</span></code>”, “<code class="docutils literal"><span class="pre">retain</span></code>”, or “<code class="docutils literal"><span class="pre">self</span></code>”,
+and the method is an instance method.</li>
+</ul>
+<p>If a method with a related result type is overridden by a subclass method, the
+subclass method must also return a type that is compatible with the subclass
+type.  For example:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="k">@interface</span> <span class="bp">NSString</span> : <span class="bp">NSObject</span>
+<span class="p">-</span> <span class="p">(</span><span class="n">NSUnrelated</span> <span class="o">*</span><span class="p">)</span><span class="nf">init</span><span class="p">;</span> <span class="c1">// incorrect usage: NSUnrelated is not NSString or a superclass of NSString</span>
+<span class="k">@end</span>
+</pre></div>
+</div>
+<p>Related result types only affect the type of a message send or property access
+via the given method.  In all other respects, a method with a related result
+type is treated the same way as method that returns <code class="docutils literal"><span class="pre">id</span></code>.</p>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(objc_instancetype)</span></code> to determine whether the
+<code class="docutils literal"><span class="pre">instancetype</span></code> contextual keyword is available.</p>
+</div>
+<div class="section" id="automatic-reference-counting">
+<h3>Automatic reference counting<a class="headerlink" href="#automatic-reference-counting" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides support for <a class="reference internal" href="AutomaticReferenceCounting.html"><span class="doc">automated reference counting</span></a> in Objective-C, which eliminates the need
+for manual <code class="docutils literal"><span class="pre">retain</span></code>/<code class="docutils literal"><span class="pre">release</span></code>/<code class="docutils literal"><span class="pre">autorelease</span></code> message sends.  There are two
+feature macros associated with automatic reference counting:
+<code class="docutils literal"><span class="pre">__has_feature(objc_arc)</span></code> indicates the availability of automated reference
+counting in general, while <code class="docutils literal"><span class="pre">__has_feature(objc_arc_weak)</span></code> indicates that
+automated reference counting also includes support for <code class="docutils literal"><span class="pre">__weak</span></code> pointers to
+Objective-C objects.</p>
+</div>
+<div class="section" id="enumerations-with-a-fixed-underlying-type">
+<span id="objc-fixed-enum"></span><h3>Enumerations with a fixed underlying type<a class="headerlink" href="#enumerations-with-a-fixed-underlying-type" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides support for C++11 enumerations with a fixed underlying type
+within Objective-C.  For example, one can write an enumeration type as:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">typedef</span> <span class="k">enum</span> <span class="o">:</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="p">{</span> <span class="n">Red</span><span class="p">,</span> <span class="n">Green</span><span class="p">,</span> <span class="n">Blue</span> <span class="p">}</span> <span class="n">Color</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>This specifies that the underlying type, which is used to store the enumeration
+value, is <code class="docutils literal"><span class="pre">unsigned</span> <span class="pre">char</span></code>.</p>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(objc_fixed_enum)</span></code> to determine whether support for fixed
+underlying types is available in Objective-C.</p>
+</div>
+<div class="section" id="interoperability-with-c-11-lambdas">
+<h3>Interoperability with C++11 lambdas<a class="headerlink" href="#interoperability-with-c-11-lambdas" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides interoperability between C++11 lambdas and blocks-based APIs, by
+permitting a lambda to be implicitly converted to a block pointer with the
+corresponding signature.  For example, consider an API such as <code class="docutils literal"><span class="pre">NSArray</span></code>’s
+array-sorting method:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="p">-</span> <span class="p">(</span><span class="bp">NSArray</span> <span class="o">*</span><span class="p">)</span><span class="nf">sortedArrayUsingComparator:</span><span class="p">(</span><span class="n">NSComparator</span><span class="p">)</span><span class="nv">cmptr</span><span class="p">;</span>
+</pre></div>
+</div>
+<p><code class="docutils literal"><span class="pre">NSComparator</span></code> is simply a typedef for the block pointer <code class="docutils literal"><span class="pre">NSComparisonResult</span>
+<span class="pre">(^)(id,</span> <span class="pre">id)</span></code>, and parameters of this type are generally provided with block
+literals as arguments.  However, one can also use a C++11 lambda so long as it
+provides the same signature (in this case, accepting two parameters of type
+<code class="docutils literal"><span class="pre">id</span></code> and returning an <code class="docutils literal"><span class="pre">NSComparisonResult</span></code>):</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="bp">NSArray</span> <span class="o">*</span><span class="n">array</span> <span class="o">=</span> <span class="l">@[</span><span class="s">@"string 1"</span><span class="p">,</span> <span class="s">@"string 21"</span><span class="p">,</span> <span class="s">@"string 12"</span><span class="p">,</span> <span class="s">@"String 11"</span><span class="p">,</span>
+                   <span class="s">@"String 02"</span><span class="l">]</span><span class="p">;</span>
+<span class="k">const</span> <span class="n">NSStringCompareOptions</span> <span class="n">comparisonOptions</span>
+  <span class="o">=</span> <span class="n">NSCaseInsensitiveSearch</span> <span class="o">|</span> <span class="n">NSNumericSearch</span> <span class="o">|</span>
+    <span class="n">NSWidthInsensitiveSearch</span> <span class="o">|</span> <span class="n">NSForcedOrderingSearch</span><span class="p">;</span>
+<span class="bp">NSLocale</span> <span class="o">*</span><span class="n">currentLocale</span> <span class="o">=</span> <span class="p">[</span><span class="bp">NSLocale</span> <span class="n">currentLocale</span><span class="p">];</span>
+<span class="bp">NSArray</span> <span class="o">*</span><span class="n">sorted</span>
+  <span class="o">=</span> <span class="p">[</span><span class="n">array</span> <span class="nl">sortedArrayUsingComparator</span><span class="p">:[</span><span class="o">=</span><span class="p">](</span><span class="kt">id</span> <span class="n">s1</span><span class="p">,</span> <span class="kt">id</span> <span class="n">s2</span><span class="p">)</span> <span class="o">-></span> <span class="n">NSComparisonResult</span> <span class="p">{</span>
+             <span class="n">NSRange</span> <span class="n">string1Range</span> <span class="o">=</span> <span class="n">NSMakeRange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="p">[</span><span class="n">s1</span> <span class="n">length</span><span class="p">]);</span>
+             <span class="k">return</span> <span class="p">[</span><span class="n">s1</span> <span class="nl">compare</span><span class="p">:</span><span class="n">s2</span> <span class="nl">options</span><span class="p">:</span><span class="n">comparisonOptions</span>
+             <span class="nl">range</span><span class="p">:</span><span class="n">string1Range</span> <span class="nl">locale</span><span class="p">:</span><span class="n">currentLocale</span><span class="p">];</span>
+     <span class="p">}];</span>
+<span class="n">NSLog</span><span class="p">(</span><span class="s">@"sorted: %@"</span><span class="p">,</span> <span class="n">sorted</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>This code relies on an implicit conversion from the type of the lambda
+expression (an unnamed, local class type called the <em>closure type</em>) to the
+corresponding block pointer type.  The conversion itself is expressed by a
+conversion operator in that closure type that produces a block pointer with the
+same signature as the lambda itself, e.g.,</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="n">operator</span> <span class="nf">NSComparisonResult</span> <span class="p">(</span><span class="o">^</span><span class="p">)(</span><span class="kt">id</span><span class="p">,</span> <span class="kt">id</span><span class="p">)()</span> <span class="k">const</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>This conversion function returns a new block that simply forwards the two
+parameters to the lambda object (which it captures by copy), then returns the
+result.  The returned block is first copied (with <code class="docutils literal"><span class="pre">Block_copy</span></code>) and then
+autoreleased.  As an optimization, if a lambda expression is immediately
+converted to a block pointer (as in the first example, above), then the block
+is not copied and autoreleased: rather, it is given the same lifetime as a
+block literal written at that point in the program, which avoids the overhead
+of copying a block to the heap in the common case.</p>
+<p>The conversion from a lambda to a block pointer is only available in
+Objective-C++, and not in C++ with blocks, due to its use of Objective-C memory
+management (autorelease).</p>
+</div>
+<div class="section" id="object-literals-and-subscripting">
+<h3>Object Literals and Subscripting<a class="headerlink" href="#object-literals-and-subscripting" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides support for <a class="reference internal" href="ObjectiveCLiterals.html"><span class="doc">Object Literals and Subscripting</span></a> in Objective-C, which simplifies common Objective-C
+programming patterns, makes programs more concise, and improves the safety of
+container creation.  There are several feature macros associated with object
+literals and subscripting: <code class="docutils literal"><span class="pre">__has_feature(objc_array_literals)</span></code> tests the
+availability of array literals; <code class="docutils literal"><span class="pre">__has_feature(objc_dictionary_literals)</span></code>
+tests the availability of dictionary literals;
+<code class="docutils literal"><span class="pre">__has_feature(objc_subscripting)</span></code> tests the availability of object
+subscripting.</p>
+</div>
+<div class="section" id="objective-c-autosynthesis-of-properties">
+<h3>Objective-C Autosynthesis of Properties<a class="headerlink" href="#objective-c-autosynthesis-of-properties" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides support for autosynthesis of declared properties.  Using this
+feature, clang provides default synthesis of those properties not declared
+@dynamic and not having user provided backing getter and setter methods.
+<code class="docutils literal"><span class="pre">__has_feature(objc_default_synthesize_properties)</span></code> checks for availability
+of this feature in version of clang being used.</p>
+</div>
+<div class="section" id="objective-c-retaining-behavior-attributes">
+<span id="langext-objc-retain-release"></span><h3>Objective-C retaining behavior attributes<a class="headerlink" href="#objective-c-retaining-behavior-attributes" title="Permalink to this headline">¶</a></h3>
+<p>In Objective-C, functions and methods are generally assumed to follow the
+<a class="reference external" href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html">Cocoa Memory Management</a>
+conventions for ownership of object arguments and
+return values. However, there are exceptions, and so Clang provides attributes
+to allow these exceptions to be documented. This are used by ARC and the
+<a class="reference external" href="http://clang-analyzer.llvm.org">static analyzer</a> Some exceptions may be
+better described using the <code class="docutils literal"><span class="pre">objc_method_family</span></code> attribute instead.</p>
+<p><strong>Usage</strong>: The <code class="docutils literal"><span class="pre">ns_returns_retained</span></code>, <code class="docutils literal"><span class="pre">ns_returns_not_retained</span></code>,
+<code class="docutils literal"><span class="pre">ns_returns_autoreleased</span></code>, <code class="docutils literal"><span class="pre">cf_returns_retained</span></code>, and
+<code class="docutils literal"><span class="pre">cf_returns_not_retained</span></code> attributes can be placed on methods and functions
+that return Objective-C or CoreFoundation objects. They are commonly placed at
+the end of a function prototype or method declaration:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="kt">id</span> <span class="nf">foo</span><span class="p">()</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">ns_returns_retained</span><span class="p">));</span>
+
+<span class="p">-</span> <span class="p">(</span><span class="bp">NSString</span> <span class="o">*</span><span class="p">)</span><span class="nf">bar:</span><span class="p">(</span><span class="kt">int</span><span class="p">)</span><span class="nv">x</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">ns_returns_retained</span><span class="p">));</span>
+</pre></div>
+</div>
+<p>The <code class="docutils literal"><span class="pre">*_returns_retained</span></code> attributes specify that the returned object has a +1
+retain count.  The <code class="docutils literal"><span class="pre">*_returns_not_retained</span></code> attributes specify that the return
+object has a +0 retain count, even if the normal convention for its selector
+would be +1.  <code class="docutils literal"><span class="pre">ns_returns_autoreleased</span></code> specifies that the returned object is
++0, but is guaranteed to live at least as long as the next flush of an
+autorelease pool.</p>
+<p><strong>Usage</strong>: The <code class="docutils literal"><span class="pre">ns_consumed</span></code> and <code class="docutils literal"><span class="pre">cf_consumed</span></code> attributes can be placed on
+an parameter declaration; they specify that the argument is expected to have a
++1 retain count, which will be balanced in some way by the function or method.
+The <code class="docutils literal"><span class="pre">ns_consumes_self</span></code> attribute can only be placed on an Objective-C
+method; it specifies that the method expects its <code class="docutils literal"><span class="pre">self</span></code> parameter to have a
++1 retain count, which it will balance in some way.</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">foo</span><span class="p">(</span><span class="n">__attribute__</span><span class="p">((</span><span class="n">ns_consumed</span><span class="p">))</span> <span class="bp">NSString</span> <span class="o">*</span><span class="n">string</span><span class="p">);</span>
+
+<span class="p">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="nf">bar</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">ns_consumes_self</span><span class="p">));</span>
+<span class="p">-</span> <span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="nf">baz:</span><span class="p">(</span><span class="kt">id</span><span class="p">)</span> <span class="nv">__attribute__</span><span class="p">((</span><span class="n">ns_consumed</span><span class="p">))</span> <span class="nv">x</span><span class="p">;</span>
+</pre></div>
+</div>
+<p>Further examples of these attributes are available in the static analyzer’s <a class="reference external" href="http://clang-analyzer.llvm.org/annotations.html#cocoa_mem">list of annotations for analysis</a>.</p>
+<p>Query for these features with <code class="docutils literal"><span class="pre">__has_attribute(ns_consumed)</span></code>,
+<code class="docutils literal"><span class="pre">__has_attribute(ns_returns_retained)</span></code>, etc.</p>
+</div>
+<div class="section" id="objective-c-available">
+<h3>Objective-C @available<a class="headerlink" href="#objective-c-available" title="Permalink to this headline">¶</a></h3>
+<p>It is possible to use the newest SDK but still build a program that can run on
+older versions of macOS and iOS by passing <code class="docutils literal"><span class="pre">-mmacosx-version-min=</span></code> /
+<code class="docutils literal"><span class="pre">-miphoneos-version-min=</span></code>.</p>
+<p>Before LLVM 5.0, when calling a function that exists only in the OS that’s
+newer than the target OS (as determined by the minimum deployment version),
+programmers had to carefully check if the function exists at runtime, using
+null checks for weakly-linked C functions, <code class="docutils literal"><span class="pre">+class</span></code> for Objective-C classes,
+and <code class="docutils literal"><span class="pre">-respondsToSelector:</span></code> or <code class="docutils literal"><span class="pre">+instancesRespondToSelector:</span></code> for
+Objective-C methods.  If such a check was missed, the program would compile
+fine, run fine on newer systems, but crash on older systems.</p>
+<p>As of LLVM 5.0, <code class="docutils literal"><span class="pre">-Wunguarded-availability</span></code> uses the <a class="reference external" href="http://clang.llvm.org/docs/AttributeReference.html#availability">availability attributes</a> together
+with the new <code class="docutils literal"><span class="pre">@available()</span></code> keyword to assist with this issue.
+When a method that’s introduced in the OS newer than the target OS is called, a
+-Wunguarded-availability warning is emitted if that call is not guarded:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">my_fun</span><span class="p">(</span><span class="n">NSSomeClass</span><span class="o">*</span> <span class="n">var</span><span class="p">)</span> <span class="p">{</span>
+  <span class="c1">// If fancyNewMethod was added in e.g. macOS 10.12, but the code is</span>
+  <span class="c1">// built with -mmacosx-version-min=10.11, then this unconditional call</span>
+  <span class="c1">// will emit a -Wunguarded-availability warning:</span>
+  <span class="p">[</span><span class="n">var</span> <span class="n">fancyNewMethod</span><span class="p">];</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>To fix the warning and to avoid the crash on macOS 10.11, wrap it in
+<code class="docutils literal"><span class="pre">if(@available())</span></code>:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">my_fun</span><span class="p">(</span><span class="n">NSSomeClass</span><span class="o">*</span> <span class="n">var</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(@</span><span class="n">available</span><span class="p">(</span><span class="n">macOS</span> <span class="mf">10.12</span><span class="p">,</span> <span class="o">*</span><span class="p">))</span> <span class="p">{</span>
+    <span class="p">[</span><span class="n">var</span> <span class="n">fancyNewMethod</span><span class="p">];</span>
+  <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+    <span class="c1">// Put fallback behavior for old macOS versions (and for non-mac</span>
+    <span class="c1">// platforms) here.</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The <code class="docutils literal"><span class="pre">*</span></code> is required and means that platforms not explicitly listed will take
+the true branch, and the compiler will emit <code class="docutils literal"><span class="pre">-Wunguarded-availability</span></code>
+warnings for unlisted platforms based on those platform’s deployment target.
+More than one platform can be listed in <code class="docutils literal"><span class="pre">@available()</span></code>:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">my_fun</span><span class="p">(</span><span class="n">NSSomeClass</span><span class="o">*</span> <span class="n">var</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">if</span> <span class="p">(@</span><span class="n">available</span><span class="p">(</span><span class="n">macOS</span> <span class="mf">10.12</span><span class="p">,</span> <span class="n">iOS</span> <span class="mi">10</span><span class="p">,</span> <span class="o">*</span><span class="p">))</span> <span class="p">{</span>
+    <span class="p">[</span><span class="n">var</span> <span class="n">fancyNewMethod</span><span class="p">];</span>
+  <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>If the caller of <code class="docutils literal"><span class="pre">my_fun()</span></code> already checks that <code class="docutils literal"><span class="pre">my_fun()</span></code> is only called
+on 10.12, then add an <a class="reference external" href="http://clang.llvm.org/docs/AttributeReference.html#availability">availability attribute</a> to it,
+which will also suppress the warning and require that calls to my_fun() are
+checked:</p>
+<div class="highlight-objc"><div class="highlight"><pre><span></span><span class="n">API_AVAILABLE</span><span class="p">(</span><span class="n">macos</span><span class="p">(</span><span class="mf">10.12</span><span class="p">))</span> <span class="kt">void</span> <span class="n">my_fun</span><span class="p">(</span><span class="n">NSSomeClass</span><span class="o">*</span> <span class="n">var</span><span class="p">)</span> <span class="p">{</span>
+  <span class="p">[</span><span class="n">var</span> <span class="n">fancyNewMethod</span><span class="p">];</span>  <span class="c1">// Now ok.</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><code class="docutils literal"><span class="pre">@available()</span></code> is only available in Objective-C code.  To use the feature
+in C and C++ code, use the <code class="docutils literal"><span class="pre">__builtin_available()</span></code> spelling instead.</p>
+<p>If existing code uses null checks or <code class="docutils literal"><span class="pre">-respondsToSelector:</span></code>, it should
+be changed to use <code class="docutils literal"><span class="pre">@available()</span></code> (or <code class="docutils literal"><span class="pre">__builtin_available</span></code>) instead.</p>
+<p><code class="docutils literal"><span class="pre">-Wunguarded-availability</span></code> is disabled by default, but
+<code class="docutils literal"><span class="pre">-Wunguarded-availability-new</span></code>, which only emits this warning for APIs
+that have been introduced in macOS >= 10.13, iOS >= 11, watchOS >= 4 and
+tvOS >= 11, is enabled by default.</p>
+</div>
+<div class="section" id="objective-c-abi-protocol-qualifier-mangling-of-parameters">
+<span id="langext-overloading"></span><h3>Objective-C++ ABI: protocol-qualifier mangling of parameters<a class="headerlink" href="#objective-c-abi-protocol-qualifier-mangling-of-parameters" title="Permalink to this headline">¶</a></h3>
+<p>Starting with LLVM 3.4, Clang produces a new mangling for parameters whose
+type is a qualified-<code class="docutils literal"><span class="pre">id</span></code> (e.g., <code class="docutils literal"><span class="pre">id<Foo></span></code>).  This mangling allows such
+parameters to be differentiated from those with the regular unqualified <code class="docutils literal"><span class="pre">id</span></code>
+type.</p>
+<p>This was a non-backward compatible mangling change to the ABI.  This change
+allows proper overloading, and also prevents mangling conflicts with template
+parameters of protocol-qualified type.</p>
+<p>Query the presence of this new mangling with
+<code class="docutils literal"><span class="pre">__has_feature(objc_protocol_qualifier_mangling)</span></code>.</p>
+</div>
+</div>
+<div class="section" id="initializer-lists-for-complex-numbers-in-c">
+<h2><a class="toc-backref" href="#id13">Initializer lists for complex numbers in C</a><a class="headerlink" href="#initializer-lists-for-complex-numbers-in-c" title="Permalink to this headline">¶</a></h2>
+<p>clang supports an extension which allows the following in C:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><math.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><complex.h></span><span class="cp"></span>
+<span class="n">complex</span> <span class="kt">float</span> <span class="n">x</span> <span class="o">=</span> <span class="p">{</span> <span class="mf">1.0f</span><span class="p">,</span> <span class="n">INFINITY</span> <span class="p">};</span> <span class="c1">// Init to (1, Inf)</span>
+</pre></div>
+</div>
+<p>This construct is useful because there is no way to separately initialize the
+real and imaginary parts of a complex variable in standard C, given that clang
+does not support <code class="docutils literal"><span class="pre">_Imaginary</span></code>.  (Clang also supports the <code class="docutils literal"><span class="pre">__real__</span></code> and
+<code class="docutils literal"><span class="pre">__imag__</span></code> extensions from gcc, which help in some cases, but are not usable
+in static initializers.)</p>
+<p>Note that this extension does not allow eliding the braces; the meaning of the
+following two lines is different:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">complex</span> <span class="kt">float</span> <span class="n">x</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span> <span class="p">{</span> <span class="mf">1.0f</span><span class="p">,</span> <span class="mf">1.0f</span> <span class="p">}</span> <span class="p">};</span> <span class="c1">// [0] = (1, 1)</span>
+<span class="n">complex</span> <span class="kt">float</span> <span class="n">x</span><span class="p">[]</span> <span class="o">=</span> <span class="p">{</span> <span class="mf">1.0f</span><span class="p">,</span> <span class="mf">1.0f</span> <span class="p">};</span> <span class="c1">// [0] = (1, 0), [1] = (1, 0)</span>
+</pre></div>
+</div>
+<p>This extension also works in C++ mode, as far as that goes, but does not apply
+to the C++ <code class="docutils literal"><span class="pre">std::complex</span></code>.  (In C++11, list initialization allows the same
+syntax to be used with <code class="docutils literal"><span class="pre">std::complex</span></code> with the same meaning.)</p>
+</div>
+<div class="section" id="builtin-functions">
+<h2><a class="toc-backref" href="#id14">Builtin Functions</a><a class="headerlink" href="#builtin-functions" title="Permalink to this headline">¶</a></h2>
+<p>Clang supports a number of builtin library functions with the same syntax as
+GCC, including things like <code class="docutils literal"><span class="pre">__builtin_nan</span></code>, <code class="docutils literal"><span class="pre">__builtin_constant_p</span></code>,
+<code class="docutils literal"><span class="pre">__builtin_choose_expr</span></code>, <code class="docutils literal"><span class="pre">__builtin_types_compatible_p</span></code>,
+<code class="docutils literal"><span class="pre">__builtin_assume_aligned</span></code>, <code class="docutils literal"><span class="pre">__sync_fetch_and_add</span></code>, etc.  In addition to
+the GCC builtins, Clang supports a number of builtins that GCC does not, which
+are listed here.</p>
+<p>Please note that Clang does not and will not support all of the GCC builtins
+for vector operations.  Instead of using builtins, you should use the functions
+defined in target-specific header files like <code class="docutils literal"><span class="pre"><xmmintrin.h></span></code>, which define
+portable wrappers for these.  Many of the Clang versions of these functions are
+implemented directly in terms of <a class="reference internal" href="#langext-vectors"><span class="std std-ref">extended vector support</span></a> instead of builtins, in order to reduce the number of
+builtins that we need to implement.</p>
+<div class="section" id="builtin-assume">
+<h3><code class="docutils literal"><span class="pre">__builtin_assume</span></code><a class="headerlink" href="#builtin-assume" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal"><span class="pre">__builtin_assume</span></code> is used to provide the optimizer with a boolean
+invariant that is defined to be true.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">__builtin_assume</span><span class="p">(</span><span class="kt">bool</span><span class="p">)</span>
+</pre></div>
+</div>
+<p><strong>Example of Use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">int</span> <span class="nf">foo</span><span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">)</span> <span class="p">{</span>
+  <span class="n">__builtin_assume</span><span class="p">(</span><span class="n">x</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">);</span>
+
+  <span class="c1">// The optimizer may short-circuit this check using the invariant.</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
+    <span class="k">return</span> <span class="n">do_something</span><span class="p">();</span>
+
+  <span class="k">return</span> <span class="n">do_something_else</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The boolean argument to this function is defined to be true. The optimizer may
+analyze the form of the expression provided as the argument and deduce from
+that information used to optimize the program. If the condition is violated
+during execution, the behavior is undefined. The argument itself is never
+evaluated, so any side effects of the expression will be discarded.</p>
+<p>Query for this feature with <code class="docutils literal"><span class="pre">__has_builtin(__builtin_assume)</span></code>.</p>
+</div>
+<div class="section" id="builtin-readcyclecounter">
+<h3><code class="docutils literal"><span class="pre">__builtin_readcyclecounter</span></code><a class="headerlink" href="#builtin-readcyclecounter" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal"><span class="pre">__builtin_readcyclecounter</span></code> is used to access the cycle counter register (or
+a similar low-latency, high-accuracy clock) on those targets that support it.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">__builtin_readcyclecounter</span><span class="p">()</span>
+</pre></div>
+</div>
+<p><strong>Example of Use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">t0</span> <span class="o">=</span> <span class="n">__builtin_readcyclecounter</span><span class="p">();</span>
+<span class="n">do_something</span><span class="p">();</span>
+<span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">t1</span> <span class="o">=</span> <span class="n">__builtin_readcyclecounter</span><span class="p">();</span>
+<span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">cycles_to_do_something</span> <span class="o">=</span> <span class="n">t1</span> <span class="o">-</span> <span class="n">t0</span><span class="p">;</span> <span class="c1">// assuming no overflow</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The <code class="docutils literal"><span class="pre">__builtin_readcyclecounter()</span></code> builtin returns the cycle counter value,
+which may be either global or process/thread-specific depending on the target.
+As the backing counters often overflow quickly (on the order of seconds) this
+should only be used for timing small intervals.  When not supported by the
+target, the return value is always zero.  This builtin takes no arguments and
+produces an unsigned long long result.</p>
+<p>Query for this feature with <code class="docutils literal"><span class="pre">__has_builtin(__builtin_readcyclecounter)</span></code>. Note
+that even if present, its use may depend on run-time privilege or other OS
+controlled state.</p>
+</div>
+<div class="section" id="builtin-shufflevector">
+<span id="langext-builtin-shufflevector"></span><h3><code class="docutils literal"><span class="pre">__builtin_shufflevector</span></code><a class="headerlink" href="#builtin-shufflevector" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal"><span class="pre">__builtin_shufflevector</span></code> is used to express generic vector
+permutation/shuffle/swizzle operations.  This builtin is also very important
+for the implementation of various target-specific header files like
+<code class="docutils literal"><span class="pre"><xmmintrin.h></span></code>.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">vec1</span><span class="p">,</span> <span class="n">vec2</span><span class="p">,</span> <span class="n">index1</span><span class="p">,</span> <span class="n">index2</span><span class="p">,</span> <span class="p">...)</span>
+</pre></div>
+</div>
+<p><strong>Examples</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="c1">// identity operation - return 4-element vector v1.</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">v1</span><span class="p">,</span> <span class="n">v1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
+
+<span class="c1">// "Splat" element 0 of V1 into a 4-element result.</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">V1</span><span class="p">,</span> <span class="n">V1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+
+<span class="c1">// Reverse 4-element vector V1.</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">V1</span><span class="p">,</span> <span class="n">V1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
+
+<span class="c1">// Concatenate every other element of 4-element vectors V1 and V2.</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">V1</span><span class="p">,</span> <span class="n">V2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">6</span><span class="p">)</span>
+
+<span class="c1">// Concatenate every other element of 8-element vectors V1 and V2.</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">V1</span><span class="p">,</span> <span class="n">V2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="mi">14</span><span class="p">)</span>
+
+<span class="c1">// Shuffle v1 with some elements being undefined</span>
+<span class="n">__builtin_shufflevector</span><span class="p">(</span><span class="n">v1</span><span class="p">,</span> <span class="n">v1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The first two arguments to <code class="docutils literal"><span class="pre">__builtin_shufflevector</span></code> are vectors that have
+the same element type.  The remaining arguments are a list of integers that
+specify the elements indices of the first two vectors that should be extracted
+and returned in a new vector.  These element indices are numbered sequentially
+starting with the first vector, continuing into the second vector.  Thus, if
+<code class="docutils literal"><span class="pre">vec1</span></code> is a 4-element vector, index 5 would refer to the second element of
+<code class="docutils literal"><span class="pre">vec2</span></code>. An index of -1 can be used to indicate that the corresponding element
+in the returned vector is a don’t care and can be optimized by the backend.</p>
+<p>The result of <code class="docutils literal"><span class="pre">__builtin_shufflevector</span></code> is a vector with the same element
+type as <code class="docutils literal"><span class="pre">vec1</span></code>/<code class="docutils literal"><span class="pre">vec2</span></code> but that has an element count equal to the number of
+indices specified.</p>
+<p>Query for this feature with <code class="docutils literal"><span class="pre">__has_builtin(__builtin_shufflevector)</span></code>.</p>
+</div>
+<div class="section" id="builtin-convertvector">
+<span id="langext-builtin-convertvector"></span><h3><code class="docutils literal"><span class="pre">__builtin_convertvector</span></code><a class="headerlink" href="#builtin-convertvector" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal"><span class="pre">__builtin_convertvector</span></code> is used to express generic vector
+type-conversion operations. The input vector and the output vector
+type must have the same number of elements.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">__builtin_convertvector</span><span class="p">(</span><span class="n">src_vec</span><span class="p">,</span> <span class="n">dst_vec_type</span><span class="p">)</span>
+</pre></div>
+</div>
+<p><strong>Examples</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">typedef</span> <span class="kt">double</span> <span class="n">vector4double</span> <span class="nf">__attribute__</span><span class="p">((</span><span class="n">__vector_size__</span><span class="p">(</span><span class="mi">32</span><span class="p">)));</span>
+<span class="k">typedef</span> <span class="kt">float</span>  <span class="n">vector4float</span>  <span class="nf">__attribute__</span><span class="p">((</span><span class="n">__vector_size__</span><span class="p">(</span><span class="mi">16</span><span class="p">)));</span>
+<span class="k">typedef</span> <span class="kt">short</span>  <span class="n">vector4short</span>  <span class="nf">__attribute__</span><span class="p">((</span><span class="n">__vector_size__</span><span class="p">(</span><span class="mi">8</span><span class="p">)));</span>
+<span class="n">vector4float</span> <span class="n">vf</span><span class="p">;</span> <span class="n">vector4short</span> <span class="n">vs</span><span class="p">;</span>
+
+<span class="c1">// convert from a vector of 4 floats to a vector of 4 doubles.</span>
+<span class="n">__builtin_convertvector</span><span class="p">(</span><span class="n">vf</span><span class="p">,</span> <span class="n">vector4double</span><span class="p">)</span>
+<span class="c1">// equivalent to:</span>
+<span class="p">(</span><span class="n">vector4double</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="kt">double</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="p">(</span><span class="kt">double</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="p">(</span><span class="kt">double</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="p">(</span><span class="kt">double</span><span class="p">)</span> <span class="n">vf</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="p">}</span>
+
+<span class="c1">// convert from a vector of 4 shorts to a vector of 4 floats.</span>
+<span class="n">__builtin_convertvector</span><span class="p">(</span><span class="n">vs</span><span class="p">,</span> <span class="n">vector4float</span><span class="p">)</span>
+<span class="c1">// equivalent to:</span>
+<span class="p">(</span><span class="n">vector4float</span><span class="p">)</span> <span class="p">{</span> <span class="p">(</span><span class="kt">float</span><span class="p">)</span> <span class="n">vs</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="p">(</span><span class="kt">float</span><span class="p">)</span> <span class="n">vs</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="p">(</span><span class="kt">float</span><span class="p">)</span> <span class="n">vs</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="p">(</span><span class="kt">float</span><span class="p">)</span> <span class="n">vs</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="p">}</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The first argument to <code class="docutils literal"><span class="pre">__builtin_convertvector</span></code> is a vector, and the second
+argument is a vector type with the same number of elements as the first
+argument.</p>
+<p>The result of <code class="docutils literal"><span class="pre">__builtin_convertvector</span></code> is a vector with the same element
+type as the second argument, with a value defined in terms of the action of a
+C-style cast applied to each element of the first argument.</p>
+<p>Query for this feature with <code class="docutils literal"><span class="pre">__has_builtin(__builtin_convertvector)</span></code>.</p>
+</div>
+<div class="section" id="builtin-bitreverse">
+<h3><code class="docutils literal"><span class="pre">__builtin_bitreverse</span></code><a class="headerlink" href="#builtin-bitreverse" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li><code class="docutils literal"><span class="pre">__builtin_bitreverse8</span></code></li>
+<li><code class="docutils literal"><span class="pre">__builtin_bitreverse16</span></code></li>
+<li><code class="docutils literal"><span class="pre">__builtin_bitreverse32</span></code></li>
+<li><code class="docutils literal"><span class="pre">__builtin_bitreverse64</span></code></li>
+</ul>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">__builtin_bitreverse32</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
+</pre></div>
+</div>
+<p><strong>Examples</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">uint8_t</span> <span class="n">rev_x</span> <span class="o">=</span> <span class="n">__builtin_bitreverse8</span><span class="p">(</span><span class="n">x</span><span class="p">);</span>
+<span class="kt">uint16_t</span> <span class="n">rev_x</span> <span class="o">=</span> <span class="n">__builtin_bitreverse16</span><span class="p">(</span><span class="n">x</span><span class="p">);</span>
+<span class="kt">uint32_t</span> <span class="n">rev_y</span> <span class="o">=</span> <span class="n">__builtin_bitreverse32</span><span class="p">(</span><span class="n">y</span><span class="p">);</span>
+<span class="kt">uint64_t</span> <span class="n">rev_z</span> <span class="o">=</span> <span class="n">__builtin_bitreverse64</span><span class="p">(</span><span class="n">z</span><span class="p">);</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The ‘<code class="docutils literal"><span class="pre">__builtin_bitreverse</span></code>’ family of builtins is used to reverse
+the bitpattern of an integer value; for example <code class="docutils literal"><span class="pre">0b10110110</span></code> becomes
+<code class="docutils literal"><span class="pre">0b01101101</span></code>.</p>
+</div>
+<div class="section" id="builtin-unreachable">
+<h3><code class="docutils literal"><span class="pre">__builtin_unreachable</span></code><a class="headerlink" href="#builtin-unreachable" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal"><span class="pre">__builtin_unreachable</span></code> is used to indicate that a specific point in the
+program cannot be reached, even if the compiler might otherwise think it can.
+This is useful to improve optimization and eliminates certain warnings.  For
+example, without the <code class="docutils literal"><span class="pre">__builtin_unreachable</span></code> in the example below, the
+compiler assumes that the inline asm can fall through and prints a “function
+declared ‘<code class="docutils literal"><span class="pre">noreturn</span></code>’ should not return” warning.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">__builtin_unreachable</span><span class="p">()</span>
+</pre></div>
+</div>
+<p><strong>Example of use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">myabort</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="n">__attribute__</span><span class="p">((</span><span class="n">noreturn</span><span class="p">));</span>
+<span class="kt">void</span> <span class="nf">myabort</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">asm</span><span class="p">(</span><span class="s">"int3"</span><span class="p">);</span>
+  <span class="n">__builtin_unreachable</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The <code class="docutils literal"><span class="pre">__builtin_unreachable()</span></code> builtin has completely undefined behavior.
+Since it has undefined behavior, it is a statement that it is never reached and
+the optimizer can take advantage of this to produce better code.  This builtin
+takes no arguments and produces a void result.</p>
+<p>Query for this feature with <code class="docutils literal"><span class="pre">__has_builtin(__builtin_unreachable)</span></code>.</p>
+</div>
+<div class="section" id="builtin-unpredictable">
+<h3><code class="docutils literal"><span class="pre">__builtin_unpredictable</span></code><a class="headerlink" href="#builtin-unpredictable" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal"><span class="pre">__builtin_unpredictable</span></code> is used to indicate that a branch condition is
+unpredictable by hardware mechanisms such as branch prediction logic.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">__builtin_unpredictable</span><span class="p">(</span><span class="kt">long</span> <span class="kt">long</span><span class="p">)</span>
+</pre></div>
+</div>
+<p><strong>Example of use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">__builtin_unpredictable</span><span class="p">(</span><span class="n">x</span> <span class="o">></span> <span class="mi">0</span><span class="p">))</span> <span class="p">{</span>
+   <span class="n">foo</span><span class="p">();</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The <code class="docutils literal"><span class="pre">__builtin_unpredictable()</span></code> builtin is expected to be used with control
+flow conditions such as in <code class="docutils literal"><span class="pre">if</span></code> and <code class="docutils literal"><span class="pre">switch</span></code> statements.</p>
+<p>Query for this feature with <code class="docutils literal"><span class="pre">__has_builtin(__builtin_unpredictable)</span></code>.</p>
+</div>
+<div class="section" id="sync-swap">
+<h3><code class="docutils literal"><span class="pre">__sync_swap</span></code><a class="headerlink" href="#sync-swap" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal"><span class="pre">__sync_swap</span></code> is used to atomically swap integers or pointers in memory.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">type</span> <span class="n">__sync_swap</span><span class="p">(</span><span class="n">type</span> <span class="o">*</span><span class="n">ptr</span><span class="p">,</span> <span class="n">type</span> <span class="n">value</span><span class="p">,</span> <span class="p">...)</span>
+</pre></div>
+</div>
+<p><strong>Example of Use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="kt">int</span> <span class="n">old_value</span> <span class="o">=</span> <span class="n">__sync_swap</span><span class="p">(</span><span class="o">&</span><span class="n">value</span><span class="p">,</span> <span class="n">new_value</span><span class="p">);</span>
+</pre></div>
+</div>
+<p><strong>Description</strong>:</p>
+<p>The <code class="docutils literal"><span class="pre">__sync_swap()</span></code> builtin extends the existing <code class="docutils literal"><span class="pre">__sync_*()</span></code> family of
+atomic intrinsics to allow code to atomically swap the current value with the
+new value.  More importantly, it helps developers write more efficient and
+correct code by avoiding expensive loops around
+<code class="docutils literal"><span class="pre">__sync_bool_compare_and_swap()</span></code> or relying on the platform specific
+implementation details of <code class="docutils literal"><span class="pre">__sync_lock_test_and_set()</span></code>.  The
+<code class="docutils literal"><span class="pre">__sync_swap()</span></code> builtin is a full barrier.</p>
+</div>
+<div class="section" id="builtin-addressof">
+<h3><code class="docutils literal"><span class="pre">__builtin_addressof</span></code><a class="headerlink" href="#builtin-addressof" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal"><span class="pre">__builtin_addressof</span></code> performs the functionality of the built-in <code class="docutils literal"><span class="pre">&</span></code>
+operator, ignoring any <code class="docutils literal"><span class="pre">operator&</span></code> overload.  This is useful in constant
+expressions in C++11, where there is no other way to take the address of an
+object that overloads <code class="docutils literal"><span class="pre">operator&</span></code>.</p>
+<p><strong>Example of use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="o">></span> <span class="k">constexpr</span> <span class="n">T</span> <span class="o">*</span><span class="n">addressof</span><span class="p">(</span><span class="n">T</span> <span class="o">&</span><span class="n">value</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">__builtin_addressof</span><span class="p">(</span><span class="n">value</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="builtin-operator-new-and-builtin-operator-delete">
+<h3><code class="docutils literal"><span class="pre">__builtin_operator_new</span></code> and <code class="docutils literal"><span class="pre">__builtin_operator_delete</span></code><a class="headerlink" href="#builtin-operator-new-and-builtin-operator-delete" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal"><span class="pre">__builtin_operator_new</span></code> allocates memory just like a non-placement non-class
+<em>new-expression</em>. This is exactly like directly calling the normal
+non-placement <code class="docutils literal"><span class="pre">::operator</span> <span class="pre">new</span></code>, except that it allows certain optimizations
+that the C++ standard does not permit for a direct function call to
+<code class="docutils literal"><span class="pre">::operator</span> <span class="pre">new</span></code> (in particular, removing <code class="docutils literal"><span class="pre">new</span></code> / <code class="docutils literal"><span class="pre">delete</span></code> pairs and
+merging allocations).</p>
+<p>Likewise, <code class="docutils literal"><span class="pre">__builtin_operator_delete</span></code> deallocates memory just like a
+non-class <em>delete-expression</em>, and is exactly like directly calling the normal
+<code class="docutils literal"><span class="pre">::operator</span> <span class="pre">delete</span></code>, except that it permits optimizations. Only the unsized
+form of <code class="docutils literal"><span class="pre">__builtin_operator_delete</span></code> is currently available.</p>
+<p>These builtins are intended for use in the implementation of <code class="docutils literal"><span class="pre">std::allocator</span></code>
+and other similar allocation libraries, and are only available in C++.</p>
+</div>
+<div class="section" id="multiprecision-arithmetic-builtins">
+<h3>Multiprecision Arithmetic Builtins<a class="headerlink" href="#multiprecision-arithmetic-builtins" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides a set of builtins which expose multiprecision arithmetic in a
+manner amenable to C. They all have the following form:</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="kt">unsigned</span> <span class="n">x</span> <span class="o">=</span> <span class="p">...,</span> <span class="n">y</span> <span class="o">=</span> <span class="p">...,</span> <span class="n">carryin</span> <span class="o">=</span> <span class="p">...,</span> <span class="n">carryout</span><span class="p">;</span>
+<span class="kt">unsigned</span> <span class="n">sum</span> <span class="o">=</span> <span class="n">__builtin_addc</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">carryin</span><span class="p">,</span> <span class="o">&</span><span class="n">carryout</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>Thus one can form a multiprecision addition chain in the following manner:</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="kt">unsigned</span> <span class="o">*</span><span class="n">x</span><span class="p">,</span> <span class="o">*</span><span class="n">y</span><span class="p">,</span> <span class="o">*</span><span class="n">z</span><span class="p">,</span> <span class="n">carryin</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">carryout</span><span class="p">;</span>
+<span class="n">z</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">__builtin_addc</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">y</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">carryin</span><span class="p">,</span> <span class="o">&</span><span class="n">carryout</span><span class="p">);</span>
+<span class="n">carryin</span> <span class="o">=</span> <span class="n">carryout</span><span class="p">;</span>
+<span class="n">z</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">__builtin_addc</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">y</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">carryin</span><span class="p">,</span> <span class="o">&</span><span class="n">carryout</span><span class="p">);</span>
+<span class="n">carryin</span> <span class="o">=</span> <span class="n">carryout</span><span class="p">;</span>
+<span class="n">z</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="n">__builtin_addc</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">y</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">carryin</span><span class="p">,</span> <span class="o">&</span><span class="n">carryout</span><span class="p">);</span>
+<span class="n">carryin</span> <span class="o">=</span> <span class="n">carryout</span><span class="p">;</span>
+<span class="n">z</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="n">__builtin_addc</span><span class="p">(</span><span class="n">x</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">y</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">carryin</span><span class="p">,</span> <span class="o">&</span><span class="n">carryout</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>The complete list of builtins are:</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="kt">unsigned</span> <span class="kt">char</span>      <span class="nf">__builtin_addcb</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">short</span>     <span class="nf">__builtin_addcs</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span>           <span class="nf">__builtin_addc</span>  <span class="p">(</span><span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">long</span>      <span class="nf">__builtin_addcl</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="nf">__builtin_addcll</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">char</span>      <span class="nf">__builtin_subcb</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">short</span>     <span class="nf">__builtin_subcs</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span>           <span class="nf">__builtin_subc</span>  <span class="p">(</span><span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">long</span>      <span class="nf">__builtin_subcl</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+<span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="nf">__builtin_subcll</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">carryin</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">carryout</span><span class="p">);</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="checked-arithmetic-builtins">
+<h3>Checked Arithmetic Builtins<a class="headerlink" href="#checked-arithmetic-builtins" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides a set of builtins that implement checked arithmetic for security
+critical applications in a manner that is fast and easily expressable in C. As
+an example of their usage:</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="n">errorcode_t</span> <span class="nf">security_critical_application</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">result</span><span class="p">;</span>
+  <span class="p">...</span>
+  <span class="k">if</span> <span class="p">(</span><span class="n">__builtin_mul_overflow</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="o">&</span><span class="n">result</span><span class="p">))</span>
+    <span class="k">return</span> <span class="n">kErrorCodeHackers</span><span class="p">;</span>
+  <span class="p">...</span>
+  <span class="n">use_multiply</span><span class="p">(</span><span class="n">result</span><span class="p">);</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Clang provides the following checked arithmetic builtins:</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="kt">bool</span> <span class="nf">__builtin_add_overflow</span>   <span class="p">(</span><span class="n">type1</span> <span class="n">x</span><span class="p">,</span> <span class="n">type2</span> <span class="n">y</span><span class="p">,</span> <span class="n">type3</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_sub_overflow</span>   <span class="p">(</span><span class="n">type1</span> <span class="n">x</span><span class="p">,</span> <span class="n">type2</span> <span class="n">y</span><span class="p">,</span> <span class="n">type3</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_mul_overflow</span>   <span class="p">(</span><span class="n">type1</span> <span class="n">x</span><span class="p">,</span> <span class="n">type2</span> <span class="n">y</span><span class="p">,</span> <span class="n">type3</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_uadd_overflow</span>  <span class="p">(</span><span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_uaddl_overflow</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_uaddll_overflow</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_usub_overflow</span>  <span class="p">(</span><span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_usubl_overflow</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_usubll_overflow</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_umul_overflow</span>  <span class="p">(</span><span class="kt">unsigned</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_umull_overflow</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_umulll_overflow</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_sadd_overflow</span>  <span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="kt">int</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_saddl_overflow</span> <span class="p">(</span><span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_saddll_overflow</span><span class="p">(</span><span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">sum</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_ssub_overflow</span>  <span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="kt">int</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_ssubl_overflow</span> <span class="p">(</span><span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_ssubll_overflow</span><span class="p">(</span><span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">diff</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_smul_overflow</span>  <span class="p">(</span><span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="kt">int</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_smull_overflow</span> <span class="p">(</span><span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+<span class="kt">bool</span> <span class="nf">__builtin_smulll_overflow</span><span class="p">(</span><span class="kt">long</span> <span class="kt">long</span> <span class="n">x</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="n">y</span><span class="p">,</span> <span class="kt">long</span> <span class="kt">long</span> <span class="o">*</span><span class="n">prod</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>Each builtin performs the specified mathematical operation on the
+first two arguments and stores the result in the third argument.  If
+possible, the result will be equal to mathematically-correct result
+and the builtin will return 0.  Otherwise, the builtin will return
+1 and the result will be equal to the unique value that is equivalent
+to the mathematically-correct result modulo two raised to the <em>k</em>
+power, where <em>k</em> is the number of bits in the result type.  The
+behavior of these builtins is well-defined for all argument values.</p>
+<p>The first three builtins work generically for operands of any integer type,
+including boolean types.  The operands need not have the same type as each
+other, or as the result.  The other builtins may implicitly promote or
+convert their operands before performing the operation.</p>
+<p>Query for this feature with <code class="docutils literal"><span class="pre">__has_builtin(__builtin_add_overflow)</span></code>, etc.</p>
+</div>
+<div class="section" id="floating-point-builtins">
+<h3>Floating point builtins<a class="headerlink" href="#floating-point-builtins" title="Permalink to this headline">¶</a></h3>
+</div>
+<div class="section" id="builtin-canonicalize">
+<h3><code class="docutils literal"><span class="pre">__builtin_canonicalize</span></code><a class="headerlink" href="#builtin-canonicalize" title="Permalink to this headline">¶</a></h3>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="kt">double</span> <span class="nf">__builtin_canonicalize</span><span class="p">(</span><span class="kt">double</span><span class="p">);</span>
+<span class="kt">float</span> <span class="nf">__builtin_canonicalizef</span><span class="p">(</span><span class="kt">float</span><span class="p">);</span>
+<span class="kt">long</span> <span class="nf">double__builtin_canonicalizel</span><span class="p">(</span><span class="kt">long</span> <span class="kt">double</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>Returns the platform specific canonical encoding of a floating point
+number. This canonicalization is useful for implementing certain
+numeric primitives such as frexp. See <a class="reference external" href="http://llvm.org/docs/LangRef.html#llvm-canonicalize-intrinsic">LLVM canonicalize intrinsic</a> for
+more information on the semantics.</p>
+</div>
+<div class="section" id="string-builtins">
+<h3>String builtins<a class="headerlink" href="#string-builtins" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides constant expression evaluation support for builtins forms of
+the following functions from the C standard library <code class="docutils literal"><span class="pre"><string.h></span></code> header:</p>
+<ul class="simple">
+<li><code class="docutils literal"><span class="pre">memchr</span></code></li>
+<li><code class="docutils literal"><span class="pre">memcmp</span></code></li>
+<li><code class="docutils literal"><span class="pre">strchr</span></code></li>
+<li><code class="docutils literal"><span class="pre">strcmp</span></code></li>
+<li><code class="docutils literal"><span class="pre">strlen</span></code></li>
+<li><code class="docutils literal"><span class="pre">strncmp</span></code></li>
+<li><code class="docutils literal"><span class="pre">wcschr</span></code></li>
+<li><code class="docutils literal"><span class="pre">wcscmp</span></code></li>
+<li><code class="docutils literal"><span class="pre">wcslen</span></code></li>
+<li><code class="docutils literal"><span class="pre">wcsncmp</span></code></li>
+<li><code class="docutils literal"><span class="pre">wmemchr</span></code></li>
+<li><code class="docutils literal"><span class="pre">wmemcmp</span></code></li>
+</ul>
+<p>In each case, the builtin form has the name of the C library function prefixed
+by <code class="docutils literal"><span class="pre">__builtin_</span></code>. Example:</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="o">*</span><span class="n">p</span> <span class="o">=</span> <span class="n">__builtin_memchr</span><span class="p">(</span><span class="s">"foobar"</span><span class="p">,</span> <span class="sc">'b'</span><span class="p">,</span> <span class="mi">5</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>In addition to the above, one further builtin is provided:</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="kt">char</span> <span class="o">*</span><span class="nf">__builtin_char_memchr</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">haystack</span><span class="p">,</span> <span class="kt">int</span> <span class="n">needle</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">size</span><span class="p">);</span>
+</pre></div>
+</div>
+<p><code class="docutils literal"><span class="pre">__builtin_char_memchr(a,</span> <span class="pre">b,</span> <span class="pre">c)</span></code> is identical to
+<code class="docutils literal"><span class="pre">(char*)__builtin_memchr(a,</span> <span class="pre">b,</span> <span class="pre">c)</span></code> except that its use is permitted within
+constant expressions in C++11 onwards (where a cast from <code class="docutils literal"><span class="pre">void*</span></code> to <code class="docutils literal"><span class="pre">char*</span></code>
+is disallowed in general).</p>
+<p>Support for constant expression evaluation for the above builtins be detected
+with <code class="docutils literal"><span class="pre">__has_feature(cxx_constexpr_string_builtins)</span></code>.</p>
+</div>
+<div class="section" id="c11-atomic-builtins">
+<span id="langext-c11-atomic"></span><h3>__c11_atomic builtins<a class="headerlink" href="#c11-atomic-builtins" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides a set of builtins which are intended to be used to implement
+C11’s <code class="docutils literal"><span class="pre"><stdatomic.h></span></code> header.  These builtins provide the semantics of the
+<code class="docutils literal"><span class="pre">_explicit</span></code> form of the corresponding C11 operation, and are named with a
+<code class="docutils literal"><span class="pre">__c11_</span></code> prefix.  The supported operations, and the differences from
+the corresponding C11 operations, are:</p>
+<ul class="simple">
+<li><code class="docutils literal"><span class="pre">__c11_atomic_init</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_thread_fence</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_signal_fence</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_is_lock_free</span></code> (The argument is the size of the
+<code class="docutils literal"><span class="pre">_Atomic(...)</span></code> object, instead of its address)</li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_store</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_load</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_exchange</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_compare_exchange_strong</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_compare_exchange_weak</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_fetch_add</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_fetch_sub</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_fetch_and</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_fetch_or</span></code></li>
+<li><code class="docutils literal"><span class="pre">__c11_atomic_fetch_xor</span></code></li>
+</ul>
+<p>The macros <code class="docutils literal"><span class="pre">__ATOMIC_RELAXED</span></code>, <code class="docutils literal"><span class="pre">__ATOMIC_CONSUME</span></code>, <code class="docutils literal"><span class="pre">__ATOMIC_ACQUIRE</span></code>,
+<code class="docutils literal"><span class="pre">__ATOMIC_RELEASE</span></code>, <code class="docutils literal"><span class="pre">__ATOMIC_ACQ_REL</span></code>, and <code class="docutils literal"><span class="pre">__ATOMIC_SEQ_CST</span></code> are
+provided, with values corresponding to the enumerators of C11’s
+<code class="docutils literal"><span class="pre">memory_order</span></code> enumeration.</p>
+<p>(Note that Clang additionally provides GCC-compatible <code class="docutils literal"><span class="pre">__atomic_*</span></code>
+builtins)</p>
+</div>
+<div class="section" id="low-level-arm-exclusive-memory-builtins">
+<h3>Low-level ARM exclusive memory builtins<a class="headerlink" href="#low-level-arm-exclusive-memory-builtins" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides overloaded builtins giving direct access to the three key ARM
+instructions for implementing atomic operations.</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="n">T</span> <span class="nf">__builtin_arm_ldrex</span><span class="p">(</span><span class="k">const</span> <span class="k">volatile</span> <span class="n">T</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="n">T</span> <span class="nf">__builtin_arm_ldaex</span><span class="p">(</span><span class="k">const</span> <span class="k">volatile</span> <span class="n">T</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="kt">int</span> <span class="nf">__builtin_arm_strex</span><span class="p">(</span><span class="n">T</span> <span class="n">val</span><span class="p">,</span> <span class="k">volatile</span> <span class="n">T</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="kt">int</span> <span class="nf">__builtin_arm_stlex</span><span class="p">(</span><span class="n">T</span> <span class="n">val</span><span class="p">,</span> <span class="k">volatile</span> <span class="n">T</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="kt">void</span> <span class="nf">__builtin_arm_clrex</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>The types <code class="docutils literal"><span class="pre">T</span></code> currently supported are:</p>
+<ul class="simple">
+<li>Integer types with width at most 64 bits (or 128 bits on AArch64).</li>
+<li>Floating-point types</li>
+<li>Pointer types.</li>
+</ul>
+<p>Note that the compiler does not guarantee it will not insert stores which clear
+the exclusive monitor in between an <code class="docutils literal"><span class="pre">ldrex</span></code> type operation and its paired
+<code class="docutils literal"><span class="pre">strex</span></code>. In practice this is only usually a risk when the extra store is on
+the same cache line as the variable being modified and Clang will only insert
+stack stores on its own, so it is best not to use these operations on variables
+with automatic storage duration.</p>
+<p>Also, loads and stores may be implicit in code written between the <code class="docutils literal"><span class="pre">ldrex</span></code> and
+<code class="docutils literal"><span class="pre">strex</span></code>. Clang will not necessarily mitigate the effects of these either, so
+care should be exercised.</p>
+<p>For these reasons the higher level atomic primitives should be preferred where
+possible.</p>
+</div>
+<div class="section" id="non-temporal-load-store-builtins">
+<h3>Non-temporal load/store builtins<a class="headerlink" href="#non-temporal-load-store-builtins" title="Permalink to this headline">¶</a></h3>
+<p>Clang provides overloaded builtins allowing generation of non-temporal memory
+accesses.</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="n">T</span> <span class="nf">__builtin_nontemporal_load</span><span class="p">(</span><span class="n">T</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="kt">void</span> <span class="nf">__builtin_nontemporal_store</span><span class="p">(</span><span class="n">T</span> <span class="n">value</span><span class="p">,</span> <span class="n">T</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+</pre></div>
+</div>
+<p>The types <code class="docutils literal"><span class="pre">T</span></code> currently supported are:</p>
+<ul class="simple">
+<li>Integer types.</li>
+<li>Floating-point types.</li>
+<li>Vector types.</li>
+</ul>
+<p>Note that the compiler does not guarantee that non-temporal loads or stores
+will be used.</p>
+</div>
+<div class="section" id="c-coroutines-support-builtins">
+<h3>C++ Coroutines support builtins<a class="headerlink" href="#c-coroutines-support-builtins" title="Permalink to this headline">¶</a></h3>
+<div class="admonition warning">
+<p class="first admonition-title">Warning</p>
+<p class="last">This is a work in progress. Compatibility across Clang/LLVM releases is not
+guaranteed.</p>
+</div>
+<p>Clang provides experimental builtins to support C++ Coroutines as defined by
+<a class="reference external" href="http://wg21.link/P0057">http://wg21.link/P0057</a>. The following four are intended to be used by the
+standard library to implement <cite>std::experimental::coroutine_handle</cite> type.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="kt">void</span>  <span class="nf">__builtin_coro_resume</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="kt">void</span>  <span class="nf">__builtin_coro_destroy</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="kt">bool</span>  <span class="nf">__builtin_coro_done</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">addr</span><span class="p">);</span>
+<span class="kt">void</span> <span class="o">*</span><span class="n">__builtin_coro_promise</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">addr</span><span class="p">,</span> <span class="kt">int</span> <span class="n">alignment</span><span class="p">,</span> <span class="kt">bool</span> <span class="n">from_promise</span><span class="p">)</span>
+</pre></div>
+</div>
+<p><strong>Example of use</strong>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">template</span> <span class="o"><></span> <span class="k">struct</span> <span class="n">coroutine_handle</span><span class="o"><</span><span class="kt">void</span><span class="o">></span> <span class="p">{</span>
+  <span class="kt">void</span> <span class="n">resume</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="n">__builtin_coro_resume</span><span class="p">(</span><span class="n">ptr</span><span class="p">);</span> <span class="p">}</span>
+  <span class="kt">void</span> <span class="n">destroy</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="n">__builtin_coro_destroy</span><span class="p">(</span><span class="n">ptr</span><span class="p">);</span> <span class="p">}</span>
+  <span class="kt">bool</span> <span class="n">done</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span> <span class="k">return</span> <span class="n">__builtin_coro_done</span><span class="p">(</span><span class="n">ptr</span><span class="p">);</span> <span class="p">}</span>
+  <span class="c1">// ...</span>
+<span class="k">protected</span><span class="o">:</span>
+  <span class="kt">void</span> <span class="o">*</span><span class="n">ptr</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="k">template</span> <span class="o"><</span><span class="k">typename</span> <span class="n">Promise</span><span class="o">></span> <span class="k">struct</span> <span class="nl">coroutine_handle</span> <span class="p">:</span> <span class="n">coroutine_handle</span><span class="o"><></span> <span class="p">{</span>
+  <span class="c1">// ...</span>
+  <span class="n">Promise</span> <span class="o">&</span><span class="n">promise</span><span class="p">()</span> <span class="k">const</span> <span class="p">{</span>
+    <span class="k">return</span> <span class="o">*</span><span class="k">reinterpret_cast</span><span class="o"><</span><span class="n">Promise</span> <span class="o">*></span><span class="p">(</span>
+      <span class="n">__builtin_coro_promise</span><span class="p">(</span><span class="n">ptr</span><span class="p">,</span> <span class="k">alignof</span><span class="p">(</span><span class="n">Promise</span><span class="p">),</span> <span class="cm">/*from-promise=*/</span><span class="nb">false</span><span class="p">));</span>
+  <span class="p">}</span>
+  <span class="k">static</span> <span class="n">coroutine_handle</span> <span class="n">from_promise</span><span class="p">(</span><span class="n">Promise</span> <span class="o">&</span><span class="n">promise</span><span class="p">)</span> <span class="p">{</span>
+    <span class="n">coroutine_handle</span> <span class="n">p</span><span class="p">;</span>
+    <span class="n">p</span><span class="p">.</span><span class="n">ptr</span> <span class="o">=</span> <span class="n">__builtin_coro_promise</span><span class="p">(</span><span class="o">&</span><span class="n">promise</span><span class="p">,</span> <span class="k">alignof</span><span class="p">(</span><span class="n">Promise</span><span class="p">),</span>
+                                                    <span class="cm">/*from-promise=*/</span><span class="nb">true</span><span class="p">);</span>
+    <span class="k">return</span> <span class="n">p</span><span class="p">;</span>
+  <span class="p">}</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+<p>Other coroutine builtins are either for internal clang use or for use during
+development of the coroutine feature. See <a class="reference external" href="http://llvm.org/docs/Coroutines.html#intrinsics">Coroutines in LLVM</a> for
+more information on their semantics. Note that builtins matching the intrinsics
+that take token as the first parameter (llvm.coro.begin, llvm.coro.alloc,
+llvm.coro.free and llvm.coro.suspend) omit the token parameter and fill it to
+an appropriate value during the emission.</p>
+<p><strong>Syntax</strong>:</p>
+<div class="highlight-c"><div class="highlight"><pre><span></span><span class="kt">size_t</span> <span class="n">__builtin_coro_size</span><span class="p">()</span>
+<span class="kt">void</span>  <span class="o">*</span><span class="n">__builtin_coro_frame</span><span class="p">()</span>
+<span class="kt">void</span>  <span class="o">*</span><span class="n">__builtin_coro_free</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">coro_frame</span><span class="p">)</span>
+
+<span class="kt">void</span>  <span class="o">*</span><span class="n">__builtin_coro_id</span><span class="p">(</span><span class="kt">int</span> <span class="n">align</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">promise</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">fnaddr</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">parts</span><span class="p">)</span>
+<span class="kt">bool</span>   <span class="n">__builtin_coro_alloc</span><span class="p">()</span>
+<span class="kt">void</span>  <span class="o">*</span><span class="n">__builtin_coro_begin</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">memory</span><span class="p">)</span>
+<span class="kt">void</span>   <span class="n">__builtin_coro_end</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">coro_frame</span><span class="p">,</span> <span class="kt">bool</span> <span class="n">unwind</span><span class="p">)</span>
+<span class="kt">char</span>   <span class="n">__builtin_coro_suspend</span><span class="p">(</span><span class="kt">bool</span> <span class="n">final</span><span class="p">)</span>
+<span class="kt">bool</span>   <span class="n">__builtin_coro_param</span><span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="n">original</span><span class="p">,</span> <span class="kt">void</span> <span class="o">*</span><span class="n">copy</span><span class="p">)</span>
+</pre></div>
+</div>
+<p>Note that there is no builtin matching the <cite>llvm.coro.save</cite> intrinsic. LLVM
+automatically will insert one if the first argument to <cite>llvm.coro.suspend</cite> is
+token <cite>none</cite>. If a user calls <cite>__builin_suspend</cite>, clang will insert <cite>token none</cite>
+as the first argument to the intrinsic.</p>
+</div>
+</div>
+<div class="section" id="non-standard-c-11-attributes">
+<h2><a class="toc-backref" href="#id15">Non-standard C++11 Attributes</a><a class="headerlink" href="#non-standard-c-11-attributes" title="Permalink to this headline">¶</a></h2>
+<p>Clang’s non-standard C++11 attributes live in the <code class="docutils literal"><span class="pre">clang</span></code> attribute
+namespace.</p>
+<p>Clang supports GCC’s <code class="docutils literal"><span class="pre">gnu</span></code> attribute namespace. All GCC attributes which
+are accepted with the <code class="docutils literal"><span class="pre">__attribute__((foo))</span></code> syntax are also accepted as
+<code class="docutils literal"><span class="pre">[[gnu::foo]]</span></code>. This only extends to attributes which are specified by GCC
+(see the list of <a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html">GCC function attributes</a>, <a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html">GCC variable
+attributes</a>, and
+<a class="reference external" href="http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html">GCC type attributes</a>). As with the GCC
+implementation, these attributes must appertain to the <em>declarator-id</em> in a
+declaration, which means they must go either at the start of the declaration or
+immediately after the name being declared.</p>
+<p>For example, this applies the GNU <code class="docutils literal"><span class="pre">unused</span></code> attribute to <code class="docutils literal"><span class="pre">a</span></code> and <code class="docutils literal"><span class="pre">f</span></code>, and
+also applies the GNU <code class="docutils literal"><span class="pre">noreturn</span></code> attribute to <code class="docutils literal"><span class="pre">f</span></code>.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">gnu</span><span class="o">::</span><span class="n">unused</span><span class="p">]]</span> <span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="n">f</span> <span class="p">[[</span><span class="n">gnu</span><span class="o">::</span><span class="n">noreturn</span><span class="p">]]</span> <span class="p">();</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="target-specific-extensions">
+<h2><a class="toc-backref" href="#id16">Target-Specific Extensions</a><a class="headerlink" href="#target-specific-extensions" title="Permalink to this headline">¶</a></h2>
+<p>Clang supports some language features conditionally on some targets.</p>
+<div class="section" id="arm-aarch64-language-extensions">
+<h3>ARM/AArch64 Language Extensions<a class="headerlink" href="#arm-aarch64-language-extensions" title="Permalink to this headline">¶</a></h3>
+<div class="section" id="memory-barrier-intrinsics">
+<h4>Memory Barrier Intrinsics<a class="headerlink" href="#memory-barrier-intrinsics" title="Permalink to this headline">¶</a></h4>
+<p>Clang implements the <code class="docutils literal"><span class="pre">__dmb</span></code>, <code class="docutils literal"><span class="pre">__dsb</span></code> and <code class="docutils literal"><span class="pre">__isb</span></code> intrinsics as defined
+in the <a class="reference external" href="http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053c/IHI0053C_acle_2_0.pdf">ARM C Language Extensions Release 2.0</a>.
+Note that these intrinsics are implemented as motion barriers that block
+reordering of memory accesses and side effect instructions. Other instructions
+like simple arithmetic may be reordered around the intrinsic. If you expect to
+have no reordering at all, use inline assembly instead.</p>
+</div>
+</div>
+<div class="section" id="x86-x86-64-language-extensions">
+<h3>X86/X86-64 Language Extensions<a class="headerlink" href="#x86-x86-64-language-extensions" title="Permalink to this headline">¶</a></h3>
+<p>The X86 backend has these language extensions:</p>
+<div class="section" id="memory-references-to-specified-segments">
+<h4>Memory references to specified segments<a class="headerlink" href="#memory-references-to-specified-segments" title="Permalink to this headline">¶</a></h4>
+<p>Annotating a pointer with address space #256 causes it to be code generated
+relative to the X86 GS segment register, address space #257 causes it to be
+relative to the X86 FS segment, and address space #258 causes it to be
+relative to the X86 SS segment.  Note that this is a very very low-level
+feature that should only be used if you know what you’re doing (for example in
+an OS kernel).</p>
+<p>Here is an example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#define GS_RELATIVE __attribute__((address_space(256)))</span>
+<span class="kt">int</span> <span class="nf">foo</span><span class="p">(</span><span class="kt">int</span> <span class="n">GS_RELATIVE</span> <span class="o">*</span><span class="n">P</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="o">*</span><span class="n">P</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Which compiles to (on X86-32):</p>
+<div class="highlight-gas"><div class="highlight"><pre><span></span><span class="nl">_foo:</span>
+        <span class="nf">movl</span>    <span class="mi">4</span><span class="p">(</span><span class="nv">%esp</span><span class="p">),</span> <span class="nv">%eax</span>
+        <span class="nf">movl</span>    <span class="nv">%gs</span><span class="p">:(</span><span class="nv">%eax</span><span class="p">),</span> <span class="nv">%eax</span>
+        <span class="nf">ret</span>
+</pre></div>
+</div>
+</div>
+</div>
+</div>
+<div class="section" id="extensions-for-static-analysis">
+<h2><a class="toc-backref" href="#id17">Extensions for Static Analysis</a><a class="headerlink" href="#extensions-for-static-analysis" title="Permalink to this headline">¶</a></h2>
+<p>Clang supports additional attributes that are useful for documenting program
+invariants and rules for static analysis tools, such as the <a class="reference external" href="http://clang-analyzer.llvm.org/">Clang Static
+Analyzer</a>. These attributes are documented
+in the analyzer’s <a class="reference external" href="http://clang-analyzer.llvm.org/annotations.html">list of source-level annotations</a>.</p>
+</div>
+<div class="section" id="extensions-for-dynamic-analysis">
+<h2><a class="toc-backref" href="#id18">Extensions for Dynamic Analysis</a><a class="headerlink" href="#extensions-for-dynamic-analysis" title="Permalink to this headline">¶</a></h2>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(address_sanitizer)</span></code> to check if the code is being built
+with <a class="reference internal" href="AddressSanitizer.html"><span class="doc">AddressSanitizer</span></a>.</p>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(thread_sanitizer)</span></code> to check if the code is being built
+with <a class="reference internal" href="ThreadSanitizer.html"><span class="doc">ThreadSanitizer</span></a>.</p>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(memory_sanitizer)</span></code> to check if the code is being built
+with <a class="reference internal" href="MemorySanitizer.html"><span class="doc">MemorySanitizer</span></a>.</p>
+<p>Use <code class="docutils literal"><span class="pre">__has_feature(safe_stack)</span></code> to check if the code is being built
+with <a class="reference internal" href="SafeStack.html"><span class="doc">SafeStack</span></a>.</p>
+</div>
+<div class="section" id="extensions-for-selectively-disabling-optimization">
+<h2><a class="toc-backref" href="#id19">Extensions for selectively disabling optimization</a><a class="headerlink" href="#extensions-for-selectively-disabling-optimization" title="Permalink to this headline">¶</a></h2>
+<p>Clang provides a mechanism for selectively disabling optimizations in functions
+and methods.</p>
+<p>To disable optimizations in a single function definition, the GNU-style or C++11
+non-standard attribute <code class="docutils literal"><span class="pre">optnone</span></code> can be used.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="c1">// The following functions will not be optimized.</span>
+<span class="c1">// GNU-style attribute</span>
+<span class="n">__attribute__</span><span class="p">((</span><span class="n">optnone</span><span class="p">))</span> <span class="kt">int</span> <span class="n">foo</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// ... code</span>
+<span class="p">}</span>
+<span class="c1">// C++11 attribute</span>
+<span class="p">[[</span><span class="n">clang</span><span class="o">::</span><span class="n">optnone</span><span class="p">]]</span> <span class="kt">int</span> <span class="n">bar</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// ... code</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>To facilitate disabling optimization for a range of function definitions, a
+range-based pragma is provided. Its syntax is <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">optimize</span></code>
+followed by <code class="docutils literal"><span class="pre">off</span></code> or <code class="docutils literal"><span class="pre">on</span></code>.</p>
+<p>All function definitions in the region between an <code class="docutils literal"><span class="pre">off</span></code> and the following
+<code class="docutils literal"><span class="pre">on</span></code> will be decorated with the <code class="docutils literal"><span class="pre">optnone</span></code> attribute unless doing so would
+conflict with explicit attributes already present on the function (e.g. the
+ones that control inlining).</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang optimize off</span>
+<span class="c1">// This function will be decorated with optnone.</span>
+<span class="kt">int</span> <span class="nf">foo</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// ... code</span>
+<span class="p">}</span>
+
+<span class="c1">// optnone conflicts with always_inline, so bar() will not be decorated.</span>
+<span class="n">__attribute__</span><span class="p">((</span><span class="n">always_inline</span><span class="p">))</span> <span class="kt">int</span> <span class="n">bar</span><span class="p">()</span> <span class="p">{</span>
+  <span class="c1">// ... code</span>
+<span class="p">}</span>
+<span class="cp">#pragma clang optimize on</span>
+</pre></div>
+</div>
+<p>If no <code class="docutils literal"><span class="pre">on</span></code> is found to close an <code class="docutils literal"><span class="pre">off</span></code> region, the end of the region is the
+end of the compilation unit.</p>
+<p>Note that a stray <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">optimize</span> <span class="pre">on</span></code> does not selectively enable
+additional optimizations when compiling at low optimization levels. This feature
+can only be used to selectively disable optimizations.</p>
+<p>The pragma has an effect on functions only at the point of their definition; for
+function templates, this means that the state of the pragma at the point of an
+instantiation is not necessarily relevant. Consider the following example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="o">></span> <span class="n">T</span> <span class="n">twice</span><span class="p">(</span><span class="n">T</span> <span class="n">t</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">t</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="cp">#pragma clang optimize off</span>
+<span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">T</span><span class="o">></span> <span class="n">T</span> <span class="n">thrice</span><span class="p">(</span><span class="n">T</span> <span class="n">t</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="mi">3</span> <span class="o">*</span> <span class="n">t</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="n">container</span><span class="p">(</span><span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="kt">int</span> <span class="n">b</span><span class="p">)</span> <span class="p">{</span>
+  <span class="k">return</span> <span class="n">twice</span><span class="p">(</span><span class="n">a</span><span class="p">)</span> <span class="o">+</span> <span class="n">thrice</span><span class="p">(</span><span class="n">b</span><span class="p">);</span>
+<span class="p">}</span>
+<span class="cp">#pragma clang optimize on</span>
+</pre></div>
+</div>
+<p>In this example, the definition of the template function <code class="docutils literal"><span class="pre">twice</span></code> is outside
+the pragma region, whereas the definition of <code class="docutils literal"><span class="pre">thrice</span></code> is inside the region.
+The <code class="docutils literal"><span class="pre">container</span></code> function is also in the region and will not be optimized, but
+it causes the instantiation of <code class="docutils literal"><span class="pre">twice</span></code> and <code class="docutils literal"><span class="pre">thrice</span></code> with an <code class="docutils literal"><span class="pre">int</span></code> type; of
+these two instantiations, <code class="docutils literal"><span class="pre">twice</span></code> will be optimized (because its definition
+was outside the region) and <code class="docutils literal"><span class="pre">thrice</span></code> will not be optimized.</p>
+</div>
+<div class="section" id="extensions-for-loop-hint-optimizations">
+<h2><a class="toc-backref" href="#id20">Extensions for loop hint optimizations</a><a class="headerlink" href="#extensions-for-loop-hint-optimizations" title="Permalink to this headline">¶</a></h2>
+<p>The <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">loop</span></code> directive is used to specify hints for optimizing the
+subsequent for, while, do-while, or c++11 range-based for loop. The directive
+provides options for vectorization, interleaving, unrolling and
+distribution. Loop hints can be specified before any loop and will be ignored if
+the optimization is not safe to apply.</p>
+<div class="section" id="vectorization-and-interleaving">
+<h3>Vectorization and Interleaving<a class="headerlink" href="#vectorization-and-interleaving" title="Permalink to this headline">¶</a></h3>
+<p>A vectorized loop performs multiple iterations of the original loop
+in parallel using vector instructions. The instruction set of the target
+processor determines which vector instructions are available and their vector
+widths. This restricts the types of loops that can be vectorized. The vectorizer
+automatically determines if the loop is safe and profitable to vectorize. A
+vector instruction cost model is used to select the vector width.</p>
+<p>Interleaving multiple loop iterations allows modern processors to further
+improve instruction-level parallelism (ILP) using advanced hardware features,
+such as multiple execution units and out-of-order execution. The vectorizer uses
+a cost model that depends on the register pressure and generated code size to
+select the interleaving count.</p>
+<p>Vectorization is enabled by <code class="docutils literal"><span class="pre">vectorize(enable)</span></code> and interleaving is enabled
+by <code class="docutils literal"><span class="pre">interleave(enable)</span></code>. This is useful when compiling with <code class="docutils literal"><span class="pre">-Os</span></code> to
+manually enable vectorization or interleaving.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang loop vectorize(enable)</span>
+<span class="cp">#pragma clang loop interleave(enable)</span>
+<span class="k">for</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The vector width is specified by <code class="docutils literal"><span class="pre">vectorize_width(_value_)</span></code> and the interleave
+count is specified by <code class="docutils literal"><span class="pre">interleave_count(_value_)</span></code>, where
+_value_ is a positive integer. This is useful for specifying the optimal
+width/count of the set of target architectures supported by your application.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang loop vectorize_width(2)</span>
+<span class="cp">#pragma clang loop interleave_count(2)</span>
+<span class="k">for</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Specifying a width/count of 1 disables the optimization, and is equivalent to
+<code class="docutils literal"><span class="pre">vectorize(disable)</span></code> or <code class="docutils literal"><span class="pre">interleave(disable)</span></code>.</p>
+</div>
+<div class="section" id="loop-unrolling">
+<h3>Loop Unrolling<a class="headerlink" href="#loop-unrolling" title="Permalink to this headline">¶</a></h3>
+<p>Unrolling a loop reduces the loop control overhead and exposes more
+opportunities for ILP. Loops can be fully or partially unrolled. Full unrolling
+eliminates the loop and replaces it with an enumerated sequence of loop
+iterations. Full unrolling is only possible if the loop trip count is known at
+compile time. Partial unrolling replicates the loop body within the loop and
+reduces the trip count.</p>
+<p>If <code class="docutils literal"><span class="pre">unroll(enable)</span></code> is specified the unroller will attempt to fully unroll the
+loop if the trip count is known at compile time. If the fully unrolled code size
+is greater than an internal limit the loop will be partially unrolled up to this
+limit. If the trip count is not known at compile time the loop will be partially
+unrolled with a heuristically chosen unroll factor.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang loop unroll(enable)</span>
+<span class="k">for</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>If <code class="docutils literal"><span class="pre">unroll(full)</span></code> is specified the unroller will attempt to fully unroll the
+loop if the trip count is known at compile time identically to
+<code class="docutils literal"><span class="pre">unroll(enable)</span></code>. However, with <code class="docutils literal"><span class="pre">unroll(full)</span></code> the loop will not be unrolled
+if the loop count is not known at compile time.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang loop unroll(full)</span>
+<span class="k">for</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The unroll count can be specified explicitly with <code class="docutils literal"><span class="pre">unroll_count(_value_)</span></code> where
+_value_ is a positive integer. If this value is greater than the trip count the
+loop will be fully unrolled. Otherwise the loop is partially unrolled subject
+to the same code size limit as with <code class="docutils literal"><span class="pre">unroll(enable)</span></code>.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang loop unroll_count(8)</span>
+<span class="k">for</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Unrolling of a loop can be prevented by specifying <code class="docutils literal"><span class="pre">unroll(disable)</span></code>.</p>
+</div>
+<div class="section" id="loop-distribution">
+<h3>Loop Distribution<a class="headerlink" href="#loop-distribution" title="Permalink to this headline">¶</a></h3>
+<p>Loop Distribution allows splitting a loop into multiple loops.  This is
+beneficial for example when the entire loop cannot be vectorized but some of the
+resulting loops can.</p>
+<p>If <code class="docutils literal"><span class="pre">distribute(enable))</span></code> is specified and the loop has memory dependencies
+that inhibit vectorization, the compiler will attempt to isolate the offending
+operations into a new loop.  This optimization is not enabled by default, only
+loops marked with the pragma are considered.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang loop distribute(enable)</span>
+<span class="k">for</span> <span class="p">(</span><span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">N</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+  <span class="nl">S1</span><span class="p">:</span> <span class="n">A</span><span class="p">[</span><span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">A</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">+</span> <span class="n">B</span><span class="p">[</span><span class="n">i</span><span class="p">];</span>
+  <span class="nl">S2</span><span class="p">:</span> <span class="n">C</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">D</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">*</span> <span class="n">E</span><span class="p">[</span><span class="n">i</span><span class="p">];</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>This loop will be split into two loops between statements S1 and S2.  The
+second loop containing S2 will be vectorized.</p>
+<p>Loop Distribution is currently not enabled by default in the optimizer because
+it can hurt performance in some cases.  For example, instruction-level
+parallelism could be reduced by sequentializing the execution of the
+statements S1 and S2 above.</p>
+<p>If Loop Distribution is turned on globally with
+<code class="docutils literal"><span class="pre">-mllvm</span> <span class="pre">-enable-loop-distribution</span></code>, specifying <code class="docutils literal"><span class="pre">distribute(disable)</span></code> can
+be used the disable it on a per-loop basis.</p>
+</div>
+<div class="section" id="additional-information">
+<h3>Additional Information<a class="headerlink" href="#additional-information" title="Permalink to this headline">¶</a></h3>
+<p>For convenience multiple loop hints can be specified on a single line.</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang loop vectorize_width(4) interleave_count(8)</span>
+<span class="k">for</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>If an optimization cannot be applied any hints that apply to it will be ignored.
+For example, the hint <code class="docutils literal"><span class="pre">vectorize_width(4)</span></code> is ignored if the loop is not
+proven safe to vectorize. To identify and diagnose optimization issues use
+<cite>-Rpass</cite>, <cite>-Rpass-missed</cite>, and <cite>-Rpass-analysis</cite> command line options. See the
+user guide for details.</p>
+</div>
+</div>
+<div class="section" id="extensions-to-specify-floating-point-flags">
+<h2><a class="toc-backref" href="#id21">Extensions to specify floating-point flags</a><a class="headerlink" href="#extensions-to-specify-floating-point-flags" title="Permalink to this headline">¶</a></h2>
+<p>The <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">fp</span></code> pragma allows floating-point options to be specified
+for a section of the source code. This pragma can only appear at file scope or
+at the start of a compound statement (excluding comments). When using within a
+compound statement, the pragma is active within the scope of the compound
+statement.</p>
+<p>Currently, only FP contraction can be controlled with the pragma. <code class="docutils literal"><span class="pre">#pragma</span>
+<span class="pre">clang</span> <span class="pre">fp</span> <span class="pre">contract</span></code> specifies whether the compiler should contract a multiply
+and an addition (or subtraction) into a fused FMA operation when supported by
+the target.</p>
+<p>The pragma can take three values: <code class="docutils literal"><span class="pre">on</span></code>, <code class="docutils literal"><span class="pre">fast</span></code> and <code class="docutils literal"><span class="pre">off</span></code>.  The <code class="docutils literal"><span class="pre">on</span></code>
+option is identical to using <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">STDC</span> <span class="pre">FP_CONTRACT(ON)</span></code> and it allows
+fusion as specified the language standard.  The <code class="docutils literal"><span class="pre">fast</span></code> option allows fusiong
+in cases when the language standard does not make this possible (e.g. across
+statements in C)</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">for</span><span class="p">(...)</span> <span class="p">{</span>
+  <span class="cp">#pragma clang fp contract(fast)</span>
+  <span class="n">a</span> <span class="o">=</span> <span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">*</span> <span class="n">c</span><span class="p">[</span><span class="n">i</span><span class="p">];</span>
+  <span class="n">d</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">+=</span> <span class="n">a</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The pragma can also be used with <code class="docutils literal"><span class="pre">off</span></code> which turns FP contraction off for a
+section of the code. This can be useful when fast contraction is otherwise
+enabled for the translation unit with the <code class="docutils literal"><span class="pre">-ffp-contract=fast</span></code> flag.</p>
+</div>
+<div class="section" id="specifying-an-attribute-for-multiple-declarations-pragma-clang-attribute">
+<h2><a class="toc-backref" href="#id22">Specifying an attribute for multiple declarations (#pragma clang attribute)</a><a class="headerlink" href="#specifying-an-attribute-for-multiple-declarations-pragma-clang-attribute" title="Permalink to this headline">¶</a></h2>
+<p>The <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">attribute</span></code> directive can be used to apply an attribute to
+multiple declarations. The <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">attribute</span> <span class="pre">push</span></code> variation of the
+directive pushes a new attribute to the attribute stack. The declarations that
+follow the pragma receive the attributes that are on the attribute stack, until
+the stack is cleared using a <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">attribute</span> <span class="pre">pop</span></code> directive. Multiple
+push directives can be nested inside each other.</p>
+<p>The attributes that are used in the <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">attribute</span></code> directives
+can be written using the GNU-style syntax:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang attribute push(__attribute__((annotate("custom"))), apply_to = function)</span>
+
+<span class="kt">void</span> <span class="nf">function</span><span class="p">();</span> <span class="c1">// The function now has the annotate("custom") attribute</span>
+
+<span class="cp">#pragma clang attribute pop</span>
+</pre></div>
+</div>
+<p>The attributes can also be written using the C++11 style syntax:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang attribute push([[noreturn]], apply_to = function)</span>
+
+<span class="kt">void</span> <span class="nf">function</span><span class="p">();</span> <span class="c1">// The function now has the [[noreturn]] attribute</span>
+
+<span class="cp">#pragma clang attribute pop</span>
+</pre></div>
+</div>
+<p>The <code class="docutils literal"><span class="pre">__declspec</span></code> style syntax is also supported:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang attribute push(__declspec(dllexport), apply_to = function)</span>
+
+<span class="kt">void</span> <span class="nf">function</span><span class="p">();</span> <span class="c1">// The function now has the __declspec(dllexport) attribute</span>
+
+<span class="cp">#pragma clang attribute pop</span>
+</pre></div>
+</div>
+<p>A single push directive accepts only one attribute regardless of the syntax
+used.</p>
+<div class="section" id="subject-match-rules">
+<h3>Subject Match Rules<a class="headerlink" href="#subject-match-rules" title="Permalink to this headline">¶</a></h3>
+<p>The set of declarations that receive a single attribute from the attribute stack
+depends on the subject match rules that were specified in the pragma. Subject
+match rules are specified after the attribute. The compiler expects an
+identifier that corresponds to the subject set specifier. The <code class="docutils literal"><span class="pre">apply_to</span></code>
+specifier is currently the only supported subject set specifier. It allows you
+to specify match rules that form a subset of the attribute’s allowed subject
+set, i.e. the compiler doesn’t require all of the attribute’s subjects. For
+example, an attribute like <code class="docutils literal"><span class="pre">[[nodiscard]]</span></code> whose subject set includes
+<code class="docutils literal"><span class="pre">enum</span></code>, <code class="docutils literal"><span class="pre">record</span></code> and <code class="docutils literal"><span class="pre">hasType(functionType)</span></code>, requires the presence of at
+least one of these rules after <code class="docutils literal"><span class="pre">apply_to</span></code>:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang attribute push([[nodiscard]], apply_to = enum)</span>
+
+<span class="k">enum</span> <span class="n">Enum1</span> <span class="p">{</span> <span class="n">A1</span><span class="p">,</span> <span class="n">B1</span> <span class="p">};</span> <span class="c1">// The enum will receive [[nodiscard]]</span>
+
+<span class="k">struct</span> <span class="n">Record1</span> <span class="p">{</span> <span class="p">};</span> <span class="c1">// The struct will *not* receive [[nodiscard]]</span>
+
+<span class="cp">#pragma clang attribute pop</span>
+
+<span class="cp">#pragma clang attribute push([[nodiscard]], apply_to = any(record, enum))</span>
+
+<span class="k">enum</span> <span class="n">Enum2</span> <span class="p">{</span> <span class="n">A2</span><span class="p">,</span> <span class="n">B2</span> <span class="p">};</span> <span class="c1">// The enum will receive [[nodiscard]]</span>
+
+<span class="k">struct</span> <span class="n">Record2</span> <span class="p">{</span> <span class="p">};</span> <span class="c1">// The struct *will* receive [[nodiscard]]</span>
+
+<span class="cp">#pragma clang attribute pop</span>
+
+<span class="c1">// This is an error, since [[nodiscard]] can't be applied to namespaces:</span>
+<span class="cp">#pragma clang attribute push([[nodiscard]], apply_to = any(record, namespace))</span>
+
+<span class="cp">#pragma clang attribute pop</span>
+</pre></div>
+</div>
+<p>Multiple match rules can be specified using the <code class="docutils literal"><span class="pre">any</span></code> match rule, as shown
+in the example above. The <code class="docutils literal"><span class="pre">any</span></code> rule applies attributes to all declarations
+that are matched by at least one of the rules in the <code class="docutils literal"><span class="pre">any</span></code>. It doesn’t nest
+and can’t be used inside the other match rules. Redundant match rules or rules
+that conflict with one another should not be used inside of <code class="docutils literal"><span class="pre">any</span></code>.</p>
+<p>Clang supports the following match rules:</p>
+<ul class="simple">
+<li><code class="docutils literal"><span class="pre">function</span></code>: Can be used to apply attributes to functions. This includes C++
+member functions, static functions, operators, and constructors/destructors.</li>
+<li><code class="docutils literal"><span class="pre">function(is_member)</span></code>: Can be used to apply attributes to C++ member
+functions. This includes members like static functions, operators, and
+constructors/destructors.</li>
+<li><code class="docutils literal"><span class="pre">hasType(functionType)</span></code>: Can be used to apply attributes to functions, C++
+member functions, and variables/fields whose type is a function pointer. It
+does not apply attributes to Objective-C methods or blocks.</li>
+<li><code class="docutils literal"><span class="pre">type_alias</span></code>: Can be used to apply attributes to <code class="docutils literal"><span class="pre">typedef</span></code> declarations
+and C++11 type aliases.</li>
+<li><code class="docutils literal"><span class="pre">record</span></code>: Can be used to apply attributes to <code class="docutils literal"><span class="pre">struct</span></code>, <code class="docutils literal"><span class="pre">class</span></code>, and
+<code class="docutils literal"><span class="pre">union</span></code> declarations.</li>
+<li><code class="docutils literal"><span class="pre">record(unless(is_union))</span></code>: Can be used to apply attributes only to
+<code class="docutils literal"><span class="pre">struct</span></code> and <code class="docutils literal"><span class="pre">class</span></code> declarations.</li>
+<li><code class="docutils literal"><span class="pre">enum</span></code>: Can be be used to apply attributes to enumeration declarations.</li>
+<li><code class="docutils literal"><span class="pre">enum_constant</span></code>: Can be used to apply attributes to enumerators.</li>
+<li><code class="docutils literal"><span class="pre">variable</span></code>: Can be used to apply attributes to variables, including
+local variables, parameters, global variables, and static member variables.
+It does not apply attributes to instance member variables or Objective-C
+ivars.</li>
+<li><code class="docutils literal"><span class="pre">variable(is_thread_local)</span></code>: Can be used to apply attributes to thread-local
+variables only.</li>
+<li><code class="docutils literal"><span class="pre">variable(is_global)</span></code>: Can be used to apply attributes to global variables
+only.</li>
+<li><code class="docutils literal"><span class="pre">variable(is_parameter)</span></code>: Can be used to apply attributes to parameters
+only.</li>
+<li><code class="docutils literal"><span class="pre">variable(unless(is_parameter))</span></code>: Can be used to apply attributes to all
+the variables that are not parameters.</li>
+<li><code class="docutils literal"><span class="pre">field</span></code>: Can be used to apply attributes to non-static member variables
+in a record. This includes Objective-C ivars.</li>
+<li><code class="docutils literal"><span class="pre">namespace</span></code>: Can be used to apply attributes to <code class="docutils literal"><span class="pre">namespace</span></code> declarations.</li>
+<li><code class="docutils literal"><span class="pre">objc_interface</span></code>: Can be used to apply attributes to <code class="docutils literal"><span class="pre">@interface</span></code>
+declarations.</li>
+<li><code class="docutils literal"><span class="pre">objc_protocol</span></code>: Can be used to apply attributes to <code class="docutils literal"><span class="pre">@protocol</span></code>
+declarations.</li>
+<li><code class="docutils literal"><span class="pre">objc_category</span></code>: Can be used to apply attributes to category declarations,
+including class extensions.</li>
+<li><code class="docutils literal"><span class="pre">objc_method</span></code>: Can be used to apply attributes to Objective-C methods,
+including instance and class methods. Implicit methods like implicit property
+getters and setters do not receive the attribute.</li>
+<li><code class="docutils literal"><span class="pre">objc_method(is_instance)</span></code>: Can be used to apply attributes to Objective-C
+instance methods.</li>
+<li><code class="docutils literal"><span class="pre">objc_property</span></code>: Can be used to apply attributes to <code class="docutils literal"><span class="pre">@property</span></code>
+declarations.</li>
+<li><code class="docutils literal"><span class="pre">block</span></code>: Can be used to apply attributes to block declarations. This does
+not include variables/fields of block pointer type.</li>
+</ul>
+<p>The use of <code class="docutils literal"><span class="pre">unless</span></code> in match rules is currently restricted to a strict set of
+sub-rules that are used by the supported attributes. That means that even though
+<code class="docutils literal"><span class="pre">variable(unless(is_parameter))</span></code> is a valid match rule,
+<code class="docutils literal"><span class="pre">variable(unless(is_thread_local))</span></code> is not.</p>
+</div>
+<div class="section" id="supported-attributes">
+<h3>Supported Attributes<a class="headerlink" href="#supported-attributes" title="Permalink to this headline">¶</a></h3>
+<p>Not all attributes can be used with the <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">attribute</span></code> directive.
+Notably, statement attributes like <code class="docutils literal"><span class="pre">[[fallthrough]]</span></code> or type attributes
+like <code class="docutils literal"><span class="pre">address_space</span></code> aren’t supported by this directive. You can determine
+whether or not an attribute is supported by the pragma by referring to the
+<a class="reference internal" href="AttributeReference.html"><span class="doc">individual documentation for that attribute</span></a>.</p>
+<p>The attributes are applied to all matching declarations individually, even when
+the attribute is semantically incorrect. The attributes that aren’t applied to
+any declaration are not verified semantically.</p>
+</div>
+</div>
+<div class="section" id="specifying-section-names-for-global-objects-pragma-clang-section">
+<h2><a class="toc-backref" href="#id23">Specifying section names for global objects (#pragma clang section)</a><a class="headerlink" href="#specifying-section-names-for-global-objects-pragma-clang-section" title="Permalink to this headline">¶</a></h2>
+<p>The <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">section</span></code> directive provides a means to assign section-names
+to global variables, functions and static variables.</p>
+<p>The section names can be specified as:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang section bss="myBSS" data="myData" rodata="myRodata" text="myText"</span>
+</pre></div>
+</div>
+<p>The section names can be reverted back to default name by supplying an empty
+string to the section kind, for example:</p>
+<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="cp">#pragma clang section bss="" data="" text="" rodata=""</span>
+</pre></div>
+</div>
+<p>The <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">section</span></code> directive obeys the following rules:</p>
+<ul class="simple">
+<li>The pragma applies to all global variable, statics and function declarations
+from the pragma to the end of the translation unit.</li>
+<li>The pragma clang section is enabled automatically, without need of any flags.</li>
+<li>This feature is only defined to work sensibly for ELF targets.</li>
+<li>If section name is specified through _attribute_((section(“myname”))), then
+the attribute name gains precedence.</li>
+<li>Global variables that are initialized to zero will be placed in the named
+bss section, if one is present.</li>
+<li>The <code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">section</span></code> directive does not does try to infer section-kind
+from the name. For example, naming a section “<code class="docutils literal"><span class="pre">.bss.mySec</span></code>” does NOT mean
+it will be a bss section name.</li>
+<li>The decision about which section-kind applies to each global is taken in the back-end.
+Once the section-kind is known, appropriate section name, as specified by the user using
+<code class="docutils literal"><span class="pre">#pragma</span> <span class="pre">clang</span> <span class="pre">section</span></code> directive, is applied to that global.</li>
+</ul>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav" role="navigation" aria-label="bottom navigation">
+      
+        <p>
+        «  <a href="Toolchain.html">Assembling a Complete Toolchain</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="ObjectiveCLiterals.html">Objective-C Literals</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer" role="contentinfo">
+        © Copyright 2007-2017, The Clang Team.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/5.0.1/tools/clang/docs/LeakSanitizer.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/5.0.1/tools/clang/docs/LeakSanitizer.html?rev=321287&view=auto
==============================================================================
--- www-releases/trunk/5.0.1/tools/clang/docs/LeakSanitizer.html (added)
+++ www-releases/trunk/5.0.1/tools/clang/docs/LeakSanitizer.html Thu Dec 21 10:09:53 2017
@@ -0,0 +1,117 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>LeakSanitizer — Clang 5 documentation</title>
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="SanitizerCoverage" href="SanitizerCoverage.html" />
+    <link rel="prev" title="DataFlowSanitizer Design Document" href="DataFlowSanitizerDesign.html" /> 
+  </head>
+  <body>
+      <div class="header" role="banner"><h1 class="heading"><a href="index.html">
+          <span>Clang 5 documentation</span></a></h1>
+        <h2 class="heading"><span>LeakSanitizer</span></h2>
+      </div>
+      <div class="topnav" role="navigation" aria-label="top navigation">
+      
+        <p>
+        «  <a href="DataFlowSanitizerDesign.html">DataFlowSanitizer Design Document</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="SanitizerCoverage.html">SanitizerCoverage</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="leaksanitizer">
+<h1>LeakSanitizer<a class="headerlink" href="#leaksanitizer" title="Permalink to this headline">¶</a></h1>
+<div class="contents local topic" id="contents">
+<ul class="simple">
+<li><a class="reference internal" href="#introduction" id="id1">Introduction</a></li>
+<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
+<li><a class="reference internal" href="#more-information" id="id3">More Information</a></li>
+</ul>
+</div>
+<div class="section" id="introduction">
+<h2><a class="toc-backref" href="#id1">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>LeakSanitizer is a run-time memory leak detector. It can be combined with
+<a class="reference internal" href="AddressSanitizer.html"><span class="doc">AddressSanitizer</span></a> to get both memory error and leak detection, or
+used in a stand-alone mode. LSan adds almost no performance overhead
+until the very end of the process, at which point there is an extra leak
+detection phase.</p>
+</div>
+<div class="section" id="usage">
+<h2><a class="toc-backref" href="#id2">Usage</a><a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
+<p>LeakSanitizer is only supported on x86_64 Linux. In order to use it,
+simply build your program with <a class="reference internal" href="AddressSanitizer.html"><span class="doc">AddressSanitizer</span></a>:</p>
+<div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> cat memory-leak.c
+<span class="gp">#</span>include <stdlib.h>
+<span class="go">void *p;</span>
+<span class="go">int main() {</span>
+<span class="go">  p = malloc(7);</span>
+<span class="go">  p = 0; // The memory is leaked here.</span>
+<span class="go">  return 0;</span>
+<span class="go">}</span>
+<span class="gp">%</span> clang -fsanitize<span class="o">=</span>address -g memory-leak.c <span class="p">;</span> ./a.out
+<span class="go">==23646==ERROR: LeakSanitizer: detected memory leaks</span>
+<span class="go">Direct leak of 7 byte(s) in 1 object(s) allocated from:</span>
+<span class="gp">    #</span><span class="m">0</span> 0x4af01b in __interceptor_malloc /projects/compiler-rt/lib/asan/asan_malloc_linux.cc:52:3
+<span class="gp">    #</span><span class="m">1</span> 0x4da26a in main memory-leak.c:4:7
+<span class="gp">    #</span><span class="m">2</span> 0x7f076fd9cec4 in __libc_start_main libc-start.c:287
+<span class="go">SUMMARY: AddressSanitizer: 7 byte(s) leaked in 1 allocation(s).</span>
+</pre></div>
+</div>
+<p>To use LeakSanitizer in stand-alone mode, link your program with
+<code class="docutils literal"><span class="pre">-fsanitize=leak</span></code> flag. Make sure to use <code class="docutils literal"><span class="pre">clang</span></code> (not <code class="docutils literal"><span class="pre">ld</span></code>) for the
+link step, so that it would link in proper LeakSanitizer run-time library
+into the final executable.</p>
+</div>
+<div class="section" id="more-information">
+<h2><a class="toc-backref" href="#id3">More Information</a><a class="headerlink" href="#more-information" title="Permalink to this headline">¶</a></h2>
+<p><a class="reference external" href="https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer">https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer</a></p>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav" role="navigation" aria-label="bottom navigation">
+      
+        <p>
+        «  <a href="DataFlowSanitizerDesign.html">DataFlowSanitizer Design Document</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="SanitizerCoverage.html">SanitizerCoverage</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer" role="contentinfo">
+        © Copyright 2007-2017, The Clang Team.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/5.0.1/tools/clang/docs/LibASTMatchers.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/5.0.1/tools/clang/docs/LibASTMatchers.html?rev=321287&view=auto
==============================================================================
--- www-releases/trunk/5.0.1/tools/clang/docs/LibASTMatchers.html (added)
+++ www-releases/trunk/5.0.1/tools/clang/docs/LibASTMatchers.html Thu Dec 21 10:09:53 2017
@@ -0,0 +1,166 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Matching the Clang AST — Clang 5 documentation</title>
+    <link rel="stylesheet" href="_static/haiku.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     '5',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true,
+        SOURCELINK_SUFFIX: '.txt'
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="next" title="How To Setup Clang Tooling For LLVM" href="HowToSetupToolingForLLVM.html" />
+    <link rel="prev" title="Tutorial for building tools using LibTooling and LibASTMatchers" href="LibASTMatchersTutorial.html" /> 
+  </head>
+  <body>
+      <div class="header" role="banner"><h1 class="heading"><a href="index.html">
+          <span>Clang 5 documentation</span></a></h1>
+        <h2 class="heading"><span>Matching the Clang AST</span></h2>
+      </div>
+      <div class="topnav" role="navigation" aria-label="top navigation">
+      
+        <p>
+        «  <a href="LibASTMatchersTutorial.html">Tutorial for building tools using LibTooling and LibASTMatchers</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="HowToSetupToolingForLLVM.html">How To Setup Clang Tooling For LLVM</a>  Â»
+        </p>
+
+      </div>
+      <div class="content">
+        
+        
+  <div class="section" id="matching-the-clang-ast">
+<h1>Matching the Clang AST<a class="headerlink" href="#matching-the-clang-ast" title="Permalink to this headline">¶</a></h1>
+<p>This document explains how to use Clang’s LibASTMatchers to match interesting
+nodes of the AST and execute code that uses the matched nodes.  Combined with
+<a class="reference internal" href="LibTooling.html"><span class="doc">LibTooling</span></a>, LibASTMatchers helps to write code-to-code transformation
+tools or query tools.</p>
+<p>We assume basic knowledge about the Clang AST.  See the <a class="reference internal" href="IntroductionToTheClangAST.html"><span class="doc">Introduction
+to the Clang AST</span></a> if you want to learn more
+about how the AST is structured.</p>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p>LibASTMatchers provides a domain specific language to create predicates on
+Clang’s AST.  This DSL is written in and can be used from C++, allowing users
+to write a single program to both match AST nodes and access the node’s C++
+interface to extract attributes, source locations, or any other information
+provided on the AST level.</p>
+<p>AST matchers are predicates on nodes in the AST.  Matchers are created by
+calling creator functions that allow building up a tree of matchers, where
+inner matchers are used to make the match more specific.</p>
+<p>For example, to create a matcher that matches all class or union declarations
+in the AST of a translation unit, you can call <a class="reference external" href="LibASTMatchersReference.html#recordDecl0Anchor">recordDecl()</a>.  To narrow the match down,
+for example to find all class or union declarations with the name “<code class="docutils literal"><span class="pre">Foo</span></code>”,
+insert a <a class="reference external" href="LibASTMatchersReference.html#hasName0Anchor">hasName</a> matcher: the
+call <code class="docutils literal"><span class="pre">recordDecl(hasName("Foo"))</span></code> returns a matcher that matches classes or
+unions that are named “<code class="docutils literal"><span class="pre">Foo</span></code>”, in any namespace.  By default, matchers that
+accept multiple inner matchers use an implicit <a class="reference external" href="LibASTMatchersReference.html#allOf0Anchor">allOf()</a>.  This allows further narrowing
+down the match, for example to match all classes that are derived from
+“<code class="docutils literal"><span class="pre">Bar</span></code>”: <code class="docutils literal"><span class="pre">recordDecl(hasName("Foo"),</span> <span class="pre">isDerivedFrom("Bar"))</span></code>.</p>
+</div>
+<div class="section" id="how-to-create-a-matcher">
+<h2>How to create a matcher<a class="headerlink" href="#how-to-create-a-matcher" title="Permalink to this headline">¶</a></h2>
+<p>With more than a thousand classes in the Clang AST, one can quickly get lost
+when trying to figure out how to create a matcher for a specific pattern.  This
+section will teach you how to use a rigorous step-by-step pattern to build the
+matcher you are interested in.  Note that there will always be matchers missing
+for some part of the AST.  See the section about <a class="reference internal" href="#astmatchers-writing"><span class="std std-ref">how to write your own
+AST matchers</span></a> later in this document.</p>
+<p>The precondition to using the matchers is to understand how the AST for what you
+want to match looks like.  The
+<a class="reference internal" href="IntroductionToTheClangAST.html"><span class="doc">Introduction to the Clang AST</span></a> teaches you
+how to dump a translation unit’s AST into a human readable format.</p>
+<p>In general, the strategy to create the right matchers is:</p>
+<ol class="arabic simple">
+<li>Find the outermost class in Clang’s AST you want to match.</li>
+<li>Look at the <a class="reference external" href="LibASTMatchersReference.html">AST Matcher Reference</a> for
+matchers that either match the node you’re interested in or narrow down
+attributes on the node.</li>
+<li>Create your outer match expression.  Verify that it works as expected.</li>
+<li>Examine the matchers for what the next inner node you want to match is.</li>
+<li>Repeat until the matcher is finished.</li>
+</ol>
+</div>
+<div class="section" id="binding-nodes-in-match-expressions">
+<span id="astmatchers-bind"></span><h2>Binding nodes in match expressions<a class="headerlink" href="#binding-nodes-in-match-expressions" title="Permalink to this headline">¶</a></h2>
+<p>Matcher expressions allow you to specify which parts of the AST are interesting
+for a certain task.  Often you will want to then do something with the nodes
+that were matched, like building source code transformations.</p>
+<p>To that end, matchers that match specific AST nodes (so called node matchers)
+are bindable; for example, <code class="docutils literal"><span class="pre">recordDecl(hasName("MyClass")).bind("id")</span></code> will
+bind the matched <code class="docutils literal"><span class="pre">recordDecl</span></code> node to the string “<code class="docutils literal"><span class="pre">id</span></code>”, to be later
+retrieved in the <a class="reference external" href="http://clang.llvm.org/doxygen/classclang_1_1ast__matchers_1_1MatchFinder_1_1MatchCallback.html">match callback</a>.</p>
+</div>
+<div class="section" id="writing-your-own-matchers">
+<h2>Writing your own matchers<a class="headerlink" href="#writing-your-own-matchers" title="Permalink to this headline">¶</a></h2>
+<p>There are multiple different ways to define a matcher, depending on its type
+and flexibility.</p>
+<div class="section" id="variadicdyncastallofmatcher-base-derived">
+<h3><code class="docutils literal"><span class="pre">VariadicDynCastAllOfMatcher<Base,</span> <span class="pre">Derived></span></code><a class="headerlink" href="#variadicdyncastallofmatcher-base-derived" title="Permalink to this headline">¶</a></h3>
+<p>Those match all nodes of type <em>Base</em> if they can be dynamically casted to
+<em>Derived</em>.  The names of those matchers are nouns, which closely resemble
+<em>Derived</em>.  <code class="docutils literal"><span class="pre">VariadicDynCastAllOfMatchers</span></code> are the backbone of the matcher
+hierarchy.  Most often, your match expression will start with one of them, and
+you can <a class="reference internal" href="#astmatchers-bind"><span class="std std-ref">bind</span></a> the node they represent to ids for later
+processing.</p>
+<p><code class="docutils literal"><span class="pre">VariadicDynCastAllOfMatchers</span></code> are callable classes that model variadic
+template functions in C++03.  They take an arbitrary number of
+<code class="docutils literal"><span class="pre">Matcher<Derived></span></code> and return a <code class="docutils literal"><span class="pre">Matcher<Base></span></code>.</p>
+</div>
+<div class="section" id="ast-matcher-p-type-name-paramtype-param">
+<h3><code class="docutils literal"><span class="pre">AST_MATCHER_P(Type,</span> <span class="pre">Name,</span> <span class="pre">ParamType,</span> <span class="pre">Param)</span></code><a class="headerlink" href="#ast-matcher-p-type-name-paramtype-param" title="Permalink to this headline">¶</a></h3>
+<p>Most matcher definitions use the matcher creation macros.  Those define both
+the matcher of type <code class="docutils literal"><span class="pre">Matcher<Type></span></code> itself, and a matcher-creation function
+named <em>Name</em> that takes a parameter of type <em>ParamType</em> and returns the
+corresponding matcher.</p>
+<p>There are multiple matcher definition macros that deal with polymorphic return
+values and different parameter counts.  See <a class="reference external" href="http://clang.llvm.org/doxygen/ASTMatchersMacros_8h.html">ASTMatchersMacros.h</a>.</p>
+</div>
+<div class="section" id="matcher-creation-functions">
+<span id="astmatchers-writing"></span><h3>Matcher creation functions<a class="headerlink" href="#matcher-creation-functions" title="Permalink to this headline">¶</a></h3>
+<p>Matchers are generated by nesting calls to matcher creation functions.  Most of
+the time those functions are either created by using
+<code class="docutils literal"><span class="pre">VariadicDynCastAllOfMatcher</span></code> or the matcher creation macros (see below).
+The free-standing functions are an indication that this matcher is just a
+combination of other matchers, as is for example the case with <a class="reference external" href="LibASTMatchersReference.html#callee1Anchor">callee</a>.</p>
+</div>
+</div>
+</div>
+
+
+      </div>
+      <div class="bottomnav" role="navigation" aria-label="bottom navigation">
+      
+        <p>
+        «  <a href="LibASTMatchersTutorial.html">Tutorial for building tools using LibTooling and LibASTMatchers</a>
+          ::  
+        <a class="uplink" href="index.html">Contents</a>
+          ::  
+        <a href="HowToSetupToolingForLLVM.html">How To Setup Clang Tooling For LLVM</a>  Â»
+        </p>
+
+      </div>
+
+    <div class="footer" role="contentinfo">
+        © Copyright 2007-2017, The Clang Team.
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.5.
+    </div>
+  </body>
+</html>
\ No newline at end of file

Added: www-releases/trunk/5.0.1/tools/clang/docs/LibASTMatchersReference.html
URL: http://llvm.org/viewvc/llvm-project/www-releases/trunk/5.0.1/tools/clang/docs/LibASTMatchersReference.html?rev=321287&view=auto
==============================================================================
--- www-releases/trunk/5.0.1/tools/clang/docs/LibASTMatchersReference.html (added)
+++ www-releases/trunk/5.0.1/tools/clang/docs/LibASTMatchersReference.html Thu Dec 21 10:09:53 2017
@@ -0,0 +1,6059 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+          "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>AST Matcher Reference</title>
+<link type="text/css" rel="stylesheet" href="../menu.css" />
+<link type="text/css" rel="stylesheet" href="../content.css" />
+<style type="text/css">
+td {
+  padding: .33em;
+}
+td.doc {
+  display: none;
+  border-bottom: 1px solid black;
+}
+td.name:hover {
+  color: blue;
+  cursor: pointer;
+}
+</style>
+<script type="text/javascript">
+function toggle(id) {
+  if (!id) return;
+  row = document.getElementById(id);
+  if (row.style.display != 'table-cell')
+    row.style.display = 'table-cell';
+  else
+    row.style.display = 'none';
+}
+</script>
+</head>
+<body onLoad="toggle(location.hash.substring(1, location.hash.length - 6))">
+
+<!--#include virtual="../menu.html.incl"-->
+
+<div id="content">
+
+<h1>AST Matcher Reference</h1>
+
+<p>This document shows all currently implemented matchers. The matchers are grouped
+by category and node type they match. You can click on matcher names to show the
+matcher's source documentation.</p>
+
+<p>There are three different basic categories of matchers:
+<ul>
+<li><a href="#decl-matchers">Node Matchers:</a> Matchers that match a specific type of AST node.</li>
+<li><a href="#narrowing-matchers">Narrowing Matchers:</a> Matchers that match attributes on AST nodes.</li>
+<li><a href="#traversal-matchers">Traversal Matchers:</a> Matchers that allow traversal between AST nodes.</li>
+</ul>
+</p>
+
+<p>Within each category the matchers are ordered by node type they match on.
+Note that if a matcher can match multiple node types, it will it will appear
+multiple times. This means that by searching for Matcher<Stmt> you can
+find all matchers that can be used to match on Stmt nodes.</p>
+
+<p>The exception to that rule are matchers that can match on any node. Those
+are marked with a * and are listed in the beginning of each category.</p>
+
+<p>Note that the categorization of matchers is a great help when you combine
+them into matcher expressions. You will usually want to form matcher expressions
+that read like english sentences by alternating between node matchers and
+narrowing or traversal matchers, like this:
+<pre>
+recordDecl(hasDescendant(
+    ifStmt(hasTrueExpression(
+        expr(hasDescendant(
+            ifStmt()))))))
+</pre>
+</p>
+
+<!-- ======================================================================= -->
+<h2 id="decl-matchers">Node Matchers</h2>
+<!-- ======================================================================= -->
+
+<p>Node matchers are at the core of matcher expressions - they specify the type
+of node that is expected. Every match expression starts with a node matcher,
+which can then be further refined with a narrowing or traversal matcher. All
+traversal matchers take node matchers as their arguments.</p>
+
+<p>For convenience, all node matchers take an arbitrary number of arguments
+and implicitly act as allOf matchers.</p>
+
+<p>Node matchers are the only matchers that support the bind("id") call to
+bind the matched node to the given string, to be later retrieved from the
+match callback.</p>
+
+<p>It is important to remember that the arguments to node matchers are
+predicates on the same node, just with additional information about the type.
+This is often useful to make matcher expression more readable by inlining bind
+calls into redundant node matchers inside another node matcher:
+<pre>
+// This binds the CXXRecordDecl to "id", as the decl() matcher will stay on
+// the same node.
+recordDecl(decl().bind("id"), hasName("::MyClass"))
+</pre>
+</p>
+
+<table>
+<tr style="text-align:left"><th>Return type</th><th>Name</th><th>Parameters</th></tr>
+<!-- START_DECL_MATCHERS -->
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('cxxCtorInitializer0')"><a name="cxxCtorInitializer0Anchor">cxxCtorInitializer</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxCtorInitializer0"><pre>Matches constructor initializers.
+
+Examples matches i(42).
+  class C {
+    C() : i(42) {}
+    int i;
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('accessSpecDecl0')"><a name="accessSpecDecl0Anchor">accessSpecDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AccessSpecDecl.html">AccessSpecDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="accessSpecDecl0"><pre>Matches C++ access specifier declarations.
+
+Given
+  class C {
+  public:
+    int a;
+  };
+accessSpecDecl()
+  matches 'public:'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('classTemplateDecl0')"><a name="classTemplateDecl0Anchor">classTemplateDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateDecl.html">ClassTemplateDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="classTemplateDecl0"><pre>Matches C++ class template declarations.
+
+Example matches Z
+  template<class T> class Z {};
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('classTemplateSpecializationDecl0')"><a name="classTemplateSpecializationDecl0Anchor">classTemplateSpecializationDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="classTemplateSpecializationDecl0"><pre>Matches C++ class template specializations.
+
+Given
+  template<typename T> class A {};
+  template<> class A<double> {};
+  A<int> a;
+classTemplateSpecializationDecl()
+  matches the specializations A<int> and A<double>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('cxxConstructorDecl0')"><a name="cxxConstructorDecl0Anchor">cxxConstructorDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxConstructorDecl0"><pre>Matches C++ constructor declarations.
+
+Example matches Foo::Foo() and Foo::Foo(int)
+  class Foo {
+   public:
+    Foo();
+    Foo(int);
+    int DoSomething();
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('cxxConversionDecl0')"><a name="cxxConversionDecl0Anchor">cxxConversionDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConversionDecl.html">CXXConversionDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxConversionDecl0"><pre>Matches conversion operator declarations.
+
+Example matches the operator.
+  class X { operator int() const; };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('cxxDestructorDecl0')"><a name="cxxDestructorDecl0Anchor">cxxDestructorDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDestructorDecl.html">CXXDestructorDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxDestructorDecl0"><pre>Matches explicit C++ destructor declarations.
+
+Example matches Foo::~Foo()
+  class Foo {
+   public:
+    virtual ~Foo();
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('cxxMethodDecl0')"><a name="cxxMethodDecl0Anchor">cxxMethodDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxMethodDecl0"><pre>Matches method declarations.
+
+Example matches y
+  class X { void y(); };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('cxxRecordDecl0')"><a name="cxxRecordDecl0Anchor">cxxRecordDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxRecordDecl0"><pre>Matches C++ class declarations.
+
+Example matches X, Z
+  class X;
+  template<class T> class Z {};
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('decl0')"><a name="decl0Anchor">decl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="decl0"><pre>Matches declarations.
+
+Examples matches X, C, and the friend declaration inside C;
+  void X();
+  class C {
+    friend X;
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('declaratorDecl0')"><a name="declaratorDecl0Anchor">declaratorDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclaratorDecl.html">DeclaratorDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="declaratorDecl0"><pre>Matches declarator declarations (field, variable, function
+and non-type template parameter declarations).
+
+Given
+  class X { int y; };
+declaratorDecl()
+  matches int y.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('enumConstantDecl0')"><a name="enumConstantDecl0Anchor">enumConstantDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumConstantDecl.html">EnumConstantDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="enumConstantDecl0"><pre>Matches enum constants.
+
+Example matches A, B, C
+  enum X {
+    A, B, C
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('enumDecl0')"><a name="enumDecl0Anchor">enumDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumDecl.html">EnumDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="enumDecl0"><pre>Matches enum declarations.
+
+Example matches X
+  enum X {
+    A, B, C
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('fieldDecl0')"><a name="fieldDecl0Anchor">fieldDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FieldDecl.html">FieldDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="fieldDecl0"><pre>Matches field declarations.
+
+Given
+  class X { int m; };
+fieldDecl()
+  matches 'm'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('friendDecl0')"><a name="friendDecl0Anchor">friendDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FriendDecl.html">FriendDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="friendDecl0"><pre>Matches friend declarations.
+
+Given
+  class X { friend void foo(); };
+friendDecl()
+  matches 'friend void foo()'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('functionDecl0')"><a name="functionDecl0Anchor">functionDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="functionDecl0"><pre>Matches function declarations.
+
+Example matches f
+  void f();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('functionTemplateDecl0')"><a name="functionTemplateDecl0Anchor">functionTemplateDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionTemplateDecl.html">FunctionTemplateDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="functionTemplateDecl0"><pre>Matches C++ function template declarations.
+
+Example matches f
+  template<class T> void f(T t) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('labelDecl0')"><a name="labelDecl0Anchor">labelDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelDecl.html">LabelDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="labelDecl0"><pre>Matches a declaration of label.
+
+Given
+  goto FOO;
+  FOO: bar();
+labelDecl()
+  matches 'FOO:'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('linkageSpecDecl0')"><a name="linkageSpecDecl0Anchor">linkageSpecDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1LinkageSpecDecl.html">LinkageSpecDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="linkageSpecDecl0"><pre>Matches a declaration of a linkage specification.
+
+Given
+  extern "C" {}
+linkageSpecDecl()
+  matches "extern "C" {}"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('namedDecl0')"><a name="namedDecl0Anchor">namedDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="namedDecl0"><pre>Matches a declaration of anything that could have a name.
+
+Example matches X, S, the anonymous union type, i, and U;
+  typedef int X;
+  struct S {
+    union {
+      int i;
+    } U;
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('namespaceAliasDecl0')"><a name="namespaceAliasDecl0Anchor">namespaceAliasDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamespaceAliasDecl.html">NamespaceAliasDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="namespaceAliasDecl0"><pre>Matches a declaration of a namespace alias.
+
+Given
+  namespace test {}
+  namespace alias = ::test;
+namespaceAliasDecl()
+  matches "namespace alias" but not "namespace test"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('namespaceDecl0')"><a name="namespaceDecl0Anchor">namespaceDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamespaceDecl.html">NamespaceDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="namespaceDecl0"><pre>Matches a declaration of a namespace.
+
+Given
+  namespace {}
+  namespace test {}
+namespaceDecl()
+  matches "namespace {}" and "namespace test {}"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('nonTypeTemplateParmDecl0')"><a name="nonTypeTemplateParmDecl0Anchor">nonTypeTemplateParmDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NonTypeTemplateParmDecl.html">NonTypeTemplateParmDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="nonTypeTemplateParmDecl0"><pre>Matches non-type template parameter declarations.
+
+Given
+  template <typename T, int N> struct C {};
+nonTypeTemplateParmDecl()
+  matches 'N', but not 'T'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('objcCategoryDecl0')"><a name="objcCategoryDecl0Anchor">objcCategoryDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCCategoryDecl.html">ObjCCategoryDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="objcCategoryDecl0"><pre>Matches Objective-C category declarations.
+
+Example matches Foo (Additions)
+  @interface Foo (Additions)
+  @end
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('objcInterfaceDecl0')"><a name="objcInterfaceDecl0Anchor">objcInterfaceDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCInterfaceDecl.html">ObjCInterfaceDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="objcInterfaceDecl0"><pre>Matches Objective-C interface declarations.
+
+Example matches Foo
+  @interface Foo
+  @end
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('objcIvarDecl0')"><a name="objcIvarDecl0Anchor">objcIvarDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCIvarDecl.html">ObjCIvarDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="objcIvarDecl0"><pre>Matches Objective-C instance variable declarations.
+
+Example matches _enabled
+  @implementation Foo {
+    BOOL _enabled;
+  }
+  @end
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('objcMethodDecl0')"><a name="objcMethodDecl0Anchor">objcMethodDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMethodDecl.html">ObjCMethodDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="objcMethodDecl0"><pre>Matches Objective-C method declarations.
+
+Example matches both declaration and definition of -[Foo method]
+  @interface Foo
+  - (void)method;
+  @end
+
+  @implementation Foo
+  - (void)method {}
+  @end
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('objcPropertyDecl0')"><a name="objcPropertyDecl0Anchor">objcPropertyDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCPropertyDecl.html">ObjCPropertyDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="objcPropertyDecl0"><pre>Matches Objective-C property declarations.
+
+Example matches enabled
+  @interface Foo
+  @property BOOL enabled;
+  @end
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('objcProtocolDecl0')"><a name="objcProtocolDecl0Anchor">objcProtocolDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCProtocolDecl.html">ObjCProtocolDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="objcProtocolDecl0"><pre>Matches Objective-C protocol declarations.
+
+Example matches FooDelegate
+  @protocol FooDelegate
+  @end
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('parmVarDecl0')"><a name="parmVarDecl0Anchor">parmVarDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ParmVarDecl.html">ParmVarDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="parmVarDecl0"><pre>Matches parameter variable declarations.
+
+Given
+  void f(int x);
+parmVarDecl()
+  matches int x.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('recordDecl0')"><a name="recordDecl0Anchor">recordDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordDecl.html">RecordDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="recordDecl0"><pre>Matches class, struct, and union declarations.
+
+Example matches X, Z, U, and S
+  class X;
+  template<class T> class Z {};
+  struct S {};
+  union U {};
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('staticAssertDecl0')"><a name="staticAssertDecl0Anchor">staticAssertDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1StaticAssertDecl.html">StaticAssertDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="staticAssertDecl0"><pre>Matches a C++ static_assert declaration.
+
+Example:
+  staticAssertExpr()
+matches
+  static_assert(sizeof(S) == sizeof(int))
+in
+  struct S {
+    int x;
+  };
+  static_assert(sizeof(S) == sizeof(int));
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('templateTypeParmDecl0')"><a name="templateTypeParmDecl0Anchor">templateTypeParmDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmDecl.html">TemplateTypeParmDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="templateTypeParmDecl0"><pre>Matches template type parameter declarations.
+
+Given
+  template <typename T, int N> struct C {};
+templateTypeParmDecl()
+  matches 'T', but not 'N'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('translationUnitDecl0')"><a name="translationUnitDecl0Anchor">translationUnitDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TranslationUnitDecl.html">TranslationUnitDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="translationUnitDecl0"><pre>Matches the top declaration context.
+
+Given
+  int X;
+  namespace NS {
+  int Y;
+  }  namespace NS
+decl(hasDeclContext(translationUnitDecl()))
+  matches "int X", but not "int Y".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('typeAliasDecl0')"><a name="typeAliasDecl0Anchor">typeAliasDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeAliasDecl.html">TypeAliasDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="typeAliasDecl0"><pre>Matches type alias declarations.
+
+Given
+  typedef int X;
+  using Y = int;
+typeAliasDecl()
+  matches "using Y = int", but not "typedef int X"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('typeAliasTemplateDecl0')"><a name="typeAliasTemplateDecl0Anchor">typeAliasTemplateDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeAliasTemplateDecl.html">TypeAliasTemplateDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="typeAliasTemplateDecl0"><pre>Matches type alias template declarations.
+
+typeAliasTemplateDecl() matches
+  template <typename T>
+  using Y = X<T>;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('typedefDecl0')"><a name="typedefDecl0Anchor">typedefDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefDecl.html">TypedefDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="typedefDecl0"><pre>Matches typedef declarations.
+
+Given
+  typedef int X;
+  using Y = int;
+typedefDecl()
+  matches "typedef int X", but not "using Y = int"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('typedefNameDecl0')"><a name="typedefNameDecl0Anchor">typedefNameDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefNameDecl.html">TypedefNameDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="typedefNameDecl0"><pre>Matches typedef name declarations.
+
+Given
+  typedef int X;
+  using Y = int;
+typedefNameDecl()
+  matches "typedef int X" and "using Y = int"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('unresolvedUsingTypenameDecl0')"><a name="unresolvedUsingTypenameDecl0Anchor">unresolvedUsingTypenameDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingTypenameDecl.html">UnresolvedUsingTypenameDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unresolvedUsingTypenameDecl0"><pre>Matches unresolved using value declarations that involve the
+typename.
+
+Given
+  template <typename T>
+  struct Base { typedef T Foo; };
+
+  template<typename T>
+  struct S : private Base<T> {
+    using typename Base<T>::Foo;
+  };
+unresolvedUsingTypenameDecl()
+  matches using Base<T>::Foo </pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('unresolvedUsingValueDecl0')"><a name="unresolvedUsingValueDecl0Anchor">unresolvedUsingValueDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingValueDecl.html">UnresolvedUsingValueDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unresolvedUsingValueDecl0"><pre>Matches unresolved using value declarations.
+
+Given
+  template<typename X>
+  class C : private X {
+    using X::x;
+  };
+unresolvedUsingValueDecl()
+  matches using X::x </pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('usingDecl0')"><a name="usingDecl0Anchor">usingDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UsingDecl.html">UsingDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="usingDecl0"><pre>Matches using declarations.
+
+Given
+  namespace X { int x; }
+  using X::x;
+usingDecl()
+  matches using X::x </pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('usingDirectiveDecl0')"><a name="usingDirectiveDecl0Anchor">usingDirectiveDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UsingDirectiveDecl.html">UsingDirectiveDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="usingDirectiveDecl0"><pre>Matches using namespace declarations.
+
+Given
+  namespace X { int x; }
+  using namespace X;
+usingDirectiveDecl()
+  matches using namespace X </pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('valueDecl0')"><a name="valueDecl0Anchor">valueDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ValueDecl.html">ValueDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="valueDecl0"><pre>Matches any value declaration.
+
+Example matches A, B, C and F
+  enum X { A, B, C };
+  void F();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('varDecl0')"><a name="varDecl0Anchor">varDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="varDecl0"><pre>Matches variable declarations.
+
+Note: this does not match declarations of member variables, which are
+"field" declarations in Clang parlance.
+
+Example matches a
+  int a;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html">NestedNameSpecifierLoc</a>></td><td class="name" onclick="toggle('nestedNameSpecifierLoc0')"><a name="nestedNameSpecifierLoc0Anchor">nestedNameSpecifierLoc</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifierLoc.html">NestedNameSpecifierLoc</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="nestedNameSpecifierLoc0"><pre>Same as nestedNameSpecifier but matches NestedNameSpecifierLoc.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html">NestedNameSpecifier</a>></td><td class="name" onclick="toggle('nestedNameSpecifier0')"><a name="nestedNameSpecifier0Anchor">nestedNameSpecifier</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NestedNameSpecifier.html">NestedNameSpecifier</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="nestedNameSpecifier0"><pre>Matches nested name specifiers.
+
+Given
+  namespace ns {
+    struct A { static void f(); };
+    void A::f() {}
+    void g() { A::f(); }
+  }
+  ns::A a;
+nestedNameSpecifier()
+  matches "ns::" and both "A::"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('qualType0')"><a name="qualType0Anchor">qualType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="qualType0"><pre>Matches QualTypes in the clang AST.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('addrLabelExpr0')"><a name="addrLabelExpr0Anchor">addrLabelExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AddrLabelExpr.html">AddrLabelExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="addrLabelExpr0"><pre>Matches address of label statements (GNU extension).
+
+Given
+  FOO: bar();
+  void *ptr = &&FOO;
+  goto *bar;
+addrLabelExpr()
+  matches '&&FOO'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('arraySubscriptExpr0')"><a name="arraySubscriptExpr0Anchor">arraySubscriptExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArraySubscriptExpr.html">ArraySubscriptExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="arraySubscriptExpr0"><pre>Matches array subscript expressions.
+
+Given
+  int i = a[1];
+arraySubscriptExpr()
+  matches "a[1]"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('asmStmt0')"><a name="asmStmt0Anchor">asmStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AsmStmt.html">AsmStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="asmStmt0"><pre>Matches asm statements.
+
+ int i = 100;
+  __asm("mov al, 2");
+asmStmt()
+  matches '__asm("mov al, 2")'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('atomicExpr0')"><a name="atomicExpr0Anchor">atomicExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicExpr.html">AtomicExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="atomicExpr0"><pre>Matches atomic builtins.
+Example matches __atomic_load_n(ptr, 1)
+  void foo() { int *ptr; __atomic_load_n(ptr, 1); }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('binaryConditionalOperator0')"><a name="binaryConditionalOperator0Anchor">binaryConditionalOperator</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryConditionalOperator.html">BinaryConditionalOperator</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="binaryConditionalOperator0"><pre>Matches binary conditional operator expressions (GNU extension).
+
+Example matches a ?: b
+  (a ?: b) + 42;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('binaryOperator0')"><a name="binaryOperator0Anchor">binaryOperator</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html">BinaryOperator</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="binaryOperator0"><pre>Matches binary operator expressions.
+
+Example matches a || b
+  !(a || b)
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('breakStmt0')"><a name="breakStmt0Anchor">breakStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BreakStmt.html">BreakStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="breakStmt0"><pre>Matches break statements.
+
+Given
+  while (true) { break; }
+breakStmt()
+  matches 'break'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cStyleCastExpr0')"><a name="cStyleCastExpr0Anchor">cStyleCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CStyleCastExpr.html">CStyleCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cStyleCastExpr0"><pre>Matches a C-style cast expression.
+
+Example: Matches (int) 2.2f in
+  int i = (int) 2.2f;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('callExpr0')"><a name="callExpr0Anchor">callExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="callExpr0"><pre>Matches call expressions.
+
+Example matches x.y() and y()
+  X x;
+  x.y();
+  y();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('caseStmt0')"><a name="caseStmt0Anchor">caseStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CaseStmt.html">CaseStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="caseStmt0"><pre>Matches case statements inside switch statements.
+
+Given
+  switch(a) { case 42: break; default: break; }
+caseStmt()
+  matches 'case 42: break;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('castExpr0')"><a name="castExpr0Anchor">castExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CastExpr.html">CastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="castExpr0"><pre>Matches any cast nodes of Clang's AST.
+
+Example: castExpr() matches each of the following:
+  (int) 3;
+  const_cast<Expr *>(SubExpr);
+  char c = 0;
+but does not match
+  int i = (0);
+  int k = 0;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('characterLiteral0')"><a name="characterLiteral0Anchor">characterLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="characterLiteral0"><pre>Matches character literals (also matches wchar_t).
+
+Not matching Hex-encoded chars (e.g. 0x1234, which is a IntegerLiteral),
+though.
+
+Example matches 'a', L'a'
+  char ch = 'a';
+  wchar_t chw = L'a';
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('compoundLiteralExpr0')"><a name="compoundLiteralExpr0Anchor">compoundLiteralExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CompoundLiteralExpr.html">CompoundLiteralExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="compoundLiteralExpr0"><pre>Matches compound (i.e. non-scalar) literals
+
+Example match: {1}, (1, 2)
+  int array[4] = {1};
+  vector int myvec = (vector int)(1, 2);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('compoundStmt0')"><a name="compoundStmt0Anchor">compoundStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html">CompoundStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="compoundStmt0"><pre>Matches compound statements.
+
+Example matches '{}' and '{{}}'in 'for (;;) {{}}'
+  for (;;) {{}}
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('conditionalOperator0')"><a name="conditionalOperator0Anchor">conditionalOperator</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ConditionalOperator.html">ConditionalOperator</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="conditionalOperator0"><pre>Matches conditional operator expressions.
+
+Example matches a ? b : c
+  (a ? b : c) + 42
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('continueStmt0')"><a name="continueStmt0Anchor">continueStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ContinueStmt.html">ContinueStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="continueStmt0"><pre>Matches continue statements.
+
+Given
+  while (true) { continue; }
+continueStmt()
+  matches 'continue'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cudaKernelCallExpr0')"><a name="cudaKernelCallExpr0Anchor">cudaKernelCallExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CUDAKernelCallExpr.html">CUDAKernelCallExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cudaKernelCallExpr0"><pre>Matches CUDA kernel call expression.
+
+Example matches,
+  kernel<<<i,j>>>();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxBindTemporaryExpr0')"><a name="cxxBindTemporaryExpr0Anchor">cxxBindTemporaryExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBindTemporaryExpr.html">CXXBindTemporaryExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxBindTemporaryExpr0"><pre>Matches nodes where temporaries are created.
+
+Example matches FunctionTakesString(GetStringByValue())
+    (matcher = cxxBindTemporaryExpr())
+  FunctionTakesString(GetStringByValue());
+  FunctionTakesStringByPointer(GetStringPointer());
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxBoolLiteral0')"><a name="cxxBoolLiteral0Anchor">cxxBoolLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxBoolLiteral0"><pre>Matches bool literals.
+
+Example matches true
+  true
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxCatchStmt0')"><a name="cxxCatchStmt0Anchor">cxxCatchStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCatchStmt.html">CXXCatchStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxCatchStmt0"><pre>Matches catch statements.
+
+  try {} catch(int i) {}
+cxxCatchStmt()
+  matches 'catch(int i)'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxConstCastExpr0')"><a name="cxxConstCastExpr0Anchor">cxxConstCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstCastExpr.html">CXXConstCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxConstCastExpr0"><pre>Matches a const_cast expression.
+
+Example: Matches const_cast<int*>(&r) in
+  int n = 42;
+  const int &r(n);
+  int* p = const_cast<int*>(&r);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxConstructExpr0')"><a name="cxxConstructExpr0Anchor">cxxConstructExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxConstructExpr0"><pre>Matches constructor call expressions (including implicit ones).
+
+Example matches string(ptr, n) and ptr within arguments of f
+    (matcher = cxxConstructExpr())
+  void f(const string &a, const string &b);
+  char *ptr;
+  int n;
+  f(string(ptr, n), ptr);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxDefaultArgExpr0')"><a name="cxxDefaultArgExpr0Anchor">cxxDefaultArgExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDefaultArgExpr.html">CXXDefaultArgExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxDefaultArgExpr0"><pre>Matches the value of a default argument at the call site.
+
+Example matches the CXXDefaultArgExpr placeholder inserted for the
+    default value of the second parameter in the call expression f(42)
+    (matcher = cxxDefaultArgExpr())
+  void f(int x, int y = 0);
+  f(42);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxDeleteExpr0')"><a name="cxxDeleteExpr0Anchor">cxxDeleteExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDeleteExpr.html">CXXDeleteExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxDeleteExpr0"><pre>Matches delete expressions.
+
+Given
+  delete X;
+cxxDeleteExpr()
+  matches 'delete X'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxDynamicCastExpr0')"><a name="cxxDynamicCastExpr0Anchor">cxxDynamicCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDynamicCastExpr.html">CXXDynamicCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxDynamicCastExpr0"><pre>Matches a dynamic_cast expression.
+
+Example:
+  cxxDynamicCastExpr()
+matches
+  dynamic_cast<D*>(&b);
+in
+  struct B { virtual ~B() {} }; struct D : B {};
+  B b;
+  D* p = dynamic_cast<D*>(&b);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxForRangeStmt0')"><a name="cxxForRangeStmt0Anchor">cxxForRangeStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxForRangeStmt0"><pre>Matches range-based for statements.
+
+cxxForRangeStmt() matches 'for (auto a : i)'
+  int i[] =  {1, 2, 3}; for (auto a : i);
+  for(int j = 0; j < 5; ++j);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxFunctionalCastExpr0')"><a name="cxxFunctionalCastExpr0Anchor">cxxFunctionalCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXFunctionalCastExpr.html">CXXFunctionalCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxFunctionalCastExpr0"><pre>Matches functional cast expressions
+
+Example: Matches Foo(bar);
+  Foo f = bar;
+  Foo g = (Foo) bar;
+  Foo h = Foo(bar);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxMemberCallExpr0')"><a name="cxxMemberCallExpr0Anchor">cxxMemberCallExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxMemberCallExpr0"><pre>Matches member call expressions.
+
+Example matches x.y()
+  X x;
+  x.y();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxNewExpr0')"><a name="cxxNewExpr0Anchor">cxxNewExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxNewExpr0"><pre>Matches new expressions.
+
+Given
+  new X;
+cxxNewExpr()
+  matches 'new X'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxNullPtrLiteralExpr0')"><a name="cxxNullPtrLiteralExpr0Anchor">cxxNullPtrLiteralExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNullPtrLiteralExpr.html">CXXNullPtrLiteralExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxNullPtrLiteralExpr0"><pre>Matches nullptr literal.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxOperatorCallExpr0')"><a name="cxxOperatorCallExpr0Anchor">cxxOperatorCallExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxOperatorCallExpr0"><pre>Matches overloaded operator calls.
+
+Note that if an operator isn't overloaded, it won't match. Instead, use
+binaryOperator matcher.
+Currently it does not match operators such as new delete.
+FIXME: figure out why these do not match?
+
+Example matches both operator<<((o << b), c) and operator<<(o, b)
+    (matcher = cxxOperatorCallExpr())
+  ostream &operator<< (ostream &out, int i) { };
+  ostream &o; int b = 1, c = 1;
+  o << b << c;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxReinterpretCastExpr0')"><a name="cxxReinterpretCastExpr0Anchor">cxxReinterpretCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXReinterpretCastExpr.html">CXXReinterpretCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxReinterpretCastExpr0"><pre>Matches a reinterpret_cast expression.
+
+Either the source expression or the destination type can be matched
+using has(), but hasDestinationType() is more specific and can be
+more readable.
+
+Example matches reinterpret_cast<char*>(&p) in
+  void* p = reinterpret_cast<char*>(&p);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxStaticCastExpr0')"><a name="cxxStaticCastExpr0Anchor">cxxStaticCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXStaticCastExpr.html">CXXStaticCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxStaticCastExpr0"><pre>Matches a C++ static_cast expression.
+
+See also: hasDestinationType
+See also: reinterpretCast
+
+Example:
+  cxxStaticCastExpr()
+matches
+  static_cast<long>(8)
+in
+  long eight(static_cast<long>(8));
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxStdInitializerListExpr0')"><a name="cxxStdInitializerListExpr0Anchor">cxxStdInitializerListExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXStdInitializerListExpr.html">CXXStdInitializerListExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxStdInitializerListExpr0"><pre>Matches C++ initializer list expressions.
+
+Given
+  std::vector<int> a({ 1, 2, 3 });
+  std::vector<int> b = { 4, 5 };
+  int c[] = { 6, 7 };
+  std::pair<int, int> d = { 8, 9 };
+cxxStdInitializerListExpr()
+  matches "{ 1, 2, 3 }" and "{ 4, 5 }"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxTemporaryObjectExpr0')"><a name="cxxTemporaryObjectExpr0Anchor">cxxTemporaryObjectExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXTemporaryObjectExpr.html">CXXTemporaryObjectExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxTemporaryObjectExpr0"><pre>Matches functional cast expressions having N != 1 arguments
+
+Example: Matches Foo(bar, bar)
+  Foo h = Foo(bar, bar);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxThisExpr0')"><a name="cxxThisExpr0Anchor">cxxThisExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXThisExpr.html">CXXThisExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxThisExpr0"><pre>Matches implicit and explicit this expressions.
+
+Example matches the implicit this expression in "return i".
+    (matcher = cxxThisExpr())
+struct foo {
+  int i;
+  int f() { return i; }
+};
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxThrowExpr0')"><a name="cxxThrowExpr0Anchor">cxxThrowExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXThrowExpr.html">CXXThrowExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxThrowExpr0"><pre>Matches throw expressions.
+
+  try { throw 5; } catch(int i) {}
+cxxThrowExpr()
+  matches 'throw 5'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxTryStmt0')"><a name="cxxTryStmt0Anchor">cxxTryStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXTryStmt.html">CXXTryStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxTryStmt0"><pre>Matches try statements.
+
+  try {} catch(int i) {}
+cxxTryStmt()
+  matches 'try {}'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxUnresolvedConstructExpr0')"><a name="cxxUnresolvedConstructExpr0Anchor">cxxUnresolvedConstructExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXUnresolvedConstructExpr.html">CXXUnresolvedConstructExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxUnresolvedConstructExpr0"><pre>Matches unresolved constructor call expressions.
+
+Example matches T(t) in return statement of f
+    (matcher = cxxUnresolvedConstructExpr())
+  template <typename T>
+  void f(const T& t) { return T(t); }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('declRefExpr0')"><a name="declRefExpr0Anchor">declRefExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="declRefExpr0"><pre>Matches expressions that refer to declarations.
+
+Example matches x in if (x)
+  bool x;
+  if (x) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('declStmt0')"><a name="declStmt0Anchor">declStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">DeclStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="declStmt0"><pre>Matches declaration statements.
+
+Given
+  int a;
+declStmt()
+  matches 'int a'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('defaultStmt0')"><a name="defaultStmt0Anchor">defaultStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DefaultStmt.html">DefaultStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="defaultStmt0"><pre>Matches default statements inside switch statements.
+
+Given
+  switch(a) { case 42: break; default: break; }
+defaultStmt()
+  matches 'default: break;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('designatedInitExpr0')"><a name="designatedInitExpr0Anchor">designatedInitExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DesignatedInitExpr.html">DesignatedInitExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="designatedInitExpr0"><pre>Matches C99 designated initializer expressions [C99 6.7.8].
+
+Example: Matches { [2].y = 1.0, [0].x = 1.0 }
+  point ptarray[10] = { [2].y = 1.0, [0].x = 1.0 };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('doStmt0')"><a name="doStmt0Anchor">doStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DoStmt.html">DoStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="doStmt0"><pre>Matches do statements.
+
+Given
+  do {} while (true);
+doStmt()
+  matches 'do {} while(true)'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('explicitCastExpr0')"><a name="explicitCastExpr0Anchor">explicitCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ExplicitCastExpr.html">ExplicitCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="explicitCastExpr0"><pre>Matches explicit cast expressions.
+
+Matches any cast expression written in user code, whether it be a
+C-style cast, a functional-style cast, or a keyword cast.
+
+Does not match implicit conversions.
+
+Note: the name "explicitCast" is chosen to match Clang's terminology, as
+Clang uses the term "cast" to apply to implicit conversions as well as to
+actual cast expressions.
+
+See also: hasDestinationType.
+
+Example: matches all five of the casts in
+  int((int)(reinterpret_cast<int>(static_cast<int>(const_cast<int>(42)))))
+but does not match the implicit conversion in
+  long ell = 42;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('expr0')"><a name="expr0Anchor">expr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="expr0"><pre>Matches expressions.
+
+Example matches x()
+  void f() { x(); }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('exprWithCleanups0')"><a name="exprWithCleanups0Anchor">exprWithCleanups</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ExprWithCleanups.html">ExprWithCleanups</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="exprWithCleanups0"><pre>Matches expressions that introduce cleanups to be run at the end
+of the sub-expression's evaluation.
+
+Example matches std::string()
+  const std::string str = std::string();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('floatLiteral0')"><a name="floatLiteral0Anchor">floatLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="floatLiteral0"><pre>Matches float literals of all sizes encodings, e.g.
+1.0, 1.0f, 1.0L and 1e10.
+
+Does not match implicit conversions such as
+  float a = 10;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('forStmt0')"><a name="forStmt0Anchor">forStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ForStmt.html">ForStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="forStmt0"><pre>Matches for statements.
+
+Example matches 'for (;;) {}'
+  for (;;) {}
+  int i[] =  {1, 2, 3}; for (auto a : i);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('gnuNullExpr0')"><a name="gnuNullExpr0Anchor">gnuNullExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1GNUNullExpr.html">GNUNullExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="gnuNullExpr0"><pre>Matches GNU __null expression.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('gotoStmt0')"><a name="gotoStmt0Anchor">gotoStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1GotoStmt.html">GotoStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="gotoStmt0"><pre>Matches goto statements.
+
+Given
+  goto FOO;
+  FOO: bar();
+gotoStmt()
+  matches 'goto FOO'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('ifStmt0')"><a name="ifStmt0Anchor">ifStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IfStmt.html">IfStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="ifStmt0"><pre>Matches if statements.
+
+Example matches 'if (x) {}'
+  if (x) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('implicitCastExpr0')"><a name="implicitCastExpr0Anchor">implicitCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ImplicitCastExpr.html">ImplicitCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="implicitCastExpr0"><pre>Matches the implicit cast nodes of Clang's AST.
+
+This matches many different places, including function call return value
+eliding, as well as any type conversions.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('implicitValueInitExpr0')"><a name="implicitValueInitExpr0Anchor">implicitValueInitExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ImplicitValueInitExpr.html">ImplicitValueInitExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="implicitValueInitExpr0"><pre>Matches implicit initializers of init list expressions.
+
+Given
+  point ptarray[10] = { [2].y = 1.0, [2].x = 2.0, [0].x = 1.0 };
+implicitValueInitExpr()
+  matches "[0].y" (implicitly)
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('initListExpr0')"><a name="initListExpr0Anchor">initListExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1InitListExpr.html">InitListExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="initListExpr0"><pre>Matches init list expressions.
+
+Given
+  int a[] = { 1, 2 };
+  struct B { int x, y; };
+  B b = { 5, 6 };
+initListExpr()
+  matches "{ 1, 2 }" and "{ 5, 6 }"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('integerLiteral0')"><a name="integerLiteral0Anchor">integerLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="integerLiteral0"><pre>Matches integer literals of all sizes encodings, e.g.
+1, 1L, 0x1 and 1U.
+
+Does not match character-encoded integers such as L'a'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('labelStmt0')"><a name="labelStmt0Anchor">labelStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="labelStmt0"><pre>Matches label statements.
+
+Given
+  goto FOO;
+  FOO: bar();
+labelStmt()
+  matches 'FOO:'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('lambdaExpr0')"><a name="lambdaExpr0Anchor">lambdaExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1LambdaExpr.html">LambdaExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="lambdaExpr0"><pre>Matches lambda expressions.
+
+Example matches [&](){return 5;}
+  [&](){return 5;}
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('materializeTemporaryExpr0')"><a name="materializeTemporaryExpr0Anchor">materializeTemporaryExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MaterializeTemporaryExpr.html">MaterializeTemporaryExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="materializeTemporaryExpr0"><pre>Matches nodes where temporaries are materialized.
+
+Example: Given
+  struct T {void func();};
+  T f();
+  void g(T);
+materializeTemporaryExpr() matches 'f()' in these statements
+  T u(f());
+  g(f());
+but does not match
+  f();
+  f().func();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('memberExpr0')"><a name="memberExpr0Anchor">memberExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="memberExpr0"><pre>Matches member expressions.
+
+Given
+  class Y {
+    void x() { this->x(); x(); Y y; y.x(); a; this->b; Y::b; }
+    int a; static int b;
+  };
+memberExpr()
+  matches this->x, x, y.x, a, this->b
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('nullStmt0')"><a name="nullStmt0Anchor">nullStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NullStmt.html">NullStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="nullStmt0"><pre>Matches null statements.
+
+  foo();;
+nullStmt()
+  matches the second ';'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('objcMessageExpr0')"><a name="objcMessageExpr0Anchor">objcMessageExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html">ObjCMessageExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="objcMessageExpr0"><pre>Matches ObjectiveC Message invocation expressions.
+
+The innermost message send invokes the "alloc" class method on the
+NSString class, while the outermost message send invokes the
+"initWithString" instance method on the object returned from
+NSString's "alloc". This matcher should match both message sends.
+  [[NSString alloc] initWithString:@"Hello"]
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('opaqueValueExpr0')"><a name="opaqueValueExpr0Anchor">opaqueValueExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1OpaqueValueExpr.html">OpaqueValueExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="opaqueValueExpr0"><pre>Matches opaque value expressions. They are used as helpers
+to reference another expressions and can be met
+in BinaryConditionalOperators, for example.
+
+Example matches 'a'
+  (a ?: c) + 42;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('parenExpr0')"><a name="parenExpr0Anchor">parenExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ParenExpr.html">ParenExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="parenExpr0"><pre>Matches parentheses used in expressions.
+
+Example matches (foo() + 1)
+  int foo() { return 1; }
+  int a = (foo() + 1);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('parenListExpr0')"><a name="parenListExpr0Anchor">parenListExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ParenListExpr.html">ParenListExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="parenListExpr0"><pre>Matches paren list expressions.
+ParenListExprs don't have a predefined type and are used for late parsing.
+In the final AST, they can be met in template declarations.
+
+Given
+  template<typename T> class X {
+    void f() {
+      X x(*this);
+      int a = 0, b = 1; int i = (a, b);
+    }
+  };
+parenListExpr() matches "*this" but NOT matches (a, b) because (a, b)
+has a predefined type and is a ParenExpr, not a ParenListExpr.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('predefinedExpr0')"><a name="predefinedExpr0Anchor">predefinedExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1PredefinedExpr.html">PredefinedExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="predefinedExpr0"><pre>Matches predefined identifier expressions [C99 6.4.2.2].
+
+Example: Matches __func__
+  printf("%s", __func__);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('returnStmt0')"><a name="returnStmt0Anchor">returnStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ReturnStmt.html">ReturnStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="returnStmt0"><pre>Matches return statements.
+
+Given
+  return 1;
+returnStmt()
+  matches 'return 1'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('stmt0')"><a name="stmt0Anchor">stmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="stmt0"><pre>Matches statements.
+
+Given
+  { ++a; }
+stmt()
+  matches both the compound statement '{ ++a; }' and '++a'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('stmtExpr0')"><a name="stmtExpr0Anchor">stmtExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1StmtExpr.html">StmtExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="stmtExpr0"><pre>Matches statement expression (GNU extension).
+
+Example match: ({ int X = 4; X; })
+  int C = ({ int X = 4; X; });
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('stringLiteral0')"><a name="stringLiteral0Anchor">stringLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1StringLiteral.html">StringLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="stringLiteral0"><pre>Matches string literals (also matches wide string literals).
+
+Example matches "abcd", L"abcd"
+  char *s = "abcd";
+  wchar_t *ws = L"abcd";
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('substNonTypeTemplateParmExpr0')"><a name="substNonTypeTemplateParmExpr0Anchor">substNonTypeTemplateParmExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1SubstNonTypeTemplateParmExpr.html">SubstNonTypeTemplateParmExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="substNonTypeTemplateParmExpr0"><pre>Matches substitutions of non-type template parameters.
+
+Given
+  template <int N>
+  struct A { static const int n = N; };
+  struct B : public A<42> {};
+substNonTypeTemplateParmExpr()
+  matches "N" in the right-hand side of "static const int n = N;"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('switchCase0')"><a name="switchCase0Anchor">switchCase</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1SwitchCase.html">SwitchCase</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="switchCase0"><pre>Matches case and default statements inside switch statements.
+
+Given
+  switch(a) { case 42: break; default: break; }
+switchCase()
+  matches 'case 42: break;' and 'default: break;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('switchStmt0')"><a name="switchStmt0Anchor">switchStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1SwitchStmt.html">SwitchStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="switchStmt0"><pre>Matches switch statements.
+
+Given
+  switch(a) { case 42: break; default: break; }
+switchStmt()
+  matches 'switch(a)'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('unaryExprOrTypeTraitExpr0')"><a name="unaryExprOrTypeTraitExpr0Anchor">unaryExprOrTypeTraitExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryExprOrTypeTraitExpr.html">UnaryExprOrTypeTraitExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unaryExprOrTypeTraitExpr0"><pre>Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
+
+Given
+  Foo x = bar;
+  int y = sizeof(x) + alignof(x);
+unaryExprOrTypeTraitExpr()
+  matches sizeof(x) and alignof(x)
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('unaryOperator0')"><a name="unaryOperator0Anchor">unaryOperator</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryOperator.html">UnaryOperator</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unaryOperator0"><pre>Matches unary operator expressions.
+
+Example matches !a
+  !a || b
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('unresolvedLookupExpr0')"><a name="unresolvedLookupExpr0Anchor">unresolvedLookupExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedLookupExpr.html">UnresolvedLookupExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unresolvedLookupExpr0"><pre>Matches reference to a name that can be looked up during parsing
+but could not be resolved to a specific declaration.
+
+Given
+  template<typename T>
+  T foo() { T a; return a; }
+  template<typename T>
+  void bar() {
+    foo<T>();
+  }
+unresolvedLookupExpr()
+  matches foo<T>() </pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('userDefinedLiteral0')"><a name="userDefinedLiteral0Anchor">userDefinedLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UserDefinedLiteral.html">UserDefinedLiteral</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="userDefinedLiteral0"><pre>Matches user defined literal operator call.
+
+Example match: "foo"_suffix
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('whileStmt0')"><a name="whileStmt0Anchor">whileStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1WhileStmt.html">WhileStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="whileStmt0"><pre>Matches while statements.
+
+Given
+  while (true) {}
+whileStmt()
+  matches 'while (true) {}'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>></td><td class="name" onclick="toggle('templateArgument0')"><a name="templateArgument0Anchor">templateArgument</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="templateArgument0"><pre>Matches template arguments.
+
+Given
+  template <typename T> struct C {};
+  C<int> c;
+templateArgument()
+  matches 'int' in C<int>.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateName.html">TemplateName</a>></td><td class="name" onclick="toggle('templateName0')"><a name="templateName0Anchor">templateName</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateName.html">TemplateName</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="templateName0"><pre>Matches template name.
+
+Given
+  template <typename T> class X { };
+  X<int> xi;
+templateName()
+  matches 'X' in X<int>.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td><td class="name" onclick="toggle('typeLoc0')"><a name="typeLoc0Anchor">typeLoc</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="typeLoc0"><pre>Matches TypeLocs in the clang AST.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('arrayType0')"><a name="arrayType0Anchor">arrayType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="arrayType0"><pre>Matches all kinds of arrays.
+
+Given
+  int a[] = { 2, 3 };
+  int b[4];
+  void f() { int c[a[0]]; }
+arrayType()
+  matches "int a[]", "int b[4]" and "int c[a[0]]";
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('atomicType0')"><a name="atomicType0Anchor">atomicType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicType.html">AtomicType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="atomicType0"><pre>Matches atomic types.
+
+Given
+  _Atomic(int) i;
+atomicType()
+  matches "_Atomic(int) i"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('autoType0')"><a name="autoType0Anchor">autoType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AutoType.html">AutoType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="autoType0"><pre>Matches types nodes representing C++11 auto types.
+
+Given:
+  auto n = 4;
+  int v[] = { 2, 3 }
+  for (auto i : v) { }
+autoType()
+  matches "auto n" and "auto i"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('blockPointerType0')"><a name="blockPointerType0Anchor">blockPointerType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="blockPointerType0"><pre>Matches block pointer types, i.e. types syntactically represented as
+"void (^)(int)".
+
+The pointee is always required to be a FunctionType.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('builtinType0')"><a name="builtinType0Anchor">builtinType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BuiltinType.html">BuiltinType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="builtinType0"><pre>Matches builtin Types.
+
+Given
+  struct A {};
+  A a;
+  int b;
+  float c;
+  bool d;
+builtinType()
+  matches "int b", "float c" and "bool d"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('complexType0')"><a name="complexType0Anchor">complexType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="complexType0"><pre>Matches C99 complex types.
+
+Given
+  _Complex float f;
+complexType()
+  matches "_Complex float f"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('constantArrayType0')"><a name="constantArrayType0Anchor">constantArrayType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ConstantArrayType.html">ConstantArrayType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="constantArrayType0"><pre>Matches C arrays with a specified constant size.
+
+Given
+  void() {
+    int a[2];
+    int b[] = { 2, 3 };
+    int c[b[0]];
+  }
+constantArrayType()
+  matches "int a[2]"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('decayedType0')"><a name="decayedType0Anchor">decayedType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DecayedType.html">DecayedType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="decayedType0"><pre>Matches decayed type
+Example matches i[] in declaration of f.
+    (matcher = valueDecl(hasType(decayedType(hasDecayedType(pointerType())))))
+Example matches i[1].
+    (matcher = expr(hasType(decayedType(hasDecayedType(pointerType())))))
+  void f(int i[]) {
+    i[1] = 0;
+  }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('dependentSizedArrayType0')"><a name="dependentSizedArrayType0Anchor">dependentSizedArrayType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DependentSizedArrayType.html">DependentSizedArrayType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="dependentSizedArrayType0"><pre>Matches C++ arrays whose size is a value-dependent expression.
+
+Given
+  template<typename T, int Size>
+  class array {
+    T data[Size];
+  };
+dependentSizedArrayType
+  matches "T data[Size]"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('elaboratedType0')"><a name="elaboratedType0Anchor">elaboratedType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ElaboratedType.html">ElaboratedType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="elaboratedType0"><pre>Matches types specified with an elaborated type keyword or with a
+qualified name.
+
+Given
+  namespace N {
+    namespace M {
+      class D {};
+    }
+  }
+  class C {};
+
+  class C c;
+  N::M::D d;
+
+elaboratedType() matches the type of the variable declarations of both
+c and d.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('enumType0')"><a name="enumType0Anchor">enumType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="enumType0"><pre>Matches enum types.
+
+Given
+  enum C { Green };
+  enum class S { Red };
+
+  C c;
+  S s;
+
+enumType() matches the type of the variable declarations of both c and
+s.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('functionProtoType0')"><a name="functionProtoType0Anchor">functionProtoType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionProtoType.html">FunctionProtoType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="functionProtoType0"><pre>Matches FunctionProtoType nodes.
+
+Given
+  int (*f)(int);
+  void g();
+functionProtoType()
+  matches "int (*f)(int)" and the type of "g" in C++ mode.
+  In C mode, "g" is not matched because it does not contain a prototype.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('functionType0')"><a name="functionType0Anchor">functionType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionType.html">FunctionType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="functionType0"><pre>Matches FunctionType nodes.
+
+Given
+  int (*f)(int);
+  void g();
+functionType()
+  matches "int (*f)(int)" and the type of "g".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('incompleteArrayType0')"><a name="incompleteArrayType0Anchor">incompleteArrayType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IncompleteArrayType.html">IncompleteArrayType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="incompleteArrayType0"><pre>Matches C arrays with unspecified size.
+
+Given
+  int a[] = { 2, 3 };
+  int b[42];
+  void f(int c[]) { int d[a[0]]; };
+incompleteArrayType()
+  matches "int a[]" and "int c[]"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('injectedClassNameType0')"><a name="injectedClassNameType0Anchor">injectedClassNameType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="injectedClassNameType0"><pre>Matches injected class name types.
+
+Example matches S s, but not S<T> s.
+    (matcher = parmVarDecl(hasType(injectedClassNameType())))
+  template <typename T> struct S {
+    void f(S s);
+    void g(S<T> s);
+  };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('lValueReferenceType0')"><a name="lValueReferenceType0Anchor">lValueReferenceType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1LValueReferenceType.html">LValueReferenceType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="lValueReferenceType0"><pre>Matches lvalue reference types.
+
+Given:
+  int *a;
+  int &b = *a;
+  int &&c = 1;
+  auto &d = b;
+  auto &&e = c;
+  auto &&f = 2;
+  int g = 5;
+
+lValueReferenceType() matches the types of b, d, and e. e is
+matched since the type is deduced as int& by reference collapsing rules.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('memberPointerType0')"><a name="memberPointerType0Anchor">memberPointerType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="memberPointerType0"><pre>Matches member pointer types.
+Given
+  struct A { int i; }
+  A::* ptr = A::i;
+memberPointerType()
+  matches "A::* ptr"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('objcObjectPointerType0')"><a name="objcObjectPointerType0Anchor">objcObjectPointerType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCObjectPointerType.html">ObjCObjectPointerType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="objcObjectPointerType0"><pre>Matches an Objective-C object pointer type, which is different from
+a pointer type, despite being syntactically similar.
+
+Given
+  int *a;
+
+  @interface Foo
+  @end
+  Foo *f;
+pointerType()
+  matches "Foo *f", but does not match "int *a".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('parenType0')"><a name="parenType0Anchor">parenType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ParenType.html">ParenType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="parenType0"><pre>Matches ParenType nodes.
+
+Given
+  int (*ptr_to_array)[4];
+  int *array_of_ptrs[4];
+
+varDecl(hasType(pointsTo(parenType()))) matches ptr_to_array but not
+array_of_ptrs.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('pointerType0')"><a name="pointerType0Anchor">pointerType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="pointerType0"><pre>Matches pointer types, but does not match Objective-C object pointer
+types.
+
+Given
+  int *a;
+  int &b = *a;
+  int c = 5;
+
+  @interface Foo
+  @end
+  Foo *f;
+pointerType()
+  matches "int *a", but does not match "Foo *f".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('rValueReferenceType0')"><a name="rValueReferenceType0Anchor">rValueReferenceType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RValueReferenceType.html">RValueReferenceType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="rValueReferenceType0"><pre>Matches rvalue reference types.
+
+Given:
+  int *a;
+  int &b = *a;
+  int &&c = 1;
+  auto &d = b;
+  auto &&e = c;
+  auto &&f = 2;
+  int g = 5;
+
+rValueReferenceType() matches the types of c and f. e is not
+matched as it is deduced to int& by reference collapsing rules.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('recordType0')"><a name="recordType0Anchor">recordType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="recordType0"><pre>Matches record types (e.g. structs, classes).
+
+Given
+  class C {};
+  struct S {};
+
+  C c;
+  S s;
+
+recordType() matches the type of the variable declarations of both c
+and s.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('referenceType0')"><a name="referenceType0Anchor">referenceType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="referenceType0"><pre>Matches both lvalue and rvalue reference types.
+
+Given
+  int *a;
+  int &b = *a;
+  int &&c = 1;
+  auto &d = b;
+  auto &&e = c;
+  auto &&f = 2;
+  int g = 5;
+
+referenceType() matches the types of b, c, d, e, and f.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('substTemplateTypeParmType0')"><a name="substTemplateTypeParmType0Anchor">substTemplateTypeParmType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1SubstTemplateTypeParmType.html">SubstTemplateTypeParmType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="substTemplateTypeParmType0"><pre>Matches types that represent the result of substituting a type for a
+template type parameter.
+
+Given
+  template <typename T>
+  void F(T t) {
+    int i = 1 + t;
+  }
+
+substTemplateTypeParmType() matches the type of 't' but not '1'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('templateSpecializationType0')"><a name="templateSpecializationType0Anchor">templateSpecializationType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="templateSpecializationType0"><pre>Matches template specialization types.
+
+Given
+  template <typename T>
+  class C { };
+
+  template class C<int>;  A
+  C<char> var;            B
+
+templateSpecializationType() matches the type of the explicit
+instantiation in A and the type of the variable declaration in B.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('templateTypeParmType0')"><a name="templateTypeParmType0Anchor">templateTypeParmType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="templateTypeParmType0"><pre>Matches template type parameter types.
+
+Example matches T, but not int.
+    (matcher = templateTypeParmType())
+  template <typename T> void f(int i);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('type0')"><a name="type0Anchor">type</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="type0"><pre>Matches Types in the clang AST.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('typedefType0')"><a name="typedefType0Anchor">typedefType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="typedefType0"><pre>Matches typedef types.
+
+Given
+  typedef int X;
+typedefType()
+  matches "typedef int X"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('unaryTransformType0')"><a name="unaryTransformType0Anchor">unaryTransformType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryTransformType.html">UnaryTransformType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="unaryTransformType0"><pre>Matches types nodes representing unary type transformations.
+
+Given:
+  typedef __underlying_type(T) type;
+unaryTransformType()
+  matches "__underlying_type(T)"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('variableArrayType0')"><a name="variableArrayType0Anchor">variableArrayType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VariableArrayType.html">VariableArrayType</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="variableArrayType0"><pre>Matches C arrays with a specified size that is not an
+integer-constant-expression.
+
+Given
+  void f() {
+    int a[] = { 2, 3 }
+    int b[42];
+    int c[a[0]];
+  }
+variableArrayType()
+  matches "int c[a[0]]"
+</pre></td></tr>
+
+<!--END_DECL_MATCHERS -->
+</table>
+
+<!-- ======================================================================= -->
+<h2 id="narrowing-matchers">Narrowing Matchers</h2>
+<!-- ======================================================================= -->
+
+<p>Narrowing matchers match certain attributes on the current node, thus
+narrowing down the set of nodes of the current type to match on.</p>
+
+<p>There are special logical narrowing matchers (allOf, anyOf, anything and unless)
+which allow users to create more powerful match expressions.</p>
+
+<table>
+<tr style="text-align:left"><th>Return type</th><th>Name</th><th>Parameters</th></tr>
+<!-- START_NARROWING_MATCHERS -->
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('allOf0')"><a name="allOf0Anchor">allOf</a></td><td>Matcher<*>, ..., Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="allOf0"><pre>Matches if all given matchers match.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('anyOf0')"><a name="anyOf0Anchor">anyOf</a></td><td>Matcher<*>, ..., Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="anyOf0"><pre>Matches if any of the given matchers matches.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('anything0')"><a name="anything0Anchor">anything</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="anything0"><pre>Matches any node.
+
+Useful when another matcher requires a child matcher, but there's no
+additional constraint. This will often be used with an explicit conversion
+to an internal::Matcher<> type such as TypeMatcher.
+
+Example: DeclarationMatcher(anything()) matches all declarations, e.g.,
+"int* p" and "void f()" in
+  int* p;
+  void f();
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('unless0')"><a name="unless0Anchor">unless</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="unless0"><pre>Matches if the provided matcher does not match.
+
+Example matches Y (matcher = cxxRecordDecl(unless(hasName("X"))))
+  class X {};
+  class Y {};
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html">BinaryOperator</a>></td><td class="name" onclick="toggle('hasOperatorName0')"><a name="hasOperatorName0Anchor">hasOperatorName</a></td><td>std::string Name</td></tr>
+<tr><td colspan="4" class="doc" id="hasOperatorName0"><pre>Matches the operator Name of operator expressions (binary or
+unary).
+
+Example matches a || b (matcher = binaryOperator(hasOperatorName("||")))
+  !(a || b)
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals2')"><a name="equals2Anchor">equals</a></td><td>ValueT  Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals2"><pre>Matches literals that are equal to the given value of type ValueT.
+
+Given
+  f('false, 3.14, 42);
+characterLiteral(equals(0))
+  matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0))
+  match false
+floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2))
+  match 3.14
+integerLiteral(equals(42))
+  matches 42
+
+Note that you cannot directly match a negative numeric literal because the
+minus sign is not part of the literal: It is a unary operator whose operand
+is the positive numeric literal. Instead, you must use a unaryOperator()
+matcher to match the minus sign:
+
+unaryOperator(hasOperatorName("-"),
+              hasUnaryOperand(integerLiteral(equals(13))))
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>,
+           Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals5')"><a name="equals5Anchor">equals</a></td><td>bool Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals5"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals11')"><a name="equals11Anchor">equals</a></td><td>double Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals11"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals8')"><a name="equals8Anchor">equals</a></td><td>unsigned Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals8"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCatchStmt.html">CXXCatchStmt</a>></td><td class="name" onclick="toggle('isCatchAll0')"><a name="isCatchAll0Anchor">isCatchAll</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isCatchAll0"><pre>Matches a C++ catch statement that has a catch-all handler.
+
+Given
+  try {
+    ...
+  } catch (int) {
+    ...
+  } catch (...) {
+    ...
+  }
+endcode
+cxxCatchStmt(isCatchAll()) matches catch(...) but not catch(int).
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('argumentCountIs1')"><a name="argumentCountIs1Anchor">argumentCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="argumentCountIs1"><pre>Checks that a call expression or a constructor call expression has
+a specific number of arguments (including absent default arguments).
+
+Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2)))
+  void f(int x, int y);
+  f(0, 0);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('isListInitialization0')"><a name="isListInitialization0Anchor">isListInitialization</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isListInitialization0"><pre>Matches a constructor call expression which uses list initialization.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('requiresZeroInitialization0')"><a name="requiresZeroInitialization0Anchor">requiresZeroInitialization</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="requiresZeroInitialization0"><pre>Matches a constructor call expression which requires
+zero initialization.
+
+Given
+void foo() {
+  struct point { double x; double y; };
+  point pt[2] = { { 1.0, 2.0 } };
+}
+initListExpr(has(cxxConstructExpr(requiresZeroInitialization()))
+will match the implicit array filler for pt[1].
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('isCopyConstructor0')"><a name="isCopyConstructor0Anchor">isCopyConstructor</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isCopyConstructor0"><pre>Matches constructor declarations that are copy constructors.
+
+Given
+  struct S {
+    S(); #1
+    S(const S &); #2
+    S(S &&); #3
+  };
+cxxConstructorDecl(isCopyConstructor()) will match #2, but not #1 or #3.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('isDefaultConstructor0')"><a name="isDefaultConstructor0Anchor">isDefaultConstructor</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDefaultConstructor0"><pre>Matches constructor declarations that are default constructors.
+
+Given
+  struct S {
+    S(); #1
+    S(const S &); #2
+    S(S &&); #3
+  };
+cxxConstructorDecl(isDefaultConstructor()) will match #1, but not #2 or #3.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('isDelegatingConstructor0')"><a name="isDelegatingConstructor0Anchor">isDelegatingConstructor</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDelegatingConstructor0"><pre>Matches constructors that delegate to another constructor.
+
+Given
+  struct S {
+    S(); #1
+    S(int) {} #2
+    S(S &&) : S() {} #3
+  };
+  S::S() : S(0) {} #4
+cxxConstructorDecl(isDelegatingConstructor()) will match #3 and #4, but not
+#1 or #2.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('isExplicit0')"><a name="isExplicit0Anchor">isExplicit</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExplicit0"><pre>Matches constructor and conversion declarations that are marked with
+the explicit keyword.
+
+Given
+  struct S {
+    S(int); #1
+    explicit S(double); #2
+    operator int(); #3
+    explicit operator bool(); #4
+  };
+cxxConstructorDecl(isExplicit()) will match #2, but not #1.
+cxxConversionDecl(isExplicit()) will match #4, but not #3.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('isMoveConstructor0')"><a name="isMoveConstructor0Anchor">isMoveConstructor</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isMoveConstructor0"><pre>Matches constructor declarations that are move constructors.
+
+Given
+  struct S {
+    S(); #1
+    S(const S &); #2
+    S(S &&); #3
+  };
+cxxConstructorDecl(isMoveConstructor()) will match #3, but not #1 or #2.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConversionDecl.html">CXXConversionDecl</a>></td><td class="name" onclick="toggle('isExplicit1')"><a name="isExplicit1Anchor">isExplicit</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExplicit1"><pre>Matches constructor and conversion declarations that are marked with
+the explicit keyword.
+
+Given
+  struct S {
+    S(int); #1
+    explicit S(double); #2
+    operator int(); #3
+    explicit operator bool(); #4
+  };
+cxxConstructorDecl(isExplicit()) will match #2, but not #1.
+cxxConversionDecl(isExplicit()) will match #4, but not #3.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('isBaseInitializer0')"><a name="isBaseInitializer0Anchor">isBaseInitializer</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isBaseInitializer0"><pre>Matches a constructor initializer if it is initializing a base, as
+opposed to a member.
+
+Given
+  struct B {};
+  struct D : B {
+    int I;
+    D(int i) : I(i) {}
+  };
+  struct E : B {
+    E() : B() {}
+  };
+cxxConstructorDecl(hasAnyConstructorInitializer(isBaseInitializer()))
+  will match E(), but not match D(int).
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('isMemberInitializer0')"><a name="isMemberInitializer0Anchor">isMemberInitializer</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isMemberInitializer0"><pre>Matches a constructor initializer if it is initializing a member, as
+opposed to a base.
+
+Given
+  struct B {};
+  struct D : B {
+    int I;
+    D(int i) : I(i) {}
+  };
+  struct E : B {
+    E() : B() {}
+  };
+cxxConstructorDecl(hasAnyConstructorInitializer(isMemberInitializer()))
+  will match D(int), but not match E().
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('isWritten0')"><a name="isWritten0Anchor">isWritten</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isWritten0"><pre>Matches a constructor initializer if it is explicitly written in
+code (as opposed to implicitly added by the compiler).
+
+Given
+  struct Foo {
+    Foo() { }
+    Foo(int) : foo_("A") { }
+    string foo_;
+  };
+cxxConstructorDecl(hasAnyConstructorInitializer(isWritten()))
+  will match Foo(int), but not Foo()
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isConst0')"><a name="isConst0Anchor">isConst</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isConst0"><pre>Matches if the given method declaration is const.
+
+Given
+struct A {
+  void foo() const;
+  void bar();
+};
+
+cxxMethodDecl(isConst()) matches A::foo() but not A::bar()
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isCopyAssignmentOperator0')"><a name="isCopyAssignmentOperator0Anchor">isCopyAssignmentOperator</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isCopyAssignmentOperator0"><pre>Matches if the given method declaration declares a copy assignment
+operator.
+
+Given
+struct A {
+  A &operator=(const A &);
+  A &operator=(A &&);
+};
+
+cxxMethodDecl(isCopyAssignmentOperator()) matches the first method but not
+the second one.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isFinal1')"><a name="isFinal1Anchor">isFinal</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isFinal1"><pre>Matches if the given method or class declaration is final.
+
+Given:
+  class A final {};
+
+  struct B {
+    virtual void f();
+  };
+
+  struct C : B {
+    void f() final;
+  };
+matches A and C::f, but not B, C, or B::f
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isMoveAssignmentOperator0')"><a name="isMoveAssignmentOperator0Anchor">isMoveAssignmentOperator</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isMoveAssignmentOperator0"><pre>Matches if the given method declaration declares a move assignment
+operator.
+
+Given
+struct A {
+  A &operator=(const A &);
+  A &operator=(A &&);
+};
+
+cxxMethodDecl(isMoveAssignmentOperator()) matches the second method but not
+the first one.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isOverride0')"><a name="isOverride0Anchor">isOverride</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isOverride0"><pre>Matches if the given method declaration overrides another method.
+
+Given
+  class A {
+   public:
+    virtual void x();
+  };
+  class B : public A {
+   public:
+    virtual void x();
+  };
+  matches B::x
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isPure0')"><a name="isPure0Anchor">isPure</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isPure0"><pre>Matches if the given method declaration is pure.
+
+Given
+  class A {
+   public:
+    virtual void x() = 0;
+  };
+  matches A::x
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isUserProvided0')"><a name="isUserProvided0Anchor">isUserProvided</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isUserProvided0"><pre>Matches method declarations that are user-provided.
+
+Given
+  struct S {
+    S(); #1
+    S(const S &) = default; #2
+    S(S &&) = delete; #3
+  };
+cxxConstructorDecl(isUserProvided()) will match #1, but not #2 or #3.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isVirtual0')"><a name="isVirtual0Anchor">isVirtual</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isVirtual0"><pre>Matches if the given method declaration is virtual.
+
+Given
+  class A {
+   public:
+    virtual void x();
+  };
+  matches A::x
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('isVirtualAsWritten0')"><a name="isVirtualAsWritten0Anchor">isVirtualAsWritten</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isVirtualAsWritten0"><pre>Matches if the given method declaration has an explicit "virtual".
+
+Given
+  class A {
+   public:
+    virtual void x();
+  };
+  class B : public A {
+   public:
+    void x();
+  };
+  matches A::x but not B::x
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>></td><td class="name" onclick="toggle('hasOverloadedOperatorName1')"><a name="hasOverloadedOperatorName1Anchor">hasOverloadedOperatorName</a></td><td>StringRef Name</td></tr>
+<tr><td colspan="4" class="doc" id="hasOverloadedOperatorName1"><pre>Matches overloaded operator names.
+
+Matches overloaded operator names specified in strings without the
+"operator" prefix: e.g. "<<".
+
+Given:
+  class A { int operator*(); };
+  const A &operator<<(const A &a, const A &b);
+  A a;
+  a << a;   <-- This matches
+
+cxxOperatorCallExpr(hasOverloadedOperatorName("<<"))) matches the
+specified line and
+cxxRecordDecl(hasMethod(hasOverloadedOperatorName("*")))
+matches the declaration of A.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isDerivedFrom1')"><a name="isDerivedFrom1Anchor">isDerivedFrom</a></td><td>std::string BaseName</td></tr>
+<tr><td colspan="4" class="doc" id="isDerivedFrom1"><pre>Overloaded method as shortcut for isDerivedFrom(hasName(...)).
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isExplicitTemplateSpecialization2')"><a name="isExplicitTemplateSpecialization2Anchor">isExplicitTemplateSpecialization</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExplicitTemplateSpecialization2"><pre>Matches explicit template specializations of function, class, or
+static member variable template instantiations.
+
+Given
+  template<typename T> void A(T t) { }
+  template<> void A(int N) { }
+functionDecl(isExplicitTemplateSpecialization())
+  matches the specialization A<int>().
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isFinal0')"><a name="isFinal0Anchor">isFinal</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isFinal0"><pre>Matches if the given method or class declaration is final.
+
+Given:
+  class A final {};
+
+  struct B {
+    virtual void f();
+  };
+
+  struct C : B {
+    void f() final;
+  };
+matches A and C::f, but not B, C, or B::f
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isLambda0')"><a name="isLambda0Anchor">isLambda</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isLambda0"><pre>Matches the generated class of lambda expressions.
+
+Given:
+  auto x = []{};
+
+cxxRecordDecl(isLambda()) matches the implicit class declaration of
+decltype(x)
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isSameOrDerivedFrom1')"><a name="isSameOrDerivedFrom1Anchor">isSameOrDerivedFrom</a></td><td>std::string BaseName</td></tr>
+<tr><td colspan="4" class="doc" id="isSameOrDerivedFrom1"><pre>Overloaded method as shortcut for
+isSameOrDerivedFrom(hasName(...)).
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isTemplateInstantiation2')"><a name="isTemplateInstantiation2Anchor">isTemplateInstantiation</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isTemplateInstantiation2"><pre>Matches template instantiations of function, class, or static
+member variable template instantiations.
+
+Given
+  template <typename T> class X {}; class A {}; X<A> x;
+or
+  template <typename T> class X {}; class A {}; template class X<A>;
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
+  matches the template instantiation of X<A>.
+
+But given
+  template <typename T>  class X {}; class A {};
+  template <> class X<A> {}; X<A> x;
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
+  does not match, as X<A> is an explicit template specialization.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('argumentCountIs0')"><a name="argumentCountIs0Anchor">argumentCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="argumentCountIs0"><pre>Checks that a call expression or a constructor call expression has
+a specific number of arguments (including absent default arguments).
+
+Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2)))
+  void f(int x, int y);
+  f(0, 0);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CastExpr.html">CastExpr</a>></td><td class="name" onclick="toggle('hasCastKind0')"><a name="hasCastKind0Anchor">hasCastKind</a></td><td>CastKind Kind</td></tr>
+<tr><td colspan="4" class="doc" id="hasCastKind0"><pre>Matches casts that has a given cast kind.
+
+Example: matches the implicit cast around 0
+(matcher = castExpr(hasCastKind(CK_NullToPointer)))
+  int *p = 0;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals3')"><a name="equals3Anchor">equals</a></td><td>ValueT  Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals3"><pre>Matches literals that are equal to the given value of type ValueT.
+
+Given
+  f('false, 3.14, 42);
+characterLiteral(equals(0))
+  matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0))
+  match false
+floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2))
+  match 3.14
+integerLiteral(equals(42))
+  matches 42
+
+Note that you cannot directly match a negative numeric literal because the
+minus sign is not part of the literal: It is a unary operator whose operand
+is the positive numeric literal. Instead, you must use a unaryOperator()
+matcher to match the minus sign:
+
+unaryOperator(hasOperatorName("-"),
+              hasUnaryOperand(integerLiteral(equals(13))))
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>,
+           Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals4')"><a name="equals4Anchor">equals</a></td><td>bool Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals4"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals10')"><a name="equals10Anchor">equals</a></td><td>double Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals10"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals7')"><a name="equals7Anchor">equals</a></td><td>unsigned Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals7"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>></td><td class="name" onclick="toggle('templateArgumentCountIs0')"><a name="templateArgumentCountIs0Anchor">templateArgumentCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="templateArgumentCountIs0"><pre>Matches if the number of template arguments equals N.
+
+Given
+  template<typename T> struct C {};
+  C<int> c;
+classTemplateSpecializationDecl(templateArgumentCountIs(1))
+  matches C<int>.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html">CompoundStmt</a>></td><td class="name" onclick="toggle('statementCountIs0')"><a name="statementCountIs0Anchor">statementCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="statementCountIs0"><pre>Checks that a compound statement contains a specific number of
+child statements.
+
+Example: Given
+  { for (;;) {} }
+compoundStmt(statementCountIs(0)))
+  matches '{}'
+  but does not match the outer compound statement.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ConstantArrayType.html">ConstantArrayType</a>></td><td class="name" onclick="toggle('hasSize0')"><a name="hasSize0Anchor">hasSize</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="hasSize0"><pre>Matches nodes that have the specified size.
+
+Given
+  int a[42];
+  int b[2 * 21];
+  int c[41], d[43];
+  char *s = "abcd";
+  wchar_t *ws = L"abcd";
+  char *w = "a";
+constantArrayType(hasSize(42))
+  matches "int a[42]" and "int b[2 * 21]"
+stringLiteral(hasSize(4))
+  matches "abcd", L"abcd"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclStmt.html">DeclStmt</a>></td><td class="name" onclick="toggle('declCountIs0')"><a name="declCountIs0Anchor">declCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="declCountIs0"><pre>Matches declaration statements that contain a specific number of
+declarations.
+
+Example: Given
+  int a, b;
+  int c;
+  int d = 2, e;
+declCountIs(2)
+  matches 'int a, b;' and 'int d = 2, e;', but not 'int c;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('equalsBoundNode1')"><a name="equalsBoundNode1Anchor">equalsBoundNode</a></td><td>std::string ID</td></tr>
+<tr><td colspan="4" class="doc" id="equalsBoundNode1"><pre>Matches if a node equals a previously bound node.
+
+Matches a node if it equals the node previously bound to ID.
+
+Given
+  class X { int a; int b; };
+cxxRecordDecl(
+    has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
+    has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
+  matches the class X, as a and b have the same type.
+
+Note that when multiple matches are involved via forEach* matchers,
+equalsBoundNodes acts as a filter.
+For example:
+compoundStmt(
+    forEachDescendant(varDecl().bind("d")),
+    forEachDescendant(declRefExpr(to(decl(equalsBoundNode("d"))))))
+will trigger a match for each combination of variable declaration
+and reference to that variable declaration within a compound statement.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('equalsNode0')"><a name="equalsNode0Anchor">equalsNode</a></td><td>const Decl* Other</td></tr>
+<tr><td colspan="4" class="doc" id="equalsNode0"><pre>Matches if a node equals another node.
+
+Decl has pointer identity in the AST.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('hasAttr0')"><a name="hasAttr0Anchor">hasAttr</a></td><td>attr::Kind AttrKind</td></tr>
+<tr><td colspan="4" class="doc" id="hasAttr0"><pre>Matches declaration that has a given attribute.
+
+Given
+  __attribute__((device)) void f() { ... }
+decl(hasAttr(clang::attr::CUDADevice)) matches the function declaration of
+f. If the matcher is use from clang-query, attr::Kind parameter should be
+passed as a quoted string. e.g., hasAttr("attr::CUDADevice").
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isExpansionInFileMatching0')"><a name="isExpansionInFileMatching0Anchor">isExpansionInFileMatching</a></td><td>std::string RegExp</td></tr>
+<tr><td colspan="4" class="doc" id="isExpansionInFileMatching0"><pre>Matches AST nodes that were expanded within files whose name is
+partially matching a given regex.
+
+Example matches Y but not X
+    (matcher = cxxRecordDecl(isExpansionInFileMatching("AST.*"))
+  #include "ASTMatcher.h"
+  class X {};
+ASTMatcher.h:
+  class Y {};
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isExpansionInMainFile0')"><a name="isExpansionInMainFile0Anchor">isExpansionInMainFile</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExpansionInMainFile0"><pre>Matches AST nodes that were expanded within the main-file.
+
+Example matches X but not Y
+  (matcher = cxxRecordDecl(isExpansionInMainFile())
+  #include <Y.h>
+  class X {};
+Y.h:
+  class Y {};
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isExpansionInSystemHeader0')"><a name="isExpansionInSystemHeader0Anchor">isExpansionInSystemHeader</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExpansionInSystemHeader0"><pre>Matches AST nodes that were expanded within system-header-files.
+
+Example matches Y but not X
+    (matcher = cxxRecordDecl(isExpansionInSystemHeader())
+  #include <SystemHeader.h>
+  class X {};
+SystemHeader.h:
+  class Y {};
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isImplicit0')"><a name="isImplicit0Anchor">isImplicit</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isImplicit0"><pre>Matches a declaration that has been implicitly added
+by the compiler (eg. implicit defaultcopy constructors).
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isPrivate0')"><a name="isPrivate0Anchor">isPrivate</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isPrivate0"><pre>Matches private C++ declarations.
+
+Given
+  class C {
+  public:    int a;
+  protected: int b;
+  private:   int c;
+  };
+fieldDecl(isPrivate())
+  matches 'int c;'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isProtected0')"><a name="isProtected0Anchor">isProtected</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isProtected0"><pre>Matches protected C++ declarations.
+
+Given
+  class C {
+  public:    int a;
+  protected: int b;
+  private:   int c;
+  };
+fieldDecl(isProtected())
+  matches 'int b;'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isPublic0')"><a name="isPublic0Anchor">isPublic</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isPublic0"><pre>Matches public C++ declarations.
+
+Given
+  class C {
+  public:    int a;
+  protected: int b;
+  private:   int c;
+  };
+fieldDecl(isPublic())
+  matches 'int a;'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DesignatedInitExpr.html">DesignatedInitExpr</a>></td><td class="name" onclick="toggle('designatorCountIs0')"><a name="designatorCountIs0Anchor">designatorCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="designatorCountIs0"><pre>Matches designated initializer expressions that contain
+a specific number of designators.
+
+Example: Given
+  point ptarray[10] = { [2].y = 1.0, [0].x = 1.0 };
+  point ptarray2[10] = { [2].y = 1.0, [2].x = 0.0, [0].x = 1.0 };
+designatorCountIs(2)
+  matches '{ [2].y = 1.0, [0].x = 1.0 }',
+  but not '{ [2].y = 1.0, [2].x = 0.0, [0].x = 1.0 }'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FieldDecl.html">FieldDecl</a>></td><td class="name" onclick="toggle('hasBitWidth0')"><a name="hasBitWidth0Anchor">hasBitWidth</a></td><td>unsigned Width</td></tr>
+<tr><td colspan="4" class="doc" id="hasBitWidth0"><pre>Matches non-static data members that are bit-fields of the specified
+bit width.
+
+Given
+  class C {
+    int a : 2;
+    int b : 4;
+    int c : 2;
+  };
+fieldDecl(hasBitWidth(2))
+  matches 'int a;' and 'int c;' but not 'int b;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FieldDecl.html">FieldDecl</a>></td><td class="name" onclick="toggle('isBitField0')"><a name="isBitField0Anchor">isBitField</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isBitField0"><pre>Matches non-static data members that are bit-fields.
+
+Given
+  class C {
+    int a : 2;
+    int b;
+  };
+fieldDecl(isBitField())
+  matches 'int a;' but not 'int b;'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>></td><td class="name" onclick="toggle('equals1')"><a name="equals1Anchor">equals</a></td><td>ValueT  Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals1"><pre>Matches literals that are equal to the given value of type ValueT.
+
+Given
+  f('false, 3.14, 42);
+characterLiteral(equals(0))
+  matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0))
+  match false
+floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2))
+  match 3.14
+integerLiteral(equals(42))
+  matches 42
+
+Note that you cannot directly match a negative numeric literal because the
+minus sign is not part of the literal: It is a unary operator whose operand
+is the positive numeric literal. Instead, you must use a unaryOperator()
+matcher to match the minus sign:
+
+unaryOperator(hasOperatorName("-"),
+              hasUnaryOperand(integerLiteral(equals(13))))
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>,
+           Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>></td><td class="name" onclick="toggle('equals12')"><a name="equals12Anchor">equals</a></td><td>double Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals12"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('hasDynamicExceptionSpec0')"><a name="hasDynamicExceptionSpec0Anchor">hasDynamicExceptionSpec</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasDynamicExceptionSpec0"><pre>Matches functions that have a dynamic exception specification.
+
+Given:
+  void f();
+  void g() noexcept;
+  void h() noexcept(true);
+  void i() noexcept(false);
+  void j() throw();
+  void k() throw(int);
+  void l() throw(...);
+functionDecl(hasDynamicExceptionSpec()) and
+  functionProtoType(hasDynamicExceptionSpec())
+  match the declarations of j, k, and l, but not f, g, h, or i.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('hasOverloadedOperatorName0')"><a name="hasOverloadedOperatorName0Anchor">hasOverloadedOperatorName</a></td><td>StringRef Name</td></tr>
+<tr><td colspan="4" class="doc" id="hasOverloadedOperatorName0"><pre>Matches overloaded operator names.
+
+Matches overloaded operator names specified in strings without the
+"operator" prefix: e.g. "<<".
+
+Given:
+  class A { int operator*(); };
+  const A &operator<<(const A &a, const A &b);
+  A a;
+  a << a;   <-- This matches
+
+cxxOperatorCallExpr(hasOverloadedOperatorName("<<"))) matches the
+specified line and
+cxxRecordDecl(hasMethod(hasOverloadedOperatorName("*")))
+matches the declaration of A.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isConstexpr1')"><a name="isConstexpr1Anchor">isConstexpr</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isConstexpr1"><pre>Matches constexpr variable and function declarations.
+
+Given:
+  constexpr int foo = 42;
+  constexpr int bar();
+varDecl(isConstexpr())
+  matches the declaration of foo.
+functionDecl(isConstexpr())
+  matches the declaration of bar.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isDefaulted0')"><a name="isDefaulted0Anchor">isDefaulted</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDefaulted0"><pre>Matches defaulted function declarations.
+
+Given:
+  class A { ~A(); };
+  class B { ~B() = default; };
+functionDecl(isDefaulted())
+  matches the declaration of ~B, but not ~A.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isDefinition2')"><a name="isDefinition2Anchor">isDefinition</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDefinition2"><pre>Matches if a declaration has a body attached.
+
+Example matches A, va, fa
+  class A {};
+  class B;  Doesn't match, as it has no body.
+  int va;
+  extern int vb;  Doesn't match, as it doesn't define the variable.
+  void fa() {}
+  void fb();  Doesn't match, as it has no body.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TagDecl.html">TagDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isDeleted0')"><a name="isDeleted0Anchor">isDeleted</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDeleted0"><pre>Matches deleted function declarations.
+
+Given:
+  void Func();
+  void DeletedFunc() = delete;
+functionDecl(isDeleted())
+  matches the declaration of DeletedFunc, but not Func.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isExplicitTemplateSpecialization0')"><a name="isExplicitTemplateSpecialization0Anchor">isExplicitTemplateSpecialization</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExplicitTemplateSpecialization0"><pre>Matches explicit template specializations of function, class, or
+static member variable template instantiations.
+
+Given
+  template<typename T> void A(T t) { }
+  template<> void A(int N) { }
+functionDecl(isExplicitTemplateSpecialization())
+  matches the specialization A<int>().
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isExternC0')"><a name="isExternC0Anchor">isExternC</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExternC0"><pre>Matches extern "C" function declarations.
+
+Given:
+  extern "C" void f() {}
+  extern "C" { void g() {} }
+  void h() {}
+functionDecl(isExternC())
+  matches the declaration of f and g, but not the declaration h
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isInline1')"><a name="isInline1Anchor">isInline</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isInline1"><pre>Matches function and namespace declarations that are marked with
+the inline keyword.
+
+Given
+  inline void f();
+  void g();
+  namespace n {
+  inline namespace m {}
+  }
+functionDecl(isInline()) will match ::f().
+namespaceDecl(isInline()) will match n::m.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isNoThrow0')"><a name="isNoThrow0Anchor">isNoThrow</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isNoThrow0"><pre>Matches functions that have a non-throwing exception specification.
+
+Given:
+  void f();
+  void g() noexcept;
+  void h() throw();
+  void i() throw(int);
+  void j() noexcept(false);
+functionDecl(isNoThrow()) and functionProtoType(isNoThrow())
+  match the declarations of g, and h, but not f, i or j.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isStaticStorageClass0')"><a name="isStaticStorageClass0Anchor">isStaticStorageClass</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isStaticStorageClass0"><pre>Matches variablefunction declarations that have "static" storage
+class specifier ("static" keyword) written in the source.
+
+Given:
+  static void f() {}
+  static int i = 0;
+  extern int j;
+  int k;
+functionDecl(isStaticStorageClass())
+  matches the function declaration f.
+varDecl(isStaticStorageClass())
+  matches the variable declaration i.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isTemplateInstantiation0')"><a name="isTemplateInstantiation0Anchor">isTemplateInstantiation</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isTemplateInstantiation0"><pre>Matches template instantiations of function, class, or static
+member variable template instantiations.
+
+Given
+  template <typename T> class X {}; class A {}; X<A> x;
+or
+  template <typename T> class X {}; class A {}; template class X<A>;
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
+  matches the template instantiation of X<A>.
+
+But given
+  template <typename T>  class X {}; class A {};
+  template <> class X<A> {}; X<A> x;
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
+  does not match, as X<A> is an explicit template specialization.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('isVariadic0')"><a name="isVariadic0Anchor">isVariadic</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isVariadic0"><pre>Matches if a function declaration is variadic.
+
+Example matches f, but not g or h. The function i will not match, even when
+compiled in C mode.
+  void f(...);
+  void g(int);
+  template <typename... Ts> void h(Ts...);
+  void i();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('parameterCountIs0')"><a name="parameterCountIs0Anchor">parameterCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="parameterCountIs0"><pre>Matches FunctionDecls and FunctionProtoTypes that have a
+specific parameter count.
+
+Given
+  void f(int i) {}
+  void g(int i, int j) {}
+  void h(int i, int j);
+  void j(int i);
+  void k(int x, int y, int z, ...);
+functionDecl(parameterCountIs(2))
+  matches void g(int i, int j) {}
+functionProtoType(parameterCountIs(2))
+  matches void h(int i, int j)
+functionProtoType(parameterCountIs(3))
+  matches void k(int x, int y, int z, ...);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionProtoType.html">FunctionProtoType</a>></td><td class="name" onclick="toggle('hasDynamicExceptionSpec1')"><a name="hasDynamicExceptionSpec1Anchor">hasDynamicExceptionSpec</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasDynamicExceptionSpec1"><pre>Matches functions that have a dynamic exception specification.
+
+Given:
+  void f();
+  void g() noexcept;
+  void h() noexcept(true);
+  void i() noexcept(false);
+  void j() throw();
+  void k() throw(int);
+  void l() throw(...);
+functionDecl(hasDynamicExceptionSpec()) and
+  functionProtoType(hasDynamicExceptionSpec())
+  match the declarations of j, k, and l, but not f, g, h, or i.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionProtoType.html">FunctionProtoType</a>></td><td class="name" onclick="toggle('isNoThrow1')"><a name="isNoThrow1Anchor">isNoThrow</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isNoThrow1"><pre>Matches functions that have a non-throwing exception specification.
+
+Given:
+  void f();
+  void g() noexcept;
+  void h() throw();
+  void i() throw(int);
+  void j() noexcept(false);
+functionDecl(isNoThrow()) and functionProtoType(isNoThrow())
+  match the declarations of g, and h, but not f, i or j.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionProtoType.html">FunctionProtoType</a>></td><td class="name" onclick="toggle('parameterCountIs1')"><a name="parameterCountIs1Anchor">parameterCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="parameterCountIs1"><pre>Matches FunctionDecls and FunctionProtoTypes that have a
+specific parameter count.
+
+Given
+  void f(int i) {}
+  void g(int i, int j) {}
+  void h(int i, int j);
+  void j(int i);
+  void k(int x, int y, int z, ...);
+functionDecl(parameterCountIs(2))
+  matches void g(int i, int j) {}
+functionProtoType(parameterCountIs(2))
+  matches void h(int i, int j)
+functionProtoType(parameterCountIs(3))
+  matches void k(int x, int y, int z, ...);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals0')"><a name="equals0Anchor">equals</a></td><td>ValueT  Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals0"><pre>Matches literals that are equal to the given value of type ValueT.
+
+Given
+  f('false, 3.14, 42);
+characterLiteral(equals(0))
+  matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0))
+  match false
+floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2))
+  match 3.14
+integerLiteral(equals(42))
+  matches 42
+
+Note that you cannot directly match a negative numeric literal because the
+minus sign is not part of the literal: It is a unary operator whose operand
+is the positive numeric literal. Instead, you must use a unaryOperator()
+matcher to match the minus sign:
+
+unaryOperator(hasOperatorName("-"),
+              hasUnaryOperand(integerLiteral(equals(13))))
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>,
+           Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals6')"><a name="equals6Anchor">equals</a></td><td>bool Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals6"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals13')"><a name="equals13Anchor">equals</a></td><td>double Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals13"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals9')"><a name="equals9Anchor">equals</a></td><td>unsigned Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals9"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>></td><td class="name" onclick="toggle('isArrow0')"><a name="isArrow0Anchor">isArrow</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isArrow0"><pre>Matches member expressions that are called with '->' as opposed
+to '.'.
+
+Member calls on the implicit this pointer match as called with '->'.
+
+Given
+  class Y {
+    void x() { this->x(); x(); Y y; y.x(); a; this->b; Y::b; }
+    int a;
+    static int b;
+  };
+memberExpr(isArrow())
+  matches this->x, x, y.x, a, this->b
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>></td><td class="name" onclick="toggle('hasExternalFormalLinkage0')"><a name="hasExternalFormalLinkage0Anchor">hasExternalFormalLinkage</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasExternalFormalLinkage0"><pre>Matches a declaration that has external formal linkage.
+
+Example matches only z (matcher = varDecl(hasExternalFormalLinkage()))
+void f() {
+  int x;
+  static int y;
+}
+int z;
+
+Example matches f() because it has external formal linkage despite being
+unique to the translation unit as though it has internal likage
+(matcher = functionDecl(hasExternalFormalLinkage()))
+
+namespace {
+void f() {}
+}
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>></td><td class="name" onclick="toggle('hasName0')"><a name="hasName0Anchor">hasName</a></td><td>std::string  Name</td></tr>
+<tr><td colspan="4" class="doc" id="hasName0"><pre>Matches NamedDecl nodes that have the specified name.
+
+Supports specifying enclosing namespaces or classes by prefixing the name
+with '<enclosing>::'.
+Does not match typedefs of an underlying type with the given name.
+
+Example matches X (Name == "X")
+  class X;
+
+Example matches X (Name is one of "::a::b::X", "a::b::X", "b::X", "X")
+  namespace a { namespace b { class X; } }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>></td><td class="name" onclick="toggle('matchesName0')"><a name="matchesName0Anchor">matchesName</a></td><td>std::string RegExp</td></tr>
+<tr><td colspan="4" class="doc" id="matchesName0"><pre>Matches NamedDecl nodes whose fully qualified names contain
+a substring matched by the given RegExp.
+
+Supports specifying enclosing namespaces or classes by
+prefixing the name with '<enclosing>::'.  Does not match typedefs
+of an underlying type with the given name.
+
+Example matches X (regexp == "::X")
+  class X;
+
+Example matches X (regexp is one of "::X", "^foo::.*X", among others)
+  namespace foo { namespace bar { class X; } }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamespaceDecl.html">NamespaceDecl</a>></td><td class="name" onclick="toggle('isAnonymous0')"><a name="isAnonymous0Anchor">isAnonymous</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isAnonymous0"><pre>Matches anonymous namespace declarations.
+
+Given
+  namespace n {
+  namespace {} #1
+  }
+namespaceDecl(isAnonymous()) will match #1 but not ::n.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamespaceDecl.html">NamespaceDecl</a>></td><td class="name" onclick="toggle('isInline0')"><a name="isInline0Anchor">isInline</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isInline0"><pre>Matches function and namespace declarations that are marked with
+the inline keyword.
+
+Given
+  inline void f();
+  void g();
+  namespace n {
+  inline namespace m {}
+  }
+functionDecl(isInline()) will match ::f().
+namespaceDecl(isInline()) will match n::m.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html">ObjCMessageExpr</a>></td><td class="name" onclick="toggle('argumentCountIs2')"><a name="argumentCountIs2Anchor">argumentCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="argumentCountIs2"><pre>Checks that a call expression or a constructor call expression has
+a specific number of arguments (including absent default arguments).
+
+Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2)))
+  void f(int x, int y);
+  f(0, 0);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html">ObjCMessageExpr</a>></td><td class="name" onclick="toggle('hasKeywordSelector0')"><a name="hasKeywordSelector0Anchor">hasKeywordSelector</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasKeywordSelector0"><pre>Matches when the selector is a keyword selector
+
+objCMessageExpr(hasKeywordSelector()) matches the generated setFrame
+message expression in
+
+  UIWebView *webView = ...;
+  CGRect bodyFrame = webView.frame;
+  bodyFrame.size.height = self.bodyContentHeight;
+  webView.frame = bodyFrame;
+      ^---- matches here
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html">ObjCMessageExpr</a>></td><td class="name" onclick="toggle('hasNullSelector0')"><a name="hasNullSelector0Anchor">hasNullSelector</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasNullSelector0"><pre>Matches when the selector is the empty selector
+
+Matches only when the selector of the objCMessageExpr is NULL. This may
+represent an error condition in the tree!
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html">ObjCMessageExpr</a>></td><td class="name" onclick="toggle('hasSelector0')"><a name="hasSelector0Anchor">hasSelector</a></td><td>std::string BaseName</td></tr>
+<tr><td colspan="4" class="doc" id="hasSelector0"><pre>Matches when BaseName == Selector.getAsString()
+
+ matcher = objCMessageExpr(hasSelector("loadHTMLString:baseURL:"));
+ matches the outer message expr in the code below, but NOT the message
+ invocation for self.bodyView.
+    [self.bodyView loadHTMLString:html baseURL:NULL];
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html">ObjCMessageExpr</a>></td><td class="name" onclick="toggle('hasUnarySelector0')"><a name="hasUnarySelector0Anchor">hasUnarySelector</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasUnarySelector0"><pre>Matches when the selector is a Unary Selector
+
+ matcher = objCMessageExpr(matchesSelector(hasUnarySelector());
+ matches self.bodyView in the code below, but NOT the outer message
+ invocation of "loadHTMLString:baseURL:".
+    [self.bodyView loadHTMLString:html baseURL:NULL];
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html">ObjCMessageExpr</a>></td><td class="name" onclick="toggle('matchesSelector0')"><a name="matchesSelector0Anchor">matchesSelector</a></td><td>std::string RegExp</td></tr>
+<tr><td colspan="4" class="doc" id="matchesSelector0"><pre>Matches ObjC selectors whose name contains
+a substring matched by the given RegExp.
+ matcher = objCMessageExpr(matchesSelector("loadHTMLStringmatches the outer message expr in the code below, but NOT the message
+ invocation for self.bodyView.
+    [self.bodyView loadHTMLString:html baseURL:NULL];
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html">ObjCMessageExpr</a>></td><td class="name" onclick="toggle('numSelectorArgs0')"><a name="numSelectorArgs0Anchor">numSelectorArgs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="numSelectorArgs0"><pre>Matches when the selector has the specified number of arguments
+
+ matcher = objCMessageExpr(numSelectorArgs(0));
+ matches self.bodyView in the code below
+
+ matcher = objCMessageExpr(numSelectorArgs(2));
+ matches the invocation of "loadHTMLString:baseURL:" but not that
+ of self.bodyView
+    [self.bodyView loadHTMLString:html baseURL:NULL];
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('asString0')"><a name="asString0Anchor">asString</a></td><td>std::string Name</td></tr>
+<tr><td colspan="4" class="doc" id="asString0"><pre>Matches if the matched type is represented by the given string.
+
+Given
+  class Y { public: void x(); };
+  void z() { Y* y; y->x(); }
+cxxMemberCallExpr(on(hasType(asString("class Y *"))))
+  matches y->x()
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('equalsBoundNode3')"><a name="equalsBoundNode3Anchor">equalsBoundNode</a></td><td>std::string ID</td></tr>
+<tr><td colspan="4" class="doc" id="equalsBoundNode3"><pre>Matches if a node equals a previously bound node.
+
+Matches a node if it equals the node previously bound to ID.
+
+Given
+  class X { int a; int b; };
+cxxRecordDecl(
+    has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
+    has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
+  matches the class X, as a and b have the same type.
+
+Note that when multiple matches are involved via forEach* matchers,
+equalsBoundNodes acts as a filter.
+For example:
+compoundStmt(
+    forEachDescendant(varDecl().bind("d")),
+    forEachDescendant(declRefExpr(to(decl(equalsBoundNode("d"))))))
+will trigger a match for each combination of variable declaration
+and reference to that variable declaration within a compound statement.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('hasLocalQualifiers0')"><a name="hasLocalQualifiers0Anchor">hasLocalQualifiers</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasLocalQualifiers0"><pre>Matches QualType nodes that have local CV-qualifiers attached to
+the node, not hidden within a typedef.
+
+Given
+  typedef const int const_int;
+  const_int i;
+  int *const j;
+  int *volatile k;
+  int m;
+varDecl(hasType(hasLocalQualifiers())) matches only j and k.
+i is const-qualified but the qualifier is not local.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('isAnyCharacter0')"><a name="isAnyCharacter0Anchor">isAnyCharacter</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isAnyCharacter0"><pre>Matches QualType nodes that are of character type.
+
+Given
+  void a(char);
+  void b(wchar_t);
+  void c(double);
+functionDecl(hasAnyParameter(hasType(isAnyCharacter())))
+matches "a(char)", "b(wchar_t)", but not "c(double)".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('isAnyPointer0')"><a name="isAnyPointer0Anchor">isAnyPointer</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isAnyPointer0"><pre>Matches QualType nodes that are of any pointer type; this includes
+the Objective-C object pointer type, which is different despite being
+syntactically similar.
+
+Given
+  int *i = nullptr;
+
+  @interface Foo
+  @end
+  Foo *f;
+
+  int j;
+varDecl(hasType(isAnyPointer()))
+  matches "int *i" and "Foo *f", but not "int j".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('isConstQualified0')"><a name="isConstQualified0Anchor">isConstQualified</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isConstQualified0"><pre>Matches QualType nodes that are const-qualified, i.e., that
+include "top-level" const.
+
+Given
+  void a(int);
+  void b(int const);
+  void c(const int);
+  void d(const int*);
+  void e(int const) {};
+functionDecl(hasAnyParameter(hasType(isConstQualified())))
+  matches "void b(int const)", "void c(const int)" and
+  "void e(int const) {}". It does not match d as there
+  is no top-level const on the parameter type "const int *".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('isInteger0')"><a name="isInteger0Anchor">isInteger</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isInteger0"><pre>Matches QualType nodes that are of integer type.
+
+Given
+  void a(int);
+  void b(long);
+  void c(double);
+functionDecl(hasAnyParameter(hasType(isInteger())))
+matches "a(int)", "b(long)", but not "c(double)".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('isSignedInteger0')"><a name="isSignedInteger0Anchor">isSignedInteger</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isSignedInteger0"><pre>Matches QualType nodes that are of signed integer type.
+
+Given
+  void a(int);
+  void b(unsigned long);
+  void c(double);
+functionDecl(hasAnyParameter(hasType(isSignedInteger())))
+matches "a(int)", but not "b(unsigned long)" and "c(double)".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('isUnsignedInteger0')"><a name="isUnsignedInteger0Anchor">isUnsignedInteger</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isUnsignedInteger0"><pre>Matches QualType nodes that are of unsigned integer type.
+
+Given
+  void a(int);
+  void b(unsigned long);
+  void c(double);
+functionDecl(hasAnyParameter(hasType(isUnsignedInteger())))
+matches "b(unsigned long)", but not "a(int)" and "c(double)".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>></td><td class="name" onclick="toggle('isVolatileQualified0')"><a name="isVolatileQualified0Anchor">isVolatileQualified</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isVolatileQualified0"><pre>Matches QualType nodes that are volatile-qualified, i.e., that
+include "top-level" volatile.
+
+Given
+  void a(int);
+  void b(int volatile);
+  void c(volatile int);
+  void d(volatile int*);
+  void e(int volatile) {};
+functionDecl(hasAnyParameter(hasType(isVolatileQualified())))
+  matches "void b(int volatile)", "void c(volatile int)" and
+  "void e(int volatile) {}". It does not match d as there
+  is no top-level volatile on the parameter type "volatile int *".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordDecl.html">RecordDecl</a>></td><td class="name" onclick="toggle('isClass0')"><a name="isClass0Anchor">isClass</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isClass0"><pre>Matches RecordDecl object that are spelled with "class."
+
+Example matches C, but not S or U.
+  struct S {};
+  class C {};
+  union U {};
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordDecl.html">RecordDecl</a>></td><td class="name" onclick="toggle('isStruct0')"><a name="isStruct0Anchor">isStruct</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isStruct0"><pre>Matches RecordDecl object that are spelled with "struct."
+
+Example matches S, but not C or U.
+  struct S {};
+  class C {};
+  union U {};
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordDecl.html">RecordDecl</a>></td><td class="name" onclick="toggle('isUnion0')"><a name="isUnion0Anchor">isUnion</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isUnion0"><pre>Matches RecordDecl object that are spelled with "union."
+
+Example matches U, but not C or S.
+  struct S {};
+  class C {};
+  union U {};
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('equalsBoundNode0')"><a name="equalsBoundNode0Anchor">equalsBoundNode</a></td><td>std::string ID</td></tr>
+<tr><td colspan="4" class="doc" id="equalsBoundNode0"><pre>Matches if a node equals a previously bound node.
+
+Matches a node if it equals the node previously bound to ID.
+
+Given
+  class X { int a; int b; };
+cxxRecordDecl(
+    has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
+    has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
+  matches the class X, as a and b have the same type.
+
+Note that when multiple matches are involved via forEach* matchers,
+equalsBoundNodes acts as a filter.
+For example:
+compoundStmt(
+    forEachDescendant(varDecl().bind("d")),
+    forEachDescendant(declRefExpr(to(decl(equalsBoundNode("d"))))))
+will trigger a match for each combination of variable declaration
+and reference to that variable declaration within a compound statement.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('equalsNode1')"><a name="equalsNode1Anchor">equalsNode</a></td><td>const Stmt* Other</td></tr>
+<tr><td colspan="4" class="doc" id="equalsNode1"><pre>Matches if a node equals another node.
+
+Stmt has pointer identity in the AST.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('isExpansionInFileMatching1')"><a name="isExpansionInFileMatching1Anchor">isExpansionInFileMatching</a></td><td>std::string RegExp</td></tr>
+<tr><td colspan="4" class="doc" id="isExpansionInFileMatching1"><pre>Matches AST nodes that were expanded within files whose name is
+partially matching a given regex.
+
+Example matches Y but not X
+    (matcher = cxxRecordDecl(isExpansionInFileMatching("AST.*"))
+  #include "ASTMatcher.h"
+  class X {};
+ASTMatcher.h:
+  class Y {};
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('isExpansionInMainFile1')"><a name="isExpansionInMainFile1Anchor">isExpansionInMainFile</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExpansionInMainFile1"><pre>Matches AST nodes that were expanded within the main-file.
+
+Example matches X but not Y
+  (matcher = cxxRecordDecl(isExpansionInMainFile())
+  #include <Y.h>
+  class X {};
+Y.h:
+  class Y {};
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('isExpansionInSystemHeader1')"><a name="isExpansionInSystemHeader1Anchor">isExpansionInSystemHeader</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExpansionInSystemHeader1"><pre>Matches AST nodes that were expanded within system-header-files.
+
+Example matches Y but not X
+    (matcher = cxxRecordDecl(isExpansionInSystemHeader())
+  #include <SystemHeader.h>
+  class X {};
+SystemHeader.h:
+  class Y {};
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1StringLiteral.html">StringLiteral</a>></td><td class="name" onclick="toggle('hasSize1')"><a name="hasSize1Anchor">hasSize</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="hasSize1"><pre>Matches nodes that have the specified size.
+
+Given
+  int a[42];
+  int b[2 * 21];
+  int c[41], d[43];
+  char *s = "abcd";
+  wchar_t *ws = L"abcd";
+  char *w = "a";
+constantArrayType(hasSize(42))
+  matches "int a[42]" and "int b[2 * 21]"
+stringLiteral(hasSize(4))
+  matches "abcd", L"abcd"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TagDecl.html">TagDecl</a>></td><td class="name" onclick="toggle('isDefinition0')"><a name="isDefinition0Anchor">isDefinition</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDefinition0"><pre>Matches if a declaration has a body attached.
+
+Example matches A, va, fa
+  class A {};
+  class B;  Doesn't match, as it has no body.
+  int va;
+  extern int vb;  Doesn't match, as it doesn't define the variable.
+  void fa() {}
+  void fb();  Doesn't match, as it has no body.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TagDecl.html">TagDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>></td><td class="name" onclick="toggle('equalsIntegralValue0')"><a name="equalsIntegralValue0Anchor">equalsIntegralValue</a></td><td>std::string Value</td></tr>
+<tr><td colspan="4" class="doc" id="equalsIntegralValue0"><pre>Matches a TemplateArgument of integral type with a given value.
+
+Note that 'Value' is a string as the template argument's value is
+an arbitrary precision integer. 'Value' must be euqal to the canonical
+representation of that integral value in base 10.
+
+Given
+  template<int T> struct A {};
+  C<42> c;
+classTemplateSpecializationDecl(
+  hasAnyTemplateArgument(equalsIntegralValue("42")))
+  matches the implicit instantiation of C in C<42>.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>></td><td class="name" onclick="toggle('isIntegral0')"><a name="isIntegral0Anchor">isIntegral</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isIntegral0"><pre>Matches a TemplateArgument that is an integral value.
+
+Given
+  template<int T> struct A {};
+  C<42> c;
+classTemplateSpecializationDecl(
+  hasAnyTemplateArgument(isIntegral()))
+  matches the implicit instantiation of C in C<42>
+  with isIntegral() matching 42.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>></td><td class="name" onclick="toggle('templateArgumentCountIs1')"><a name="templateArgumentCountIs1Anchor">templateArgumentCountIs</a></td><td>unsigned N</td></tr>
+<tr><td colspan="4" class="doc" id="templateArgumentCountIs1"><pre>Matches if the number of template arguments equals N.
+
+Given
+  template<typename T> struct C {};
+  C<int> c;
+classTemplateSpecializationDecl(templateArgumentCountIs(1))
+  matches C<int>.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td><td class="name" onclick="toggle('isExpansionInFileMatching2')"><a name="isExpansionInFileMatching2Anchor">isExpansionInFileMatching</a></td><td>std::string RegExp</td></tr>
+<tr><td colspan="4" class="doc" id="isExpansionInFileMatching2"><pre>Matches AST nodes that were expanded within files whose name is
+partially matching a given regex.
+
+Example matches Y but not X
+    (matcher = cxxRecordDecl(isExpansionInFileMatching("AST.*"))
+  #include "ASTMatcher.h"
+  class X {};
+ASTMatcher.h:
+  class Y {};
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td><td class="name" onclick="toggle('isExpansionInMainFile2')"><a name="isExpansionInMainFile2Anchor">isExpansionInMainFile</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExpansionInMainFile2"><pre>Matches AST nodes that were expanded within the main-file.
+
+Example matches X but not Y
+  (matcher = cxxRecordDecl(isExpansionInMainFile())
+  #include <Y.h>
+  class X {};
+Y.h:
+  class Y {};
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td><td class="name" onclick="toggle('isExpansionInSystemHeader2')"><a name="isExpansionInSystemHeader2Anchor">isExpansionInSystemHeader</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExpansionInSystemHeader2"><pre>Matches AST nodes that were expanded within system-header-files.
+
+Example matches Y but not X
+    (matcher = cxxRecordDecl(isExpansionInSystemHeader())
+  #include <SystemHeader.h>
+  class X {};
+SystemHeader.h:
+  class Y {};
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('booleanType0')"><a name="booleanType0Anchor">booleanType</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="booleanType0"><pre>Matches type bool.
+
+Given
+ struct S { bool func(); };
+functionDecl(returns(booleanType()))
+  matches "bool func();"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('equalsBoundNode2')"><a name="equalsBoundNode2Anchor">equalsBoundNode</a></td><td>std::string ID</td></tr>
+<tr><td colspan="4" class="doc" id="equalsBoundNode2"><pre>Matches if a node equals a previously bound node.
+
+Matches a node if it equals the node previously bound to ID.
+
+Given
+  class X { int a; int b; };
+cxxRecordDecl(
+    has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
+    has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
+  matches the class X, as a and b have the same type.
+
+Note that when multiple matches are involved via forEach* matchers,
+equalsBoundNodes acts as a filter.
+For example:
+compoundStmt(
+    forEachDescendant(varDecl().bind("d")),
+    forEachDescendant(declRefExpr(to(decl(equalsBoundNode("d"))))))
+will trigger a match for each combination of variable declaration
+and reference to that variable declaration within a compound statement.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('equalsNode2')"><a name="equalsNode2Anchor">equalsNode</a></td><td>const Type* Other</td></tr>
+<tr><td colspan="4" class="doc" id="equalsNode2"><pre>Matches if a node equals another node.
+
+Type has pointer identity in the AST.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('realFloatingPointType0')"><a name="realFloatingPointType0Anchor">realFloatingPointType</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="realFloatingPointType0"><pre>Matches any real floating-point type (float, double, long double).
+
+Given
+  int i;
+  float f;
+realFloatingPointType()
+  matches "float f" but not "int i"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td><td class="name" onclick="toggle('voidType0')"><a name="voidType0Anchor">voidType</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="voidType0"><pre>Matches type void.
+
+Given
+ struct S { void func(); };
+functionDecl(returns(voidType()))
+  matches "void func();"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryExprOrTypeTraitExpr.html">UnaryExprOrTypeTraitExpr</a>></td><td class="name" onclick="toggle('ofKind0')"><a name="ofKind0Anchor">ofKind</a></td><td>UnaryExprOrTypeTrait Kind</td></tr>
+<tr><td colspan="4" class="doc" id="ofKind0"><pre>Matches unary expressions of a certain kind.
+
+Given
+  int x;
+  int s = sizeof(x) + alignof(x)
+unaryExprOrTypeTraitExpr(ofKind(UETT_SizeOf))
+  matches sizeof(x)
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryOperator.html">UnaryOperator</a>></td><td class="name" onclick="toggle('hasOperatorName1')"><a name="hasOperatorName1Anchor">hasOperatorName</a></td><td>std::string Name</td></tr>
+<tr><td colspan="4" class="doc" id="hasOperatorName1"><pre>Matches the operator Name of operator expressions (binary or
+unary).
+
+Example matches a || b (matcher = binaryOperator(hasOperatorName("||")))
+  !(a || b)
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('hasAutomaticStorageDuration0')"><a name="hasAutomaticStorageDuration0Anchor">hasAutomaticStorageDuration</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasAutomaticStorageDuration0"><pre>Matches a variable declaration that has automatic storage duration.
+
+Example matches x, but not y, z, or a.
+(matcher = varDecl(hasAutomaticStorageDuration())
+void f() {
+  int x;
+  static int y;
+  thread_local int z;
+}
+int a;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('hasGlobalStorage0')"><a name="hasGlobalStorage0Anchor">hasGlobalStorage</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasGlobalStorage0"><pre>Matches a variable declaration that does not have local storage.
+
+Example matches y and z (matcher = varDecl(hasGlobalStorage())
+void f() {
+  int x;
+  static int y;
+}
+int z;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('hasLocalStorage0')"><a name="hasLocalStorage0Anchor">hasLocalStorage</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasLocalStorage0"><pre>Matches a variable declaration that has function scope and is a
+non-static local variable.
+
+Example matches x (matcher = varDecl(hasLocalStorage())
+void f() {
+  int x;
+  static int y;
+}
+int z;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('hasStaticStorageDuration0')"><a name="hasStaticStorageDuration0Anchor">hasStaticStorageDuration</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasStaticStorageDuration0"><pre>Matches a variable declaration that has static storage duration.
+It includes the variable declared at namespace scope and those declared
+with "static" and "extern" storage class specifiers.
+
+void f() {
+  int x;
+  static int y;
+  thread_local int z;
+}
+int a;
+static int b;
+extern int c;
+varDecl(hasStaticStorageDuration())
+  matches the function declaration y, a, b and c.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('hasThreadStorageDuration0')"><a name="hasThreadStorageDuration0Anchor">hasThreadStorageDuration</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="hasThreadStorageDuration0"><pre>Matches a variable declaration that has thread storage duration.
+
+Example matches z, but not x, z, or a.
+(matcher = varDecl(hasThreadStorageDuration())
+void f() {
+  int x;
+  static int y;
+  thread_local int z;
+}
+int a;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isConstexpr0')"><a name="isConstexpr0Anchor">isConstexpr</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isConstexpr0"><pre>Matches constexpr variable and function declarations.
+
+Given:
+  constexpr int foo = 42;
+  constexpr int bar();
+varDecl(isConstexpr())
+  matches the declaration of foo.
+functionDecl(isConstexpr())
+  matches the declaration of bar.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isDefinition1')"><a name="isDefinition1Anchor">isDefinition</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isDefinition1"><pre>Matches if a declaration has a body attached.
+
+Example matches A, va, fa
+  class A {};
+  class B;  Doesn't match, as it has no body.
+  int va;
+  extern int vb;  Doesn't match, as it doesn't define the variable.
+  void fa() {}
+  void fb();  Doesn't match, as it has no body.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TagDecl.html">TagDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isExceptionVariable0')"><a name="isExceptionVariable0Anchor">isExceptionVariable</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExceptionVariable0"><pre>Matches a variable declaration that is an exception variable from
+a C++ catch block, or an Objective-C statement.
+
+Example matches x (matcher = varDecl(isExceptionVariable())
+void f(int y) {
+  try {
+  } catch (int x) {
+  }
+}
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isExplicitTemplateSpecialization1')"><a name="isExplicitTemplateSpecialization1Anchor">isExplicitTemplateSpecialization</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExplicitTemplateSpecialization1"><pre>Matches explicit template specializations of function, class, or
+static member variable template instantiations.
+
+Given
+  template<typename T> void A(T t) { }
+  template<> void A(int N) { }
+functionDecl(isExplicitTemplateSpecialization())
+  matches the specialization A<int>().
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isExternC1')"><a name="isExternC1Anchor">isExternC</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isExternC1"><pre>Matches extern "C" function declarations.
+
+Given:
+  extern "C" void f() {}
+  extern "C" { void g() {} }
+  void h() {}
+functionDecl(isExternC())
+  matches the declaration of f and g, but not the declaration h
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isStaticStorageClass1')"><a name="isStaticStorageClass1Anchor">isStaticStorageClass</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isStaticStorageClass1"><pre>Matches variablefunction declarations that have "static" storage
+class specifier ("static" keyword) written in the source.
+
+Given:
+  static void f() {}
+  static int i = 0;
+  extern int j;
+  int k;
+functionDecl(isStaticStorageClass())
+  matches the function declaration f.
+varDecl(isStaticStorageClass())
+  matches the variable declaration i.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>></td><td class="name" onclick="toggle('isTemplateInstantiation1')"><a name="isTemplateInstantiation1Anchor">isTemplateInstantiation</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isTemplateInstantiation1"><pre>Matches template instantiations of function, class, or static
+member variable template instantiations.
+
+Given
+  template <typename T> class X {}; class A {}; X<A> x;
+or
+  template <typename T> class X {}; class A {}; template class X<A>;
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
+  matches the template instantiation of X<A>.
+
+But given
+  template <typename T>  class X {}; class A {};
+  template <> class X<A> {}; X<A> x;
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
+  does not match, as X<A> is an explicit template specialization.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<internal::Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>></td><td class="name" onclick="toggle('isInstantiated0')"><a name="isInstantiated0Anchor">isInstantiated</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isInstantiated0"><pre>Matches declarations that are template instantiations or are inside
+template instantiations.
+
+Given
+  template<typename T> void A(T t) { T i; }
+  A(0);
+  A(0U);
+functionDecl(isInstantiated())
+  matches 'A(int) {...};' and 'A(unsigned) {...}'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<internal::Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>></td><td class="name" onclick="toggle('nullPointerConstant0')"><a name="nullPointerConstant0Anchor">nullPointerConstant</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="nullPointerConstant0"><pre>Matches expressions that resolve to a null pointer constant, such as
+GNU's __null, C++11's nullptr, or C's NULL macro.
+
+Given:
+  void *v1 = NULL;
+  void *v2 = nullptr;
+  void *v3 = __null; GNU extension
+  char *cp = (char *)0;
+  int *ip = 0;
+  int i = 0;
+expr(nullPointerConstant())
+  matches the initializer for v1, v2, v3, cp, and ip. Does not match the
+  initializer for i.
+</pre></td></tr>
+
+
+<tr><td>Matcher<internal::Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>>></td><td class="name" onclick="toggle('hasAnyName0')"><a name="hasAnyName0Anchor">hasAnyName</a></td><td>StringRef, ..., StringRef</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyName0"><pre>Matches NamedDecl nodes that have any of the specified names.
+
+This matcher is only provided as a performance optimization of hasName.
+    hasAnyName(a, b, c)
+ is equivalent to, but faster than
+    anyOf(hasName(a), hasName(b), hasName(c))
+</pre></td></tr>
+
+
+<tr><td>Matcher<internal::Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>></td><td class="name" onclick="toggle('isInTemplateInstantiation0')"><a name="isInTemplateInstantiation0Anchor">isInTemplateInstantiation</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isInTemplateInstantiation0"><pre>Matches statements inside of a template instantiation.
+
+Given
+  int j;
+  template<typename T> void A(T t) { T i; j += 42;}
+  A(0);
+  A(0U);
+declStmt(isInTemplateInstantiation())
+  matches 'int i;' and 'unsigned i'.
+unless(stmt(isInTemplateInstantiation()))
+  will NOT match j += 42; as it's shared between the template definition and
+  instantiation.
+</pre></td></tr>
+
+<!--END_NARROWING_MATCHERS -->
+</table>
+
+<!-- ======================================================================= -->
+<h2 id="traversal-matchers">AST Traversal Matchers</h2>
+<!-- ======================================================================= -->
+
+<p>Traversal matchers specify the relationship to other nodes that are
+reachable from the current node.</p>
+
+<p>Note that there are special traversal matchers (has, hasDescendant, forEach and
+forEachDescendant) which work on all nodes and allow users to write more generic
+match expressions.</p>
+
+<table>
+<tr style="text-align:left"><th>Return type</th><th>Name</th><th>Parameters</th></tr>
+<!-- START_TRAVERSAL_MATCHERS -->
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('eachOf0')"><a name="eachOf0Anchor">eachOf</a></td><td>Matcher<*>, ..., Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="eachOf0"><pre>Matches if any of the given matchers matches.
+
+Unlike anyOf, eachOf will generate a match result for each
+matching submatcher.
+
+For example, in:
+  class A { int a; int b; };
+The matcher:
+  cxxRecordDecl(eachOf(has(fieldDecl(hasName("a")).bind("v")),
+                       has(fieldDecl(hasName("b")).bind("v"))))
+will generate two results binding "v", the first of which binds
+the field declaration of a, the second the field declaration of
+b.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('forEachDescendant0')"><a name="forEachDescendant0Anchor">forEachDescendant</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="forEachDescendant0"><pre>Matches AST nodes that have descendant AST nodes that match the
+provided matcher.
+
+Example matches X, A, B, C
+  (matcher = cxxRecordDecl(forEachDescendant(cxxRecordDecl(hasName("X")))))
+  class X {};  Matches X, because X::X is a class of name X inside X.
+  class A { class X {}; };
+  class B { class C { class X {}; }; };
+
+DescendantT must be an AST base type.
+
+As opposed to 'hasDescendant', 'forEachDescendant' will cause a match for
+each result that matches instead of only on the first one.
+
+Note: Recursively combined ForEachDescendant can cause many matches:
+  cxxRecordDecl(forEachDescendant(cxxRecordDecl(
+    forEachDescendant(cxxRecordDecl())
+  )))
+will match 10 times (plus injected class name matches) on:
+  class A { class B { class C { class D { class E {}; }; }; }; };
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('forEach0')"><a name="forEach0Anchor">forEach</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="forEach0"><pre>Matches AST nodes that have child AST nodes that match the
+provided matcher.
+
+Example matches X, Y
+  (matcher = cxxRecordDecl(forEach(cxxRecordDecl(hasName("X")))
+  class X {};  Matches X, because X::X is a class of name X inside X.
+  class Y { class X {}; };
+  class Z { class Y { class X {}; }; };  Does not match Z.
+
+ChildT must be an AST base type.
+
+As opposed to 'has', 'forEach' will cause a match for each result that
+matches instead of only on the first one.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasAncestor0')"><a name="hasAncestor0Anchor">hasAncestor</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="hasAncestor0"><pre>Matches AST nodes that have an ancestor that matches the provided
+matcher.
+
+Given
+void f() { if (true) { int x = 42; } }
+void g() { for (;;) { int x = 43; } }
+expr(integerLiteral(hasAncestor(ifStmt()))) matches 42, but not 43.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasDescendant0')"><a name="hasDescendant0Anchor">hasDescendant</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="hasDescendant0"><pre>Matches AST nodes that have descendant AST nodes that match the
+provided matcher.
+
+Example matches X, Y, Z
+    (matcher = cxxRecordDecl(hasDescendant(cxxRecordDecl(hasName("X")))))
+  class X {};  Matches X, because X::X is a class of name X inside X.
+  class Y { class X {}; };
+  class Z { class Y { class X {}; }; };
+
+DescendantT must be an AST base type.
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('has0')"><a name="has0Anchor">has</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="has0"><pre>Matches AST nodes that have child AST nodes that match the
+provided matcher.
+
+Example matches X, Y
+  (matcher = cxxRecordDecl(has(cxxRecordDecl(hasName("X")))
+  class X {};  Matches X, because X::X is a class of name X inside X.
+  class Y { class X {}; };
+  class Z { class Y { class X {}; }; };  Does not match Z.
+
+ChildT must be an AST base type.
+
+Usable as: Any Matcher
+Note that has is direct matcher, so it also matches things like implicit
+casts and paren casts. If you are matching with expr then you should
+probably consider using ignoringParenImpCasts like:
+has(ignoringParenImpCasts(expr())).
+</pre></td></tr>
+
+
+<tr><td>Matcher<*></td><td class="name" onclick="toggle('hasParent0')"><a name="hasParent0Anchor">hasParent</a></td><td>Matcher<*></td></tr>
+<tr><td colspan="4" class="doc" id="hasParent0"><pre>Matches AST nodes that have a parent that matches the provided
+matcher.
+
+Given
+void f() { for (;;) { int x = 42; if (true) { int x = 43; } } }
+compoundStmt(hasParent(ifStmt())) matches "{ int x = 43; }".
+
+Usable as: Any Matcher
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AbstractConditionalOperator.html">AbstractConditionalOperator</a>></td><td class="name" onclick="toggle('hasCondition5')"><a name="hasCondition5Anchor">hasCondition</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasCondition5"><pre>Matches the condition expression of an if statement, for loop,
+switch statement or conditional operator.
+
+Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
+  if (true) {}
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AbstractConditionalOperator.html">AbstractConditionalOperator</a>></td><td class="name" onclick="toggle('hasFalseExpression0')"><a name="hasFalseExpression0Anchor">hasFalseExpression</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasFalseExpression0"><pre>Matches the false branch expression of a conditional operator
+(binary or ternary).
+
+Example matches b
+  condition ? a : b
+  condition ?: b
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AbstractConditionalOperator.html">AbstractConditionalOperator</a>></td><td class="name" onclick="toggle('hasTrueExpression0')"><a name="hasTrueExpression0Anchor">hasTrueExpression</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasTrueExpression0"><pre>Matches the true branch expression of a conditional operator.
+
+Example 1 (conditional ternary operator): matches a
+  condition ? a : b
+
+Example 2 (conditional binary operator): matches opaqueValueExpr(condition)
+  condition ?: b
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AddrLabelExpr.html">AddrLabelExpr</a>></td><td class="name" onclick="toggle('hasDeclaration15')"><a name="hasDeclaration15Anchor">hasDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration15"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+- for CXXNewExpr, the declaration of the operator new
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AddrLabelExpr.html">AddrLabelExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArraySubscriptExpr.html">ArraySubscriptExpr</a>></td><td class="name" onclick="toggle('hasBase0')"><a name="hasBase0Anchor">hasBase</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasBase0"><pre>Matches the base expression of an array subscript expression.
+
+Given
+  int i[5];
+  void f() { i[1] = 42; }
+arraySubscriptExpression(hasBase(implicitCastExpr(
+    hasSourceExpression(declRefExpr()))))
+  matches i[1] with the declRefExpr() matching i
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArraySubscriptExpr.html">ArraySubscriptExpr</a>></td><td class="name" onclick="toggle('hasIndex0')"><a name="hasIndex0Anchor">hasIndex</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasIndex0"><pre>Matches the index expression of an array subscript expression.
+
+Given
+  int i[5];
+  void f() { i[1] = 42; }
+arraySubscriptExpression(hasIndex(integerLiteral()))
+  matches i[1] with the integerLiteral() matching 1
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArraySubscriptExpr.html">ArraySubscriptExpr</a>></td><td class="name" onclick="toggle('hasLHS1')"><a name="hasLHS1Anchor">hasLHS</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasLHS1"><pre>Matches the left hand side of binary operator expressions.
+
+Example matches a (matcher = binaryOperator(hasLHS()))
+  a || b
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArraySubscriptExpr.html">ArraySubscriptExpr</a>></td><td class="name" onclick="toggle('hasRHS1')"><a name="hasRHS1Anchor">hasRHS</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasRHS1"><pre>Matches the right hand side of binary operator expressions.
+
+Example matches b (matcher = binaryOperator(hasRHS()))
+  a || b
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayTypeLoc.html">ArrayTypeLoc</a>></td><td class="name" onclick="toggle('hasElementTypeLoc0')"><a name="hasElementTypeLoc0Anchor">hasElementTypeLoc</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasElementTypeLoc0"><pre>Matches arrays and C99 complex types that have a specific element
+type.
+
+Given
+  struct A {};
+  A a[7];
+  int b[7];
+arrayType(hasElementType(builtinType()))
+  matches "int b[7]"
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>></td><td class="name" onclick="toggle('hasElementType0')"><a name="hasElementType0Anchor">hasElementType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasElementType0"><pre>Matches arrays and C99 complex types that have a specific element
+type.
+
+Given
+  struct A {};
+  A a[7];
+  int b[7];
+arrayType(hasElementType(builtinType()))
+  matches "int b[7]"
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicTypeLoc.html">AtomicTypeLoc</a>></td><td class="name" onclick="toggle('hasValueTypeLoc0')"><a name="hasValueTypeLoc0Anchor">hasValueTypeLoc</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasValueTypeLoc0"><pre>Matches atomic types with a specific value type.
+
+Given
+  _Atomic(int) i;
+  _Atomic(float) f;
+atomicType(hasValueType(isInteger()))
+ matches "_Atomic(int) i"
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicType.html">AtomicType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicType.html">AtomicType</a>></td><td class="name" onclick="toggle('hasValueType0')"><a name="hasValueType0Anchor">hasValueType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasValueType0"><pre>Matches atomic types with a specific value type.
+
+Given
+  _Atomic(int) i;
+  _Atomic(float) f;
+atomicType(hasValueType(isInteger()))
+ matches "_Atomic(int) i"
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AtomicType.html">AtomicType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AutoType.html">AutoType</a>></td><td class="name" onclick="toggle('hasDeducedType0')"><a name="hasDeducedType0Anchor">hasDeducedType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasDeducedType0"><pre>Matches AutoType nodes where the deduced type is a specific type.
+
+Note: There is no TypeLoc for the deduced type and thus no
+getDeducedLoc() matcher.
+
+Given
+  auto a = 1;
+  auto b = 2.0;
+autoType(hasDeducedType(isInteger()))
+  matches "auto a"
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AutoType.html">AutoType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html">BinaryOperator</a>></td><td class="name" onclick="toggle('hasEitherOperand0')"><a name="hasEitherOperand0Anchor">hasEitherOperand</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasEitherOperand0"><pre>Matches if either the left hand side or the right hand side of a
+binary operator matches.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html">BinaryOperator</a>></td><td class="name" onclick="toggle('hasLHS0')"><a name="hasLHS0Anchor">hasLHS</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasLHS0"><pre>Matches the left hand side of binary operator expressions.
+
+Example matches a (matcher = binaryOperator(hasLHS()))
+  a || b
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BinaryOperator.html">BinaryOperator</a>></td><td class="name" onclick="toggle('hasRHS0')"><a name="hasRHS0Anchor">hasRHS</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasRHS0"><pre>Matches the right hand side of binary operator expressions.
+
+Example matches b (matcher = binaryOperator(hasRHS()))
+  a || b
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerTypeLoc.html">BlockPointerTypeLoc</a>></td><td class="name" onclick="toggle('pointeeLoc0')"><a name="pointeeLoc0Anchor">pointeeLoc</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="pointeeLoc0"><pre>Narrows PointerType (and similar) matchers to those where the
+pointee matches a given matcher.
+
+Given
+  int *a;
+  int const *b;
+  float const *f;
+pointerType(pointee(isConstQualified(), isInteger()))
+  matches "int const *b"
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>></td><td class="name" onclick="toggle('pointee0')"><a name="pointee0Anchor">pointee</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="pointee0"><pre>Narrows PointerType (and similar) matchers to those where the
+pointee matches a given matcher.
+
+Given
+  int *a;
+  int const *b;
+  float const *f;
+pointerType(pointee(isConstQualified(), isInteger()))
+  matches "int const *b"
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BlockPointerType.html">BlockPointerType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberPointerType.html">MemberPointerType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1PointerType.html">PointerType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ReferenceType.html">ReferenceType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('forEachArgumentWithParam1')"><a name="forEachArgumentWithParam1Anchor">forEachArgumentWithParam</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> ArgMatcher, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ParmVarDecl.html">ParmVarDecl</a>> ParamMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="forEachArgumentWithParam1"><pre>Matches all arguments and their respective ParmVarDecl.
+
+Given
+  void f(int i);
+  int y;
+  f(y);
+callExpr(
+  forEachArgumentWithParam(
+    declRefExpr(to(varDecl(hasName("y")))),
+    parmVarDecl(hasType(isInteger()))
+))
+  matches f(y);
+with declRefExpr(...)
+  matching int y
+and parmVarDecl(...)
+  matching int i
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('hasAnyArgument1')"><a name="hasAnyArgument1Anchor">hasAnyArgument</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyArgument1"><pre>Matches any argument of a call expression or a constructor call
+expression.
+
+Given
+  void x(int, int, int) { int y; x(1, y, 42); }
+callExpr(hasAnyArgument(declRefExpr()))
+  matches x(1, y, 42)
+with hasAnyArgument(...)
+  matching y
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('hasArgument1')"><a name="hasArgument1Anchor">hasArgument</a></td><td>unsigned N, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasArgument1"><pre>Matches the n'th argument of a call expression or a constructor
+call expression.
+
+Example matches y in x(y)
+    (matcher = callExpr(hasArgument(0, declRefExpr())))
+  void x(int) { int y; x(y); }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>></td><td class="name" onclick="toggle('hasDeclaration13')"><a name="hasDeclaration13Anchor">hasDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration13"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+- for CXXNewExpr, the declaration of the operator new
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AddrLabelExpr.html">AddrLabelExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('forEachConstructorInitializer0')"><a name="forEachConstructorInitializer0Anchor">forEachConstructorInitializer</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="forEachConstructorInitializer0"><pre>Matches each constructor initializer in a constructor definition.
+
+Given
+  class A { A() : i(42), j(42) {} int i; int j; };
+cxxConstructorDecl(forEachConstructorInitializer(
+  forField(decl().bind("x"))
+))
+  will trigger two matches, binding for 'i' and 'j' respectively.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('hasAnyConstructorInitializer0')"><a name="hasAnyConstructorInitializer0Anchor">hasAnyConstructorInitializer</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyConstructorInitializer0"><pre>Matches a constructor initializer.
+
+Given
+  struct Foo {
+    Foo() : foo_(1) { }
+    int foo_;
+  };
+cxxRecordDecl(has(cxxConstructorDecl(
+  hasAnyConstructorInitializer(anything())
+)))
+  record matches Foo, hasAnyConstructorInitializer matches foo_(1)
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('forField0')"><a name="forField0Anchor">forField</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FieldDecl.html">FieldDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="forField0"><pre>Matches the field declaration of a constructor initializer.
+
+Given
+  struct Foo {
+    Foo() : foo_(1) { }
+    int foo_;
+  };
+cxxRecordDecl(has(cxxConstructorDecl(hasAnyConstructorInitializer(
+    forField(hasName("foo_"))))))
+  matches Foo
+with forField matching foo_
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('withInitializer0')"><a name="withInitializer0Anchor">withInitializer</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="withInitializer0"><pre>Matches the initializer expression of a constructor initializer.
+
+Given
+  struct Foo {
+    Foo() : foo_(1) { }
+    int foo_;
+  };
+cxxRecordDecl(has(cxxConstructorDecl(hasAnyConstructorInitializer(
+    withInitializer(integerLiteral(equals(1)))))))
+  matches Foo
+with withInitializer matching (1)
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>></td><td class="name" onclick="toggle('hasBody3')"><a name="hasBody3Anchor">hasBody</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasBody3"><pre>Matches a 'for', 'while', 'do while' statement or a function
+definition that has a given body.
+
+Given
+  for (;;) {}
+hasBody(compoundStmt())
+  matches 'for (;;) {}'
+with compoundStmt()
+  matching '{}'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>></td><td class="name" onclick="toggle('hasLoopVariable0')"><a name="hasLoopVariable0Anchor">hasLoopVariable</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasLoopVariable0"><pre>Matches the initialization statement of a for loop.
+
+Example:
+    forStmt(hasLoopVariable(anything()))
+matches 'int x' in
+    for (int x : a) { }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>></td><td class="name" onclick="toggle('hasRangeInit0')"><a name="hasRangeInit0Anchor">hasRangeInit</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasRangeInit0"><pre>Matches the range initialization statement of a for loop.
+
+Example:
+    forStmt(hasRangeInit(anything()))
+matches 'a' in
+    for (int x : a) { }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>></td><td class="name" onclick="toggle('onImplicitObjectArgument0')"><a name="onImplicitObjectArgument0Anchor">onImplicitObjectArgument</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="onImplicitObjectArgument0"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>></td><td class="name" onclick="toggle('on0')"><a name="on0Anchor">on</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="on0"><pre>Matches on the implicit object argument of a member call expression.
+
+Example matches y.x()
+  (matcher = cxxMemberCallExpr(on(hasType(cxxRecordDecl(hasName("Y"))))))
+  class Y { public: void x(); };
+  void z() { Y y; y.x(); }",
+
+FIXME: Overload to allow directly matching types?
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>></td><td class="name" onclick="toggle('thisPointerType1')"><a name="thisPointerType1Anchor">thisPointerType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="thisPointerType1"><pre>Overloaded to match the type's declaration.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>></td><td class="name" onclick="toggle('thisPointerType0')"><a name="thisPointerType0Anchor">thisPointerType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="thisPointerType0"><pre>Matches if the expression's type either matches the specified
+matcher, or is a pointer to a type that matches the InnerMatcher.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('forEachOverridden0')"><a name="forEachOverridden0Anchor">forEachOverridden</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="forEachOverridden0"><pre>Matches each method overriden by the given method. This matcher may
+produce multiple matches.
+
+Given
+  class A { virtual void f(); };
+  class B : public A { void f(); };
+  class C : public B { void f(); };
+cxxMethodDecl(ofClass(hasName("C")),
+              forEachOverridden(cxxMethodDecl().bind("b"))).bind("d")
+  matches once, with "b" binding "A::f" and "d" binding "C::f" (Note
+  that B::f is not overridden by C::f).
+
+The check can produce multiple matches in case of multiple inheritance, e.g.
+  class A1 { virtual void f(); };
+  class A2 { virtual void f(); };
+  class C : public A1, public A2 { void f(); };
+cxxMethodDecl(ofClass(hasName("C")),
+              forEachOverridden(cxxMethodDecl().bind("b"))).bind("d")
+  matches twice, once with "b" binding "A1::f" and "d" binding "C::f", and
+  once with "b" binding "A2::f" and "d" binding "C::f".
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>></td><td class="name" onclick="toggle('ofClass0')"><a name="ofClass0Anchor">ofClass</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="ofClass0"><pre>Matches the class declaration that the given method declaration
+belongs to.
+
+FIXME: Generalize this for other kinds of declarations.
+FIXME: What other kind of declarations would we need to generalize
+this to?
+
+Example matches A() in the last line
+    (matcher = cxxConstructExpr(hasDeclaration(cxxMethodDecl(
+        ofClass(hasName("A"))))))
+  class A {
+   public:
+    A();
+  };
+  A a = A();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>></td><td class="name" onclick="toggle('hasDeclaration12')"><a name="hasDeclaration12Anchor">hasDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration12"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+- for CXXNewExpr, the declaration of the operator new
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AddrLabelExpr.html">AddrLabelExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('hasMethod0')"><a name="hasMethod0Anchor">hasMethod</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasMethod0"><pre>Matches the first method of a class or struct that satisfies InnerMatcher.
+
+Given:
+  class A { void func(); };
+  class B { void member(); };
+
+cxxRecordDecl(hasMethod(hasName("func"))) matches the declaration of
+A but not B.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isDerivedFrom0')"><a name="isDerivedFrom0Anchor">isDerivedFrom</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>> Base</td></tr>
+<tr><td colspan="4" class="doc" id="isDerivedFrom0"><pre>Matches C++ classes that are directly or indirectly derived from
+a class matching Base.
+
+Note that a class is not considered to be derived from itself.
+
+Example matches Y, Z, C (Base == hasName("X"))
+  class X;
+  class Y : public X {};  directly derived
+  class Z : public Y {};  indirectly derived
+  typedef X A;
+  typedef A B;
+  class C : public B {};  derived from a typedef of X
+
+In the following example, Bar matches isDerivedFrom(hasName("X")):
+  class Foo;
+  typedef Foo X;
+  class Bar : public Foo {};  derived from a type that X is a typedef of
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>></td><td class="name" onclick="toggle('isSameOrDerivedFrom0')"><a name="isSameOrDerivedFrom0Anchor">isSameOrDerivedFrom</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>> Base</td></tr>
+<tr><td colspan="4" class="doc" id="isSameOrDerivedFrom0"><pre>Similar to isDerivedFrom(), but also matches classes that directly
+match Base.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('callee1')"><a name="callee1Anchor">callee</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="callee1"><pre>Matches if the call expression's callee's declaration matches the
+given matcher.
+
+Example matches y.x() (matcher = callExpr(callee(
+                                   cxxMethodDecl(hasName("x")))))
+  class Y { public: void x(); };
+  void z() { Y y; y.x(); }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('callee0')"><a name="callee0Anchor">callee</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="callee0"><pre>Matches if the call expression's callee expression matches.
+
+Given
+  class Y { void x() { this->x(); x(); Y y; y.x(); } };
+  void f() { f(); }
+callExpr(callee(expr()))
+  matches this->x(), x(), y.x(), f()
+with callee(...)
+  matching this->x, x, y.x, f respectively
+
+Note: Callee cannot take the more general internal::Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>>
+because this introduces ambiguous overloads with calls to Callee taking a
+internal::Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>, as the matcher hierarchy is purely
+implemented in terms of implicit casts.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('forEachArgumentWithParam0')"><a name="forEachArgumentWithParam0Anchor">forEachArgumentWithParam</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> ArgMatcher, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ParmVarDecl.html">ParmVarDecl</a>> ParamMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="forEachArgumentWithParam0"><pre>Matches all arguments and their respective ParmVarDecl.
+
+Given
+  void f(int i);
+  int y;
+  f(y);
+callExpr(
+  forEachArgumentWithParam(
+    declRefExpr(to(varDecl(hasName("y")))),
+    parmVarDecl(hasType(isInteger()))
+))
+  matches f(y);
+with declRefExpr(...)
+  matching int y
+and parmVarDecl(...)
+  matching int i
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('hasAnyArgument0')"><a name="hasAnyArgument0Anchor">hasAnyArgument</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyArgument0"><pre>Matches any argument of a call expression or a constructor call
+expression.
+
+Given
+  void x(int, int, int) { int y; x(1, y, 42); }
+callExpr(hasAnyArgument(declRefExpr()))
+  matches x(1, y, 42)
+with hasAnyArgument(...)
+  matching y
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('hasArgument0')"><a name="hasArgument0Anchor">hasArgument</a></td><td>unsigned N, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasArgument0"><pre>Matches the n'th argument of a call expression or a constructor
+call expression.
+
+Example matches y in x(y)
+    (matcher = callExpr(hasArgument(0, declRefExpr())))
+  void x(int) { int y; x(y); }
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>></td><td class="name" onclick="toggle('hasDeclaration14')"><a name="hasDeclaration14Anchor">hasDeclaration</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>  InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasDeclaration14"><pre>Matches a node if the declaration associated with that node
+matches the given matcher.
+
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+- for CXXNewExpr, the declaration of the operator new
+
+Also usable as Matcher<T> for any T supporting the getDecl() member
+function. e.g. various subtypes of clang::Type and various expressions.
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1AddrLabelExpr.html">AddrLabelExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallExpr.html">CallExpr</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DeclRefExpr.html">DeclRefExpr</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumType.html">EnumType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1InjectedClassNameType.html">InjectedClassNameType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1LabelStmt.html">LabelStmt</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1QualType.html">QualType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordType.html">RecordType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TagType.html">TagType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateSpecializationType.html">TemplateSpecializationType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateTypeParmType.html">TemplateTypeParmType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypedefType.html">TypedefType</a>>,
+  Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnresolvedUsingType.html">UnresolvedUsingType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CaseStmt.html">CaseStmt</a>></td><td class="name" onclick="toggle('hasCaseConstant0')"><a name="hasCaseConstant0Anchor">hasCaseConstant</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasCaseConstant0"><pre>If the given case statement does not use the GNU case range
+extension, matches the constant given in the statement.
+
+Given
+  switch (1) { case 1: case 1+1: case 3 ... 4: ; }
+caseStmt(hasCaseConstant(integerLiteral()))
+  matches "case 1:"
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CastExpr.html">CastExpr</a>></td><td class="name" onclick="toggle('hasSourceExpression0')"><a name="hasSourceExpression0Anchor">hasSourceExpression</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasSourceExpression0"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>></td><td class="name" onclick="toggle('hasAnyTemplateArgument0')"><a name="hasAnyTemplateArgument0Anchor">hasAnyTemplateArgument</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasAnyTemplateArgument0"><pre>Matches classTemplateSpecializations, templateSpecializationType and
+functionDecl that have at least one TemplateArgument matching the given
+InnerMatcher.
+
+Given
+  template<typename T> class A {};
+  template<> class A<double> {};
+  A<int> a;
+
+  template<typename T> f() {};
+  void func() { f<int>(); };
+
+classTemplateSpecializationDecl(hasAnyTemplateArgument(
+    refersToType(asString("int"))))
+  matches the specialization A<int>
+
+functionDecl(hasAnyTemplateArgument(refersToType(asString("int"))))
+  matches the specialization f<int>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>></td><td class="name" onclick="toggle('hasTemplateArgument0')"><a name="hasTemplateArgument0Anchor">hasTemplateArgument</a></td><td>unsigned N, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TemplateArgument.html">TemplateArgument</a>> InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasTemplateArgument0"><pre>Matches classTemplateSpecializations, templateSpecializationType and
+functionDecl where the n'th TemplateArgument matches the given InnerMatcher.
+
+Given
+  template<typename T, typename U> class A {};
+  A<bool, int> b;
+  A<int, bool> c;
+
+  template<typename T> f() {};
+  void func() { f<int>(); };
+classTemplateSpecializationDecl(hasTemplateArgument(
+    1, refersToType(asString("int"))))
+  matches the specialization A<bool, int>
+
+functionDecl(hasTemplateArgument(0, refersToType(asString("int"))))
+  matches the specialization f<int>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexTypeLoc.html">ComplexTypeLoc</a>></td><td class="name" onclick="toggle('hasElementTypeLoc1')"><a name="hasElementTypeLoc1Anchor">hasElementTypeLoc</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasElementTypeLoc1"><pre>Matches arrays and C99 complex types that have a specific element
+type.
+
+Given
+  struct A {};
+  A a[7];
+  int b[7];
+arrayType(hasElementType(builtinType()))
+  matches "int b[7]"
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>></td><td class="name" onclick="toggle('hasElementType1')"><a name="hasElementType1Anchor">hasElementType</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Type.html">Type</a>></td></tr>
+<tr><td colspan="4" class="doc" id="hasElementType1"><pre>Matches arrays and C99 complex types that have a specific element
+type.
+
+Given
+  struct A {};
+  A a[7];
+  int b[7];
+arrayType(hasElementType(builtinType()))
+  matches "int b[7]"
+
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArrayType.html">ArrayType</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ComplexType.html">ComplexType</a>>
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CompoundStmt.html">CompoundStmt</a>></td><td class="name" onclick="toggle('hasAnySubstatement0')"><a name="hasAnySubstatement0Anchor">hasAnySubstatement</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/cl