Compiler Support

Let's look at the compiler support for the topics in this chapter.

Feature GCC Clang MSVC
[[fallthrough]] 7.0 3.9 15.0
[[nodiscard]] 7.0 3.9 15.3
[[maybe_unused]] 7.0 3.9 15.3
Attributes for namespaces and enumerators 4.9/6[^gccnote] 3.4 14.0
Ignore unknown attributes All versions 3.9 14.0
Using attribute namespaces without repetition 7.0 3.9 15.3

All of the above compilers also support C++11/14 attributes.

[^gccnote]: GCC 4.9 (namespaces) / GCC 6 (enumerations)


In the next chapter, we will explore the changes in std::optional.

Get hands-on with 1400+ tech skills courses.