From 3594adc7b02ebd2a6f66d3b5db9f6ebbd1bc6547 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Wed, 11 Jan 2017 21:02:46 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/template/explicit9.C | 24 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/explicit9.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4f281cbfde6..98fd94963b7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-01-11 Martin Sebor + + PR c++/24511 + * g++.dg/template/explicit9.C: New test. + 2017-01-11 Nathan Sidwell PR c++/77812 diff --git a/gcc/testsuite/g++.dg/template/explicit9.C b/gcc/testsuite/g++.dg/template/explicit9.C new file mode 100644 index 00000000000..e4f7d882561 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/explicit9.C @@ -0,0 +1,24 @@ +// PR c++/24511 - [DR 470] explicit instantiation/extern template unsats +// on symbols defined later +// { dg-do compile } + +template struct S { T foo (); T bar (); }; +template T S::foo () { return T (); } + +#ifndef MAIN + +// This part is being tested by the dg-final directive. +template struct S; +#else + +// This part is not being tested. +extern template struct S; +int main () +{ + return S().foo () + S().bar (); +} +#endif + +template T S::bar () { return T (); } + +// { dg-final { scan-assembler-not "\\\*UND\\\*\[^\n]*_Z1fIiEvPT_" } } -- 2.30.2