I missed a c++-03 requirement about friends. Fixed thusly.
Also fixed the recent debug9 failure for stabs debugging. That test appears to be a dwarf test, but as there's no dg-requires-dwarf the simplest fix was turning off block partitioning optimization (enabled on x86 automatically at O2 and above).
nathan -- Nathan Sidwell
2017-08-21 Nathan Sidwell <nat...@acm.org> * g++.dg/template/pr81899.C: Fix c++03. * g++.dg/debug/debug9.C: Add -fno-reorder-blocks-and-partition" Index: g++.dg/debug/debug9.C =================================================================== --- g++.dg/debug/debug9.C (revision 251221) +++ g++.dg/debug/debug9.C (working copy) @@ -1,4 +1,9 @@ /* { dg-do assemble } */ +/* Partitioning causes hot/cold section emission and breaks stabs + debugging. */ +/* { dg-additional-options "-fno-reorder-blocks-and-partition" } */ + + /* This testcase requires entries in the debug_range section in DWARF which refer to a vague linkage function. */ Index: g++.dg/template/pr81899.C =================================================================== --- g++.dg/template/pr81899.C (revision 251227) +++ g++.dg/template/pr81899.C (working copy) @@ -2,7 +2,7 @@ template <template <typename> class FunctorData> struct functor { - friend FunctorData<int>; + friend class FunctorData<int>; void foo(); };