diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.dg/other/abstract2.C | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/g++.dg/other/abstract2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/other/abstract2.C | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/abstract2.C b/gcc/testsuite/g++.dg/other/abstract2.C new file mode 100644 index 000000000..b79493285 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/abstract2.C @@ -0,0 +1,58 @@ +// { dg-do compile } +// Contributed by Gabriel Dos Reis <gdr at integrable-solutions dot net> +// PR c++/2204: Check for parameters of abstract type in function declarations. + +namespace N1 { + struct X; + + struct Y1 { + void g(X parm1); // { dg-error "abstract" } + void g(X parm2[2]); // { dg-error "abstract" } + void g(X (*parm3)[2]); // { dg-error "abstract" } + }; + + + template <int N> + struct Y2 { + void g(X parm4); // { dg-error "abstract" } + void g(X parm5[2]); // { dg-error "abstract" } + void g(X (*parm6)[2]); // { dg-error "abstract" } + }; + + struct X { // { dg-message "note" } + virtual void xfunc(void) = 0; // { dg-message "note" } + }; +} + +namespace N2 { + struct X1 { // { dg-message "note" } + virtual void xfunc(void) = 0; // { dg-message "note" } + void g(X1 parm7); // { dg-error "abstract" } + void g(X1 parm8[2]); // { dg-error "abstract" } + void g(X1 (*parm9)[2]); // { dg-error "abstract" } + }; + + template <int N> + struct X2 { // { dg-message "note" } + virtual void xfunc(void) = 0; // { dg-message "note" } + void g(X2 parm10); // { dg-error "abstract" } + void g(X2 parm11[2]); // { dg-error "abstract" } + void g(X2 (*parm12)[2]); // { dg-error "abstract" } + }; +} + +namespace N3 { + struct X { // { dg-message "note" "" } + virtual void xfunc(void) = 0; // { dg-message "note" } + }; + void g(X parm13); // { dg-error "abstract" } + void g(X parm14[2]); // { dg-error "abstract" } + void g(X (*parm15)[2]); // { dg-error "abstract" } + + template <int N> + void g(X parm16); // { dg-error "abstract" } + template <int N> + void g(X parm17[2]); // { dg-error "abstract" } + template <int N> + void g(X (*parm18)[2]); // { dg-error "abstract" } +} |