> For the complete documentation index, see [llms.txt](https://cpp-clippy.gitbook.io/cpp-clippy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cpp-clippy.gitbook.io/cpp-clippy/rules/critical/crt-dcl-02.md). Agents can also search and read this documentation through its [MCP server](https://cpp-clippy.gitbook.io/cpp-clippy/~gitbook/mcp).

# Rule CRT-DCL-02

Type wchar\_t shall not be used

* **Classification:** *Required*
* **Offers Fixes:** *No*

## What it does?

Detects all uses of wchar\_t type

## Why is this bad?

Width of wchar\_t type is implementation-defined. Use types char16\_t and char32\_t instead.

## Example

```cpp
char16_t string_1[] = u"AAA"; // Compliant
char32_t string_2[] = U"BBB"; // Compliant 
wchar_t  string_3[] = L"CCC"; // Non-compliant
```

### See also

* Autosar March 2019: Rule A2-13-3 Type wchar\_t shall not be used.
