Merge pull request #85370 from DougGregor/extern-global-variables

This commit is contained in:
Doug Gregor
2025-11-06 21:40:24 -08:00
committed by GitHub
14 changed files with 184 additions and 89 deletions

View File

@@ -2123,8 +2123,8 @@ WARNING(reserved_runtime_symbol_name,none,
// @_extern
ERROR(attr_extern_experimental,none,
"'@_extern' requires '-enable-experimental-feature Extern'", ())
ERROR(extern_not_at_top_level_func,none,
"'@_extern' can only be applied to global functions", ())
ERROR(extern_not_at_top_level,none,
"'@_extern' can only be applied to globals", ())
ERROR(extern_empty_c_name,none,
"expected non-empty C name in '@_extern'", ())
ERROR(extern_only_non_other_attr,none,
@@ -2134,6 +2134,8 @@ WARNING(extern_c_maybe_invalid_name, none,
"C name '%0' may be invalid; explicitly specify the name in "
"'@_extern(c)' to suppress this warning",
(StringRef))
ERROR(extern_variable_initializer, none,
"'@_extern' variable cannot have an initializer", ())
// @_staticExclusiveOnly
ERROR(attr_static_exclusive_only_disabled,none,
@@ -2170,13 +2172,14 @@ ERROR(c_func_variadic, none,
ERROR(c_func_unsupported_specifier, none,
"cannot declare '%0' argument %1 in %kind2",
(StringRef, DeclName, const ValueDecl *))
ERROR(c_func_unsupported_type, none, "%0 cannot be represented in C",
ERROR(c_unsupported_type, none, "%0 cannot be represented in C",
(Type))
ERROR(c_func_async,none,
"async functions cannot be represented in C", ())
ERROR(c_func_throws,none,
"raising errors from C functions is not supported", ())
ERROR(c_var_computed,none,
"computed variable cannot be represented in C", ())
ERROR(expose_wasm_not_at_top_level_func,none,
"'@_expose' with 'wasm' can only be applied to global "
"functions", ())