I was about to add this test with dg-ice but it turned out it had already been fixed by the recent r11-3361!
Tested x86_64-pc-linux-gnu, applying to trunk. gcc/testsuite/ChangeLog: PR c++/68451 * g++.dg/cpp0x/friend6.C: New test. --- gcc/testsuite/g++.dg/cpp0x/friend6.C | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/friend6.C diff --git a/gcc/testsuite/g++.dg/cpp0x/friend6.C b/gcc/testsuite/g++.dg/cpp0x/friend6.C new file mode 100644 index 00000000000..fce7e55383e --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/friend6.C @@ -0,0 +1,23 @@ +// PR c++/68451 +// { dg-do compile { target c++11 } } + +struct A {}; + +struct B +{ + A a; + friend decltype(a); +}; + +template <typename T> +struct C +{ + A a; + friend decltype(a); +}; + +int main() +{ + B b; + C<int> c; +} base-commit: 237a8e8d5647e45aca2736906033291d49545a2c -- 2.29.2