| 1 |
.. title:: clang-tidy - misc-misleading-bidirectional |
| 2 |
|
| 3 |
misc-misleading-bidirectional |
| 4 |
============================= |
| 5 |
|
| 6 |
Warn about unterminated bidirectional unicode sequence, detecting potential attack |
| 7 |
as described in the `Trojan Source <https://www.trojansource.codes>`_ attack. |
| 8 |
|
| 9 |
Example: |
| 10 |
|
| 11 |
.. code-block:: c++ |
| 12 |
|
| 13 |
#include <iostream> |
| 14 |
|
| 15 |
int main() { |
| 16 |
bool isAdmin = false; |
| 17 |
/* } if (isAdmin) begin admins only */ |
| 18 |
std::cout << "You are an admin.\n"; |
| 19 |
/* end admins only { */ |
| 20 |
return 0; |
| 21 |
} |