diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/lookup/using40.C')
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/using40.C | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/lookup/using40.C b/gcc/testsuite/g++.dg/lookup/using40.C new file mode 100644 index 00000000000..1bcdd0dbf5e --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/using40.C @@ -0,0 +1,28 @@ +// { dg-do compile } + +struct Base +{ + void f(); + typedef int type; + struct Type {}; + int i; + static int j; +}; + +struct A : Base +{ + using Base::f; // { dg-message "previous declaration" } + using Base::f; // { dg-error "redeclaration" } + + using Base::type; // { dg-message "previous declaration" } + using Base::type; // { dg-error "redeclaration" } + + using Base::Type; // { dg-message "previous declaration" } + using Base::Type; // { dg-error "redeclaration" } + + using Base::i; // { dg-message "previous declaration" } + using Base::i; // { dg-error "redeclaration" } + + using Base::j; // { dg-message "previous declaration" } + using Base::j; // { dg-error "redeclaration" } +}; |