diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-10-27 02:23:16 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-10-27 02:23:16 +0000 |
commit | a5201a9197a9083b71098914c9dfd97249db5249 (patch) | |
tree | 62c200d8b2b8702e81da0dc741d655791644796a /gcc/testsuite | |
parent | 0a3d71f54af134bcafea29a8f8021d8bbf24cfb4 (diff) | |
download | gcc-a5201a9197a9083b71098914c9dfd97249db5249.zip gcc-a5201a9197a9083b71098914c9dfd97249db5249.tar.gz gcc-a5201a9197a9083b71098914c9dfd97249db5249.tar.bz2 |
re PR c++/18093 (bogus conflict in namespace aliasing)
PR c++/18093
* search.c (current_scope): Return the innermost non-block scope,
not the innermost non-block, non-namespace scope.
(at_namespace_scope_p): Adjust accordingly.
(dfs_accessible_post): Do not pass namespaces to is_friend.
(dfs_walk_once_accessible_r): Likewise.
* decl.c (grokvardecl): Adjust call to current_scope.
(build_enumerator): Likewise.
* parser.c (cp_parser_using_declaration): Likewise.
(cp_parser_direct_declarator): Use at_namespace_scope_p instead of
current_scope.
(cp_parser_class_head): Adjust call to current_scope.
* name-lookup.c (do_namespace_alias): Set the DECL_CONTEXT for the
alias.
PR c++/18020
* pt.c (tusbst_copy_and_build): Resolve enumeration constants to
their underlying values.
PR c++/18161
* typeck.c (build_binary_op): Honor build_type, even when in a
template.
PR c++/18093
* g++.dg/lookup/ns2.C: New test.
PR c++/18020
* g++.dg/template/enum4.C: New test.
PR c++/18161
* g++.dg/template/expr1.C: New test.
From-SVN: r89627
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/ns2.C | 17 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/enum4.C | 9 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/expr1.C | 8 |
4 files changed, 45 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 58e8756..e248aef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2004-10-26 Mark Mitchell <mark@codesourcery.com> + + PR c++/18093 + * g++.dg/lookup/ns2.C: New test. + + PR c++/18020 + * g++.dg/template/enum4.C: New test. + + PR c++/18161 + * g++.dg/template/expr1.C: New test. + 2004-10-26 Ben Elliston <bje@au.ibm.com> * gcc.dg/tree-ssa/20030922-2.c: Now passing, so remove xfail. diff --git a/gcc/testsuite/g++.dg/lookup/ns2.C b/gcc/testsuite/g++.dg/lookup/ns2.C new file mode 100644 index 0000000..2ad2ec0 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/ns2.C @@ -0,0 +1,17 @@ +// PR c++/18161 + +namespace m +{ + namespace n + { + } +} + +namespace n +{ +} + +namespace o +{ + namespace n = ::m::n; +} diff --git a/gcc/testsuite/g++.dg/template/enum4.C b/gcc/testsuite/g++.dg/template/enum4.C new file mode 100644 index 0000000..97e0b84 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/enum4.C @@ -0,0 +1,9 @@ +// PR c++/18020 + +template <typename> struct bar { + enum { + e1 = 1, + e2 = ~e1 + }; +}; +template struct bar<int>; diff --git a/gcc/testsuite/g++.dg/template/expr1.C b/gcc/testsuite/g++.dg/template/expr1.C new file mode 100644 index 0000000..079865d --- /dev/null +++ b/gcc/testsuite/g++.dg/template/expr1.C @@ -0,0 +1,8 @@ +// PR c++/18161 +// { dg-options "" } + +template <class T> struct Y; +template <> struct Y<bool> {}; + +template <typename T = typeof (1 == 1)> struct X { Y<T> a; }; +template struct X <>; |