diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/ipa/pr45565.C')
-rw-r--r-- | gcc/testsuite/g++.dg/ipa/pr45565.C | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ipa/pr45565.C b/gcc/testsuite/g++.dg/ipa/pr45565.C new file mode 100644 index 00000000000..c04de12e271 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr45565.C @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-O -fno-toplevel-reorder -fno-inline -fipa-cp -fipa-cp-clone -fkeep-inline-functions" } + +template < typename Derived > struct AnyMatrixBase +{ +}; + +struct Matrix Random (); + +struct Matrix:AnyMatrixBase < Matrix > +{ + void bar () + { + throw; + } + void foo (Matrix other) + { + bar (); + Matrix (AnyMatrixBase < Matrix > (Random ())); + } + template + < typename OtherDerived > Matrix (AnyMatrixBase < OtherDerived > other) + { + foo (other); + } +}; + +Matrix x (Random ()); + |