<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/108526>108526</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format: `BracedInitializerIndentWidth` in parent config is ignored when using `BasedOnStyle: InheritParentConfig`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
sqybi
</td>
</tr>
</table>
<pre>
### Version
clang-format version 18.1.8
### How to reproduce
./.clang-format:
```
---
BracedInitializerIndentWidth: 2
```
./foo/.clang-format:
```
---
BasedOnStyle: InheritParentConfig
```
Run `clang-format --dump-config | grep BracedInitializerIndentWidth`, output is empty.
**When moving `BracedInitializerIndentWidth: 2` to ./foo/.clang-format:**
./.clang-format:
```
---
Language: Cpp # An empty file does not work
```
./foo/.clang-format:
```
---
BasedOnStyle: InheritParentConfig
BracedInitializerIndentWidth: 2
```
Run `clang-format --dump-config | grep BracedInitializerIndentWidth`, now output is:
```
BracedInitializerIndentWidth: 2
```
### Hypothesis
According to https://clang.llvm.org/docs/ClangFormatStyleOptions.html#bracedinitializerindentwidth, `BracedInitializerIndentWidth` will fall back to `ContinuationIndentWidth` if it is not explicitly set. This behavior takes precedence over falling back to the parent configuration, effectively ignoring the `BracedInitializerIndentWidth` specified in the parent configuration.
I am not sure how to verify this hypothesis.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVU2P2zYQ_TXUZSCBprRa-6CD48DoAgVStEVzpsSRNF2KVEnKrvrrC9Kb2A7azaIJUIDwh0TOe_PmzVB6T4NBbNjDO_bwPpNLGK1r_B9rS1lr1dowUV4W_IbOkzWMv2d8f_nstDRD3ls3yQCny3vYbItNsb3ddo3xgz1DsOBwdlYtHd7uKpg4FrcRWbm_i1Lzl5X-5nl--fHOyQ7Vk6FAUtNf6J6MQhM-kgojK_cg_vH4FbO39r8iS4_qg_klrBoj0pMZ0VH4STo04WBNT8Mr2D8vBljN7zTMc7VMc96ls8AeDzA4nOHVFGvOxAHsEuYlAHnAaQ5rca9_XB9HNDDZE5kh4n5dtprHWr0iUQr7PUr4ozTDIock4mGeAaJX9uaSCvSkEZRFD8YGOFv3_P9X9FtM930Lb-z5WvzX0_wW0jc9vM42jOjJ377fd511KnorWBhDmBMXcWTimBIttD5NhXUDE0dlO8_E8RCfH1P-SfAPcyBrfDGGSTNRtoktXdlSYntObMXhqx6uOZxJa-il1tDK7jkyYzU_WBPILDKCfbGfeqDUQ9Fo-OesqaOgV_AYCvh1JA8tjvJE1kGQz-hhdtihQtMh2BO6hBU1-AQXRoQ5mQcupV1cwo38se-xC3RCvQINxrok3ohvSczP2FFPqIDMv4LczYAnkFNKyy8OYbzM4RM66lcIMbPxc1mLTDWl2pU7mWGzeRS1EKKsH7KxqUVf4a7elrjbim3dy1rt5CM-tnVbYlm1GTWCi4rvNuWGb0S1KXYtVlXPK5TbthcdZxXHSZL-bIeMvF-w2fDtg6gzLVvUPt1GQtz1rxDxfnJNPJe3y-BZxTX54K-RAgWNzRdd_xY1ydzrFx2QKoIKznFqLv7T0HzDfKh5tjjd3PfAQGFc2qKzExPHyPjlK5-d_R27wMQxCRH74kWLUyP-DgAA__-nR2Fp">