<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/103054>103054</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
When using the text `module` as an identifier, clang++ incorrectly rejects it
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:modules
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
androm3da
</td>
</tr>
</table>
<pre>
According to ยง5.10 Identifiers [lex.name], "Unless otherwise specified, any ambiguity as to whether a given identifier has a special meaning is resolved to interpret the token as a regular identifier."
Does this mean that clang is incorrect to emit an error in this case?
```
$ cat ~/tmp/module_ident.cpp
using module = int;
module i;
int foo() {
return i;
}
```
```
$ clang++ -c ~/tmp/module_ident.cpp -std=c++20
/usr2/bcain/tmp/module_ident.cpp:3:1: error: module declaration must occur at the start of the translation unit
3 | module i;
| ^
/usr2/bcain/tmp/module_ident.cpp:1:1: note: add 'module;' to the start of the file to introduce a global module fragment
1 |
| ^
/usr2/bcain/tmp/module_ident.cpp:3:8: fatal error: module 'i' not found
3 | module i;
| ~~~~~~~^
2 errors generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVMGO4zYM_Rr6QkxgS3GcHHxIJg3QDyh6LGSJsdXKUiDRszuX_fZCkZsNMLsFBlgjiBOJ7_GReqJKyY6eqIf2BO25UgtPIfbKmxhmaVQ1BPPeH7UO0Vg_IgeEVwHHrt00Nf5uyLO9WooJoT05-rrxaiZozyBeEYT4wztKCQNPFL_YRJhupDPA5ADl31HNgx0Xy--oUmb_MlEORoWjfSOP9pECJ5VQFQblcCblsyKbMFIK7o1MxlvPFG-RGHki5PAPebzjIo2LU_GJcANCQH2G-li-z4ES8mTTnRt5UozaqZLDeh1iJM05Cc2WUXmkGENE6wtKq0QgL8-UsKvXT_krtqgV4zcQF55vIC5zMIujv-6iNvp2w2f0knKBJQRBnnNxIE9lc122jwXrGa8hgNiDOCB06zIiYiReon-Khe78Y4E_VZ37AOIE4oQv-v8KeElsQJ51CRYPjsuSogBxGbSy_qdwkEcJ8tiAPJbu5h9rqYa0U1GxDR7nJTEGrZeIqhx1YhUZw7Wce1Q-uRK6eMvfWyERulf80Dy8P3kL2t8-Lbn5T7IPTPmtjEEQXQnNSUSXffNB59U6Wl0bg1k0Zd-7MGR_F4nXqMaZ_FMFTZH5C2TnTu-z3Kti5T70G0Rns3AfsrEWbz7RxW_leagShT3hSJ6iYjKbHzquMr00B3lQFfVNJ2TbysOhrabe7OrOdJK6_a7WQ1Ob63bXiOawo71uTNtUthe12Nb7RjaiPbTtZqt2nWy7oTk0RtBBwramWVm3ce5t3oQ4VjalhfqmlnW7rZwayKX7HBSi2F2ulyzlQdGeq9hn6MuwjAm2tbOJ03cytuyo_3Mij-Xe3n1IXxlhV69G2NX3WfQ81fIcfL5cjznj3jHS36Q5oeVqia6fmG8JZD5hEJfR8rQMGx1mEJesYn293GLIMBCXe30JxGUt8a0X_wYAAP__cg_S9g">