aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-09-15 16:03:32 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2005-09-15 16:03:32 +0000
commit9c12301f5b2d91a5b6ccdaf7d323d7ca3a09e041 (patch)
treeafc83bbd1a00cee91c0be29bdd545cafdb20f9d9 /libstdc++-v3
parentc629e611eb78853f8ccd85173b758cabbdc0e56b (diff)
downloadgcc-9c12301f5b2d91a5b6ccdaf7d323d7ca3a09e041.zip
gcc-9c12301f5b2d91a5b6ccdaf7d323d7ca3a09e041.tar.gz
gcc-9c12301f5b2d91a5b6ccdaf7d323d7ca3a09e041.tar.bz2
re PR c++/13140 (declaration in global namespace, definition inside named or anon namespace)
PR c++/13140 * decl.c (check_class_member_definition_namespace): New function. (grokfndecl): Use it. (grokvardecl): Likewise. (grokdecl): Improve documentation. * pt.c (check_explicit_instantiation_namespace): New function. (register_specialization): Call check_specialization_namespace when replacing an implicitly instantiated function. (check_explicit_specialization): Ensure that DECL_CONTEXT is set correctly for namespace-scope specializations. (do_decl_instantiation): Use check_explicit_instantiation_namespace. (do_type_instantiation): Likewise. PR c++/13140 * g++.dg/parse/class2.C: New test. * g++.dg/template/explicit8.C: Likewise. * g++.dg/template/spec25.C: Likewise. * testsuite/testsuite_character.h: Specialize character<> templates in __gnu_cxx, not in __gnu_test. From-SVN: r104310
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/testsuite/testsuite_character.h15
2 files changed, 13 insertions, 7 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 6c123bb..9585c6c 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-15 Mark Mitchell <mark@codesourcery.com>
+
+ * testsuite/testsuite_character.h: Specialize character<>
+ templates in __gnu_cxx, not in __gnu_test.
+
2005-09-13 Jonathan Wakely <cow@compsoc.man.ac.uk>
Benjamin Kosnik <bkoz@redhat.com>
diff --git a/libstdc++-v3/testsuite/testsuite_character.h b/libstdc++-v3/testsuite/testsuite_character.h
index 44c5efd..3d6a3f2 100644
--- a/libstdc++-v3/testsuite/testsuite_character.h
+++ b/libstdc++-v3/testsuite/testsuite_character.h
@@ -72,13 +72,15 @@ namespace __gnu_test
typedef character<unsigned char, unsigned int, pod_state> pod_uchar;
typedef character<unsigned short, unsigned int> pod_ushort;
typedef character<unsigned int, unsigned long> pod_uint;
+}
+namespace __gnu_cxx {
// Specializations.
// pod_char
template<>
template<typename V2>
- inline pod_char::char_type
- pod_char::char_type::from(const V2& v)
+ inline __gnu_test::pod_char::char_type
+ __gnu_test::pod_char::char_type::from(const V2& v)
{
char_type ret = { static_cast<value_type>(v.value) };
return ret;
@@ -87,17 +89,16 @@ namespace __gnu_test
template<>
template<typename V2>
inline V2
- pod_char::char_type::to(const char_type& c)
+ __gnu_test::pod_char::char_type::to(const char_type& c)
{
V2 ret = { c.value };
return ret;
}
- // pod_uchar
template<>
template<typename V2>
- inline pod_uchar::char_type
- pod_uchar::char_type::from(const V2& v)
+ inline __gnu_test::pod_uchar::char_type
+ __gnu_test::pod_uchar::char_type::from(const V2& v)
{
char_type ret;
ret.value = (v >> 5);
@@ -107,7 +108,7 @@ namespace __gnu_test
template<>
template<typename V2>
inline V2
- pod_uchar::char_type::to(const char_type& c)
+ __gnu_test::pod_uchar::char_type::to(const char_type& c)
{ return static_cast<V2>(c.value << 5); }
}; // namespace __gnu_test