mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-13 17:37:00 +00:00

[module.unit]p1 specifies that module and import are invalid components of a module name, that module names cannot contain reserved identifiers, and that std followed by zero or more digits is reserved. The first issue (module and import pseudo-keywords) requires a diagnostic, the second issue (use of reserved identifiers) does not require a diagnostic. We diagnose both the same -- the code is ill- formed unless the module declaration is in a system "header". This allows STL implementations to use the reserved module names while preventing users from stealing them out from under us. Differential Revision: https://reviews.llvm.org/D136953
8 lines
281 B
C++
8 lines
281 B
C++
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
|
|
// expected-no-diagnostics
|
|
|
|
// Show that we suppress the reserved identifier diagnostic in a system header.
|
|
# 100 "file.cpp" 1 3 // Enter a system header
|
|
export module __test;
|
|
# 100 "file.cpp" 2 3 // Leave the system header
|