<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/121441>121441</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang: `-fno-elide-type` does not properly apply to structural strings
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          elbeno
      </td>
    </tr>
</table>

<pre>
    Take a normal "structural string" type intended as an NTTP. When it exceeds a certain length, even when passing `-fno-elide-type`, it is elided in the name of a type.
 
```cpp
#include <cstddef>

template <std::size_t N> struct ct_string {
    consteval ct_string(char const (&str)[N]) {
        for (auto i = std::size_t{}; i < N; ++i) {
            value[i] = str[i];
 }
    }
    char value[N]{};
};

template <ct_string>
struct F {
 constexpr static auto value = false;
};

static_assert(F<"012345678901234567890123456789012345">::value);
static_assert(F<"0123456789012345678901234567890123456">::value);
```

Produces:
```console
<source>:17:15: error: static assertion failed due to requirement 'F<ct_string<37>{"012345678901234567890123456789012345"}>::value'
   17 | static_assert(F<"012345678901234567890123456789012345">::value);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<source>:18:15: error: static assertion failed due to requirement 'F<ct_string<38>{"0123456789012345678901234567890123[...]"}>::value'
   18 | static_assert(F<"0123456789012345678901234567890123456">::value);
 |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

Up to and including 36 characters, the type is reproduced without elision. At 37 characters or greater, the type is elided. Passing `-fno-elide-type` should prevent this elision, but does not.

https://godbolt.org/z/qc9Yc8bsr
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0VU9v47gP_TTMhahhS3HsHHxI0smx6KE__LCnQrGYWLuK5JHoznQO89kXktvpv22BYnaFopEt8vHxmSJVjObkiDqot1BfLtTEgw8d2QM5vzh4fd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