]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/warn/Wmismatched-tags-9.C
Check for class type before assuming a type is one [PR103703].
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / warn / Wmismatched-tags-9.C
1 /* PR c++/103703 - ICE with -Wmismatched-tags with friends and templates
2 { dg-do compile }
3 { dg-options "-Wall -Wmismatched-tags" } */
4
5 template <typename T>
6 struct A
7 {
8 struct B { };
9 };
10
11 template <typename T>
12 struct C
13 {
14 friend class A<C>::B; // { dg-warning "-Wmismatched-tags" "pr102036" { xfail *-*-* } }
15 };
16
17 template struct C<int>;
18
19
20 template <typename T>
21 struct D
22 {
23 friend class A<D>::B; // okay, specialized as class below
24 };
25
26 template <>
27 struct A<long>
28 {
29 class B { };
30 };
31
32 template struct D<long>;