<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/112036>112036</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] constexpr exapression failed to resolve optization
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Blaukovitch
</td>
</tr>
</table>
<pre>
`std::string new_string_after_operational = ResovleCharString("any_test_string"); //const char[]`
**where:**
```
#define ResovleCharStringA(strAscii) \
[]() -> char* { \
constexpr auto sizeAscii = sizeof(strAscii) / sizeof(strAscii[0]); \
constexpr auto resovled_strAscii = class_operationAscii<sizeAscii>(strAscii); \
static char after_operation_stringA[sizeA]; \
operational_strA.operationAscii((unsigned char*)resovled_strA); \
return after_operation_stringA; \
}()
```
* CLANG - lot of **trash** dynamic operations when compiler is knowed original string length
* MS VC - complier **dont use** original string with _strlen_ and _strcopy_ operations before call *operational_strA.operationAscii()* and return already operation completed string.
this error is bypass in CLANG by next construction:
```
constexpr auto test = "any_test_string";
std::string new_string_after_operational = ResovleCharString(test);
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyslEuvqzYQxz_NsBklApMHLFiQnJtu2i56pW4jYybgXsdGtklO7qevbDjN456rdtEIBSxm5v-bB8Odk50mqmC9g_VbwkffG1vtFB-_mYv0ok8a094q2KTOt5DXkNfOW6k71HQ9To9HfvJkj2Ygy700miuE_A3_IGcuivY9t1-jHbACGOP6dvTk_OwMjAErId8hsAOwgzDaeRQ9txMSbFJI3yCtgYXr2pOlwBFP85tNOl-zYd7SSWr6kaAGVjhvayekBFYirPeTDyLirBcgS1xA_mWiYDXCdvdsGn4RlN4Hi3z0Bp38TjFuzD2czOlVjR0-ebHepVF2qsG_qNgpo_b44R7VhOLO3es_xc33_yBB_uUZ5VnKee6liNniSyvnJtWw3sVogfTJ96HpkWn5QhGqWYw6Tln7UVBg5VMiPxBZ8qPVP4V5LRRs57b9ZB5q3P9a__4LLlAZj-aE0_R4y10_PWJ70_wsxT0fh9eeNApzHqQii9LhN22u1KKxspNhyOcPQZHufH_X-u0r_rnHRXRVkuys1hrtcXQ0C75GuUrfY8hQkT4i1208CDPcjo9QDZ2MJRRcqRD3v5S_DHIh4EdVlSXe3u5RJ1Ly1M4wyzmZh3_fS4dkrYmVaG4Ddw6lngvb3FDTu5-m1Y4iRA0f6WfteJnosAriEH--GvLd5PW_bJ8Qe5q1F7KkrfK2zEueUJVtWbHZrlYsS_qKpZyJk8iypik4S4tyU5SrNa3bhrNVLraJrFjKVlmaZVnJUpYtC7Hd0qndrDY8L7aigFVKZy7VUqnLeWlsl0jnRqqyjKX5JlG8IeU-1q-tgtWiGTsHq1RJ593dz0uv4qIWiusO1m8Py4He-WDJudDNE5eKWpy3hboQmsHL71Ork9Gqqvd-cHGJho3bSd-PzVKYM7BDUJtvi8Gav0h4YIeI7IAdZupLxf4OAAD__3h0-xE">