<div dir="ltr"><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">We ran into an error when trying to build one of our existing projects with Clang. The minimal example looks as follows:</span><div class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br class="gmail_msg"></div><div class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><div class="gmail_msg">template <typename S> struct Foo {</div><div class="gmail_msg">  struct Bar {</div><div class="gmail_msg">    using Baz = Foo<S>;</div><div class="gmail_msg">  };</div><div class="gmail_msg">  template <typename T> struct Qux {</div><div class="gmail_msg">    friend struct Bar::Baz;</div><div class="gmail_msg">  };</div><div class="gmail_msg">};</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Foo<int>::Qux<int> qux;</div></div><div class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br class="gmail_msg"></div><div class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">When trying build this example with Clang, it produces the following error: test.cc:6:24: error: elaborated type refers to a type alias. However, GCC handles this example just fine.</div><div class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br class="gmail_msg"></div><div class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">IIUC in this case Clang follows the C++ standard which specifies that elaborated type specifier cannot refer to a type alias. However, I would like to ask if anyone can explain the underlying motivation? In this case it seems to be pretty clear what Baz refers to. Is there any reason why Clang cannot allow it (except for strictly adhering to standards)?</div></div>