diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-04-22 22:50:11 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-04-22 22:50:11 +0000 |
commit | 30cd644f80ad3c0b8c3bbbf38f20f31f602b2505 (patch) | |
tree | d38bd027f1e0cb970fef1f27b4bbbed42701cdf8 /include/clang/Basic | |
parent | 9779aa41dd73984edb7f3641bd019c54ede3c977 (diff) | |
download | clang-30cd644f80ad3c0b8c3bbbf38f20f31f602b2505.tar.gz |
[c++2a] Implement semantic restrictions for 'export' declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358932 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic')
-rw-r--r-- | include/clang/Basic/DiagnosticGroups.td | 1 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index d11bf58acd..d46f82f2a5 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -168,6 +168,7 @@ def ExtraTokens : DiagGroup<"extra-tokens">; def CXX98CompatExtraSemi : DiagGroup<"c++98-compat-extra-semi">; def CXX11ExtraSemi : DiagGroup<"c++11-extra-semi">; def EmptyInitStatement : DiagGroup<"empty-init-stmt">; +def ExportUnnamed : DiagGroup<"export-unnamed">; def ExtraSemiStmt : DiagGroup<"extra-semi-stmt", [EmptyInitStatement]>; def ExtraSemi : DiagGroup<"extra-semi", [CXX98CompatExtraSemi, CXX11ExtraSemi]>; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index f8aef6f627..a44c682471 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -9273,8 +9273,27 @@ def err_module_decl_not_at_start : Error< def note_global_module_introducer_missing : Note< "add 'module;' to the start of the file to introduce a " "global module fragment">; +def err_export_within_anonymous_namespace : Error< + "export declaration appears within anonymous namespace">; +def note_anonymous_namespace : Note<"anonymous namespace begins here">; +def ext_export_no_name_block : ExtWarn< + "ISO C++20 does not permit %select{an empty|a static_assert}0 declaration " + "to appear in an export block">, InGroup<ExportUnnamed>; +def ext_export_no_names : ExtWarn< + "ISO C++20 does not permit a declaration that does not introduce any names " + "to be exported">, InGroup<ExportUnnamed>; +def note_export : Note<"export block begins here">; +def err_export_no_name : Error< + "%select{empty|static_assert|asm}0 declaration cannot be exported">; +def ext_export_using_directive : ExtWarn< + "ISO C++20 does not permit using directive to be exported">, + InGroup<DiagGroup<"export-using-directive">>; def err_export_within_export : Error< "export declaration appears within another export declaration">; +def err_export_internal : Error< + "declaration of %0 with internal linkage cannot be exported">; +def err_export_using_internal : Error< + "using declaration referring to %0 with internal linkage cannot be exported">; def err_export_not_in_module_interface : Error< "export declaration can only be used within a module interface unit" "%select{ after the module declaration|}0">; |