PR c++/24511 - [DR 470] explicit instantiation/extern template unsats

PR c++/24511 - [DR 470] explicit instantiation/extern template unsats
// on symbols defined later

gcc/testsuite/ChangeLog:
	* g++.dg/template/explicit9.C: New test.

From-SVN: r244337
This commit is contained in:
Martin Sebor 2017-01-11 21:02:46 +00:00 committed by Martin Sebor
parent 01bfd25762
commit 3594adc7b0
2 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2017-01-11 Martin Sebor <msebor@redhat.com>
PR c++/24511
* g++.dg/template/explicit9.C: New test.
2017-01-11 Nathan Sidwell <nathan@acm.org>
PR c++/77812

View File

@ -0,0 +1,24 @@
// PR c++/24511 - [DR 470] explicit instantiation/extern template unsats
// on symbols defined later
// { dg-do compile }
template <class T> struct S { T foo (); T bar (); };
template <class T> T S<T>::foo () { return T (); }
#ifndef MAIN
// This part is being tested by the dg-final directive.
template struct S<int>;
#else
// This part is not being tested.
extern template struct S<int>;
int main ()
{
return S<int>().foo () + S<int>().bar ();
}
#endif
template <class T> T S<T>::bar () { return T (); }
// { dg-final { scan-assembler-not "\\\*UND\\\*\[^\n]*_Z1fIiEvPT_" } }