List of features and minimum Clang version with support
#1: C++11
| Language Feature | C++11 Proposal | Available in Clang? |
|---|---|---|
| Rvalue references | N2118 | Clang 2.9 |
Rvalue references for *this |
N2439 | Clang 2.9 |
| Initialization of class objects by rvalues | N1610 | Clang 2.9 |
| Non-static data member initializers | N2756 | Clang 3.0 |
| Variadic templates | N2242 | Clang 2.9 |
| Extending variadic template template parameters | N2555 | Clang 2.9 |
| Initializer lists | N2672 | Clang 3.1 |
| Static assertions | N1720 | Clang 2.9 |
auto-typed variables |
N1984 | Clang 2.9 |
Multi-declarator auto |
N1737 | Clang 2.9 |
| Removal of auto as a storage-class specifier | N2546 | Clang 2.9 |
| New function declarator syntax | N2541 | Clang 2.9 |
| Lambda expressions | N2927 | Clang 3.1 |
| P0588R1 (DR) | No | |
| Declared type of an expression | N2343 | Clang 2.9 |
| Incomplete return types | N3276 | Clang 3.1 |
| Right angle brackets | N1757 | Clang 2.9 |
| Default template arguments for function templates | DR226 | Clang 2.9 |
| Solving the SFINAE problem for expressions | DR339 | Clang 2.9 |
| Alias templates | N2258 | Clang 3.0 |
| Extern templates | N1987 | Clang 2.9 |
| Null pointer constant | N2431 | Clang 3.0 |
| Strongly-typed enums | N2347 | Clang 2.9 |
| Forward declarations for enums | N2764 DR1206 |
Clang 3.1 |
| Standardized attribute syntax | N2761 | Clang 3.3 (1) |
| Generalized constant expressions | N2235 | Clang 3.1 |
| P0859R0 (DR) | SVN | |
| Alignment support | N2341 | Clang 3.3 |
| Conditionally-support behavior | N1627 | Clang 2.9 |
| Changing undefined behavior into diagnosable errors | N1727 | Clang 2.9 |
| Delegating constructors | N1986 | Clang 3.0 |
| Inheriting constructors | N2540 | Clang 3.3 |
| P0136R1 (DR) | Clang 3.9 | |
| Explicit conversion operators | N2437 | Clang 3.0 |
| New character types | N2249 | Clang 2.9 |
| Unicode string literals | N2442 | Clang 3.0 |
| Raw string literals | N2442 | Clang 3.0 |
| Universal character names in literals | N2170 | Clang 3.1 |
| User-defined literals | N2765 | Clang 3.1 |
| Standard Layout Types | N2342 | Clang 3.0 |
| Defaulted functions | N2346 | Clang 3.0 |
| Deleted functions | N2346 | Clang 2.9 |
| Extended friend declarations | N1791 | Clang 2.9 |
Extending sizeof |
N2253 DR850 |
Clang 3.1 |
| Inline namespaces | N2535 | Clang 2.9 |
| Unrestricted unions | N2544 | Clang 3.1 |
| Local and unnamed types as template arguments | N2657 | Clang 2.9 |
| Range-based for | N2930 | Clang 3.0 |
| P0962R1 (DR) | SVN | |
| Explicit virtual overrides | N2928 N3206 N3272 |
Clang 3.0 |
| Minimal support for garbage collection and reachability-based leak detection | N2670 | N/A (2) |
| Allowing move constructors to throw [noexcept] | N3050 | Clang 3.0 |
| Defining move special member functions | N3053 | Clang 3.0 |
| Concurrency | ||
| Sequence points | N2239 | Clang 3.3 |
| Atomic operations | N2427 | Clang 3.1 |
| Strong Compare and Exchange | N2748 | Clang 3.1 (3) |
| Bidirectional Fences | N2752 | Clang 3.1 |
| Memory model | N2429 | Clang 3.2 |
| Data-dependency ordering: atomics and memory model | N2664 | Clang 3.2 (4) |
| Propagating exceptions | N2179 | Clang 2.9 |
| Allow atomics use in signal handlers | N2547 | Clang 3.1 |
| Thread-local storage | N2659 | Clang 3.3 (5) |
| Dynamic initialization and destruction with concurrency | N2660 | Clang 2.9 |
| C99 Features in C++11 | ||
__func__ predefined identifier |
N2340 | Clang 2.9 |
| C99 preprocessor | N1653 | Clang 2.9 |
long long |
N1811 | Clang 2.9 |
| Extended integral types | N1988 | N/A (6) |
(1): The [[carries_dependency]] attribute has no effect.
(2): No compiler changes are required for an implementation such as Clang that does not provide garbage collection.
(3): All compare-exchange operations are emitted as strong compare-exchanges.
(4): memory_order_consume is lowered to memory_order_acquire.
(5): thread_local support requires a C++ runtime library providing __cxa_thread_atexit, such as libc++abi 3.6 or later, or libsupc++ 4.8 or later.
(6): No compiler changes are required for an implementation such as Clang that does not provide any extended integer types.
__int128 is not treated as an extended integer type, because changing intmax_t would be an ABI-incompatible change.
#2: C++14
| Language Feature | C++14 Proposal | Available in Clang? |
|---|---|---|
| Tweak to certain C++ contextual conversions | N3323 | Clang 3.4 |
| Binary literals | N3472 | Clang 2.9 |
| decltype(auto) | N3638 | Clang 3.3 |
| Return type deduction for normal functions | Clang 3.4 | |
| Initialized lambda captures | N3648 | Clang 3.4 |
| Generic lambdas | N3649 | Clang 3.4 |
| Variable templates | N3651 | Clang 3.4 |
| Relaxing requirements on constexpr functions | N3652 | Clang 3.4 |
| Member initializers and aggregates | N3653 | Clang 3.3 |
| Clarifying memory allocation | N3664 | Clang 3.4 |
| [[deprecated]] attribute | N3760 | Clang 3.4 |
| Single quotation mark as digit separator | N3781 | Clang 3.4 |
| C++ Sized Deallocation | N3778 | Clang 3.4 (7) |
(7): In Clang 3.7 and later, sized deallocation is only enabled if the user passes the -fsized-deallocation flag.
The user must supply definitions of the sized deallocation functions, either by providing them explicitly or by using a C++ standard library that does. libstdc++ added these functions in version 5.0, and libc++ added them in version 3.7.
#3: C++17
| Language Feature | C++17 Proposal | Available in Clang? |
|---|---|---|
| static_assert with no message | N3928 | Clang 3.5 |
| Disabling trigraph expansion by default | N4086 | Clang 3.5 |
| typename in a template template parameter | N4051 | Clang 3.5 |
| New auto rules for direct-list-initialization | N3922 | Clang 3.8 (8) |
| Fold expressions | N4295 | Clang 3.6 |
| P0036R0 | Clang 3.9 | |
| u8 character literals | N4267 | Clang 3.6 |
| Nested namespace definition | N4230 | Clang 3.6 |
| Attributes for namespaces and enumerators | N4266 | Clang 3.6 |
| Allow constant evaluation for all non-type template arguments | N4268 | Clang 3.6 |
| Remove deprecated register storage class | P0001R1 | Clang 3.8 |
| Remove deprecated bool increment | P0002R1 | Clang 3.8 |
| Make exception specifications part of the type system | P0012R1 | Clang 4 |
| __has_include in preprocessor conditionals | P0061R1 | Yes |
| [[fallthrough]] attribute | P0188R1 | Clang 3.9 |
| [[nodiscard]] attribute | P0189R1 | Clang 3.9 |
| [[maybe_unused]] attribute | P0212R1 | Clang 3.9 |
| Aggregate initialization of classes with base classes | P0017R1 | Clang 3.9 |
| constexpr lambda expressions | P0170R1 | Clang 5 |
| Differing begin and end types in range-based for | P0184R0 | Clang 3.9 |
| Lambda capture of *this | P0018R3 | Clang 3.9 |
| Direct-list-initialization of enums | P0138R2 | Clang 3.9 |
| Hexadecimal floating-point literals | P0245R1 | Yes |
| Using attribute namespaces without repetition | P0028R4 | Clang 3.9 |
| Dynamic memory allocation for over-aligned data | P0035R4 | Clang 4 |
| Template argument deduction for class templates | P0091R3 | Clang 5 |
| P0512R0 | ||
| P0620R0 (DR) | Clang 7 | |
| P0702R1 (DR) | Clang 6 | |
| Non-type template parameters with auto type | P0127R2 | Clang 4 |
| Guaranteed copy elision | P0135R1 | Clang 4 |
| Stricter expression evaluation order | P0145R3 | Clang 4 (9) |
| P0400R0 | ||
| Requirement to ignore unknown attributes | P0283R2 | Yes |
| constexpr if-statements | P0292R2 | Clang 3.9 |
| Inline variables | P0386R2 | Clang 3.9 |
| Structured bindings | P0217R3 | Clang 4 |
| P0961R1 (DR) | SVN | |
| P0969R0 (DR) | SVN | |
| Separate variable and condition for if and switch | P0305R1 | Clang 3.9 |
| Matching template template parameters to compatible arguments | P0522R0 | Partial (10) |
| Removing deprecated dynamic exception specifications | P0003R5 | Clang 4 |
| Pack expansions in using-declarations | P0195R2 | Clang 4 |
(8): This is a backwards-incompatible change that is applied to all language versions that allow type deduction from auto (per the request of the C++ committee). In Clang 3.7, a warning is emitted for all cases that would change meaning.
(9): Under the MS ABI, function parameters are destroyed from left to right in the callee. As a result, function parameters in calls to operator<<, operator>>, operator->*, operator&&, operator||, and operator,
functions using expression syntax are no longer guaranteed to be destroyed in reverse construction order in that ABI.
(10): Despite being the resolution to a Defect Report, this feature is disabled by default in all language versions, and can be enabled explicitly with the flag -frelaxed-template-template-args in Clang 4 onwards.
The change to the standard lacks a corresponding change for template partial ordering, resulting in ambiguity errors for reasonable and previously-valid code. This issue is expected to be rectified soon.
#4:C++2a
Clang has experimental support for some proposed features of the C++ standard following C++17, provisionally named C++2a. Note that support for these features may change or be removed without notice, as the draft C++2a standard evolves.
You can use Clang in C++2a mode with the -std=c++2a option.
List of features and minimum Clang version with support
| Language Feature | C++2a Proposal | Available in Clang? |
|---|---|---|
| Default member initializers for bit-fields | P0683R1 | Clang 6 |
| const&-qualified pointers to members | P0704R1 | Clang 6 |
| Allow lambda-capture [=, this] | P0409R2 | Clang 6 |
| __VA_OPT__ for preprocessor comma elision | P0306R4 | Clang 6 |
| P1042R1 | Partial | |
| Designated initializers | P0329R4 | Partial (extension) |
| template-parameter-list for generic lambdas | P0428R2 | No |
| Concepts | P0734R0 | No |
| P0857R0 | ||
| P1084R2 | ||
| P1414R2 | ||
| Range-based for statements with initializer | P0614R1 | SVN |
| ADL and function templates that are not visible | P0846R0 | No |
| const mismatch with defaulted copy constructor | P0641R2 | SVN |
| Consistent comparison (operator<=>) | P0515R3 | Partial |
| P0905R1 | ||
| P1120R0 | ||
| Access checking on specializations | P0692R1 | Partial |
| Default constructible and assignable stateless lambdas | P0624R2 | SVN |
| Lambdas in unevaluated contexts | P0315R4 | No |
| [[no_unique_address]] attribute | P0840R2 | No |
| [[likely]] and [[unlikely]] attributes | P0479R5 | No |
| typename optional in more contexts | P0634R3 | No |
| Pack expansion in lambda init-capture | P0780R2 | No |
| Class types as non-type template parameters | P0732R2 | No |
| Destroying operator delete | P0722R3 | Clang 6 |
| Relaxations of constexpr restrictions | P1064R0 | No |
| P1002R1 | SVN | |
| P1327R1 | No | |
| P1330R0 | ||
| Prohibit aggregates with user-declared constructors | P1008R1 | SVN |
| Contracts | P0542R5 | No |
| P1289R1 | ||
| Feature test macros | P0941R2 | (see below) |
| explicit(bool) | P0892R2 | No |
| Signed integers are two's complement | P1236R1 | No |
| char8_t | P0482R6 | Clang 7 (11) |
| Immediate functions (consteval) | P1073R3 | No |
| std::is_constant_evaluated | P0595R2 | No |
| Nested inline namespaces | P1094R2 | SVN |
(11): Prior to Clang 8, this feature is not enabled by -std=c++2a, but can be enabled with -fchar8_t.
Defect reports
Clang generally aims to implement resolutions to Defect Reports (bug fixes against prior standards) retroactively, in all prior standard versions where the fix is meaningful. Significant Defect Report changes to language features after the publication of the relevant standard are marked (DR) in the above table.
Clang also has a test suite for conformance to resolutions for issues on the C++ core issues list, most of which are considered Defect Reports. Implementation status for C++ core issues based on that test suite is tracked on a separate page.
Technical specifications and standing documents
ISO C++ also publishes a number of documents describing additional language and library features that are not part of standard C++.
List of features and minimum Clang version with support
| Document | Latest draft | Compiler flag | Available in Clang? |
|---|---|---|---|
| SD-6: SG10 feature test recommendations | SD-6 | N/A | Clang 3.4 (N3745) |
| Clang 3.6 (N4200) | |||
| Clang 4 (P0096R3) | |||
| Clang 5 (P0096R4) | |||
| Clang 7 (P0096R5) | |||
| WIP (P1353R0) | |||
| [TS] Concepts | P0121R0 | Superseded by P0734R0 | |
| [DRAFT TS] Coroutines | N4663 | -fcoroutines-ts -stdlib=libc++ |
Clang 5 |
| [TS] Library Fundamentals, Version 1 (invocation type traits) | N4480 | N/A | No |
| [TS] Library Fundamentals, Version 2 (source_location) | N4617 | N/A | No |
| [TS] Modules | N4720 | -fmodules-ts | WIP |
| [DRAFT TS] Reflection | N4746 | No | |
| [TS] Transactional Memory | N4514 | No |
List of features and minimum Clang version with support的更多相关文章
- Android开发学习---template requires a minimum SDK version of at least 7,build target API version of 14
adt 22.6.3的bug 当adt更新到22.6.3,其编辑器中最低支持api7,即android 2.1,这里可能是google故意这么做的,也可能是其bug.其target sdk 和comp ...
- 安卓 android studio 报错 The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle
今天将项目迁移到另一台笔记本,进行build出现以下问题,导致build失败 报错截图: 大致意思,目前使用的build工具版本27.0.3不合适.因为当前使用Gradle插件版本是3.2.1,这个版 ...
- warning MSB8030: The linker switch "Minimum Required Version" requires "SubS
In the project properties, under Linker -> System, make sure that you set the SubSystem property ...
- Please upgrade the installed version of powershell to the minimum required version and run the command again.
版权声明:本文为博主原创文章,转载请注明出处.谢谢 https://blog.csdn.net/cow66/article/details/77993908 我的系统是windows 7 安装了vag ...
- dateutil 2.5.0 is the minimum required version python
问题重现 在运行以下代码时出现了该错误: import pandas as pd import numpy as np 原因与解决 原因是dateutil库版本低于2.5.0,卸载重装即可: pip ...
- 关于The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum...
今天将项目迁移到另一台笔记本,进行build出现以下问题,导致build失败 The specified Android SDK Build Tools version (26.0.2) is ign ...
- C++20 以 Bazel & Clang 开始
C++20 如何以 Bazel & Clang 进行构建呢? 本文将介绍: Bazel 构建系统的安装 LLVM 编译系统的安装 Clang is an "LLVM native&q ...
- 在Linux CentOS上编译并安装Clang 3.5.0
编译CoreCLR需要Clang 3.5,而CentOS上安装的是Clang 3.4.2(yum repos中最新版也是这个),只能自己手工编译LLVM的源代码进行安装. (注:CentOS的版本是6 ...
- CentOS 6.4 编译安装LLVM3.3,Clang和Libc++
LLVM的最新版本3.3终于在6月17日发布了,按之前的计划6月5日就应该发布了,不过毕竟没有太晚,赶在VS2013 preview(6月26日微软Build大会)之前出来了.加上之前gcc4.8.1 ...
随机推荐
- Apex语言(二)变量与常量
1.变量 凡是交给计算运算(处理)的数据就是变量,用来保存参加运算的数据和计算结果. 变量由变量名来标识. 变量名由字母数字和下划线组成,不能以数字开头. [正确]number,number1,num ...
- hibernate中session的get和load方法的区别和联系:
1. get:及时加载,调用到get方法时立即向数据库查询(在没有session缓存的请况). 2. load:默认使用懒加载,当用到数据的时候才向数据库查询(在没有session缓存的请况). 3. ...
- Python数据分析2------数据探索
一.数据探索 数据探索的目的:及早发现数据的一些简单规律或特征 数据清洗的目的:留下可靠数据,避免脏数据的干扰. 两者没有严格的先后顺序,经常在一个阶段进行. 分为: (1)数据质量分析(跟数据清洗密 ...
- js操作url参数
function getQueStr(url, ref) //获取参数值 { var str = url.substr(url.indexOf('?') + 1); if (str.indexOf(' ...
- [luogu P2756 ] 飞行员配对方案问题 (最大流)
强行做裸题做了两个小时..我果然太水了QAQ 题目背景 第二次世界大战时期.. 题目描述 英国皇家空军从沦陷国征募了大量外籍飞行员.由皇家空军派出的每一架飞机都需要配备在航行技能和语言上能互相配合的2 ...
- EhCache缓存页面、局部页面和对象缓存
页面缓存:SimplePageCachingFilter web.xml <!-- 页面缓存配置,配合ehcache.xml中name为“SimplePageCachingFilter”(默认值 ...
- 原生js,一些小应用(逢10进一,生成V字,多个div抖动)
第一题:每隔10个div换一行.并且鼠标移入 改变opacity. <!DOCTYPE html> <html lang="en"> <head> ...
- CF409C Magnum Opus
CF409C Magnum Opus 题意翻译 题目背景 愚人节题目,题面似乎是一位名叫Nicolas Flamel的炼金术士用拉丁文写的某种物质的配方,结合谷歌尝试翻译了一下: 吾友: 哲人石所言不 ...
- MySQL DROP TABLE操作以及 DROP 大表时的注意事项
语法: 删表 DROP TABLE Syntax DROP [TEMPORARY] TABLE [IF EXISTS] tbl_name [, tbl_name] ... [RESTRICT | CA ...
- HDU 3756
很容易就想到把三维转化成了二维,求出点离Z轴的距离,把这个距离当成X坐标,Z轴当Y坐标,然后就变成了求一个直角三角形覆盖这些点 像上一题一样,确定斜率直线的时候,必定是有一点在线上的.于是,可以把直线 ...