diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/arg2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/arg2.C | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/arg2.C b/gcc/testsuite/g++.dg/template/arg2.C new file mode 100644 index 000000000..9fb7a68cc --- /dev/null +++ b/gcc/testsuite/g++.dg/template/arg2.C @@ -0,0 +1,14 @@ +// { dg-do compile } + +// Copyright (C) 2003 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 21 Mar 2003 <nathan@codesourcery.com> + +// PR 9708. We accepted a local class + +template <typename T> class X {}; + +void fn () +{ + class L {}; + X<L> f; // { dg-error "uses local type|trying to instantiate|no type|invalid type" "" } +} |