Add new 'preferred_name' attribute.
authorRichard Smith <richard@metafoo.co.uk>
Thu, 12 Nov 2020 01:12:18 +0000 (17:12 -0800)
committerRichard Smith <richard@metafoo.co.uk>
Mon, 7 Dec 2020 20:53:07 +0000 (12:53 -0800)
commit98f76adf4e941738c0b9fe3b9965fa63603e9c89
treed64cbb9732c788a5506b4b7a6483eedba6864907
parent2ac4d0f45a2a301163ca53f3e23e675f4f5bdbd3
Add new 'preferred_name' attribute.

This attribute permits a typedef to be associated with a class template
specialization as a preferred way of naming that class template
specialization. This permits us to specify that (for example) the
preferred way to express 'std::basic_string<char>' is as 'std::string'.

The attribute is applied to the various class templates in libc++ that have
corresponding well-known typedef names.

Differential Revision: https://reviews.llvm.org/D91311
14 files changed:
clang/include/clang/Basic/Attr.td
clang/include/clang/Basic/AttrDocs.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/AST/TypePrinter.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/test/SemaTemplate/attributes.cpp
clang/utils/TableGen/ClangAttrEmitter.cpp
libcxx/include/__config
libcxx/include/iosfwd
libcxx/include/regex
libcxx/include/string
libcxx/include/string_view