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

    <tr>
        <th>Summary</th>
        <td>
            [Clang]: Incorrect inheritance of protected (default) constructor
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    The snippet
```cpp
#include <iostream>
#include <type_traits>

class Foo {
protected:
 Foo() = default; 
};

class Bar : public Foo {
public:
 using Foo::Foo;

    Bar(const Bar &) = default;
};

int main() {
    std::cout << std::boolalpha << "Is default constructible: "
        << std::is_default_constructible_v< Bar > << std::endl;
 
    Bar b;
}
```
compiles fines with Clang (trunk and older), whereas it fails to compile with GCC and MSVC because `Bar` has no public default constructor.

If the line `Bar b;` is commented out, the program compiled with Clang will report `true` whereas GCC and MSVC report `false`. I suspect that Clang's behavior here is related to the abovementioned problem.

Note: If the visibility of `Bar`'s constructor is changed to `private`, then everything works as expected.

[Godbolt](https://godbolt.org/z/ex3eWoh5z)

I am not nearly competent enough to look up the expected behavior in the C++ standard, but given that GCC  and MSVC seem to agree on what the result should be, I figured that this is likely a bug in Clang :shrug: 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VVFv6jgT_TXmZXRRsEsgDzwUuFxVn7592dXuY-UkQ-KtY0f2GC799atx4FLa3aoC5Jk5c86ZiaNjNJ1D3IjlViz3M52o92Hzv_A-1OHdzmrfXjZ_9AjRmXFEEsVeFM-iLKb_ZhyvJ1IZ19jUIgi1Mz5SQD0I9f3fwnQZ8ZWCNhTvGfmzsTpGOHgPYrWdjsbgCRvCVqhrEseFXAtZgVB7aPGokyWhtnCFWu2F2n6F3eoAQj3DmGprmk9d8tm9RYrGdbmRehbqOf94gAQABhRy3XgXaQKX5VdS_8XJOIJBG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