From: aflinta Date: Fri, 6 Jun 2003 13:20:13 +0000 (+0000) Subject: - fixed PR10849 bug X-Git-Tag: auto/ac/gcc-3_3_2-0_1~25 X-Git-Url: http://git.pld-linux.org/?p=packages%2Fgcc.git;a=commitdiff_plain;h=e401b547dbd69a3d439116451a3c8788e74246ae - fixed PR10849 bug Changed files: gcc-PR10849.patch -> 1.1 --- diff --git a/gcc-PR10849.patch b/gcc-PR10849.patch new file mode 100644 index 0000000..666049f --- /dev/null +++ b/gcc-PR10849.patch @@ -0,0 +1,43 @@ +diff -cprN gcc-33-save/gcc/cp/search.c gcc-33-new/gcc/cp/search.c +*** gcc-33-save/gcc/cp/search.c Thu May 22 19:19:30 2003 +--- gcc-33-new/gcc/cp/search.c Sat May 24 19:03:32 2003 +*************** type_access_control (type, val) +*** 1020,1026 **** + { + if (val == NULL_TREE + || (TREE_CODE (val) != TEMPLATE_DECL && TREE_CODE (val) != TYPE_DECL) +! || ! DECL_CLASS_SCOPE_P (val)) + return; + + if (type_lookups == error_mark_node) +--- 1020,1027 ---- + { + if (val == NULL_TREE + || (TREE_CODE (val) != TEMPLATE_DECL && TREE_CODE (val) != TYPE_DECL) +! || ! DECL_CLASS_SCOPE_P (val) +! || processing_specialization) + return; + + if (type_lookups == error_mark_node) +diff -cprN gcc-33-save/gcc/testsuite/g++.dg/template/access10.C gcc-33-new/gcc/testsuite/g++.dg/template/access10.C +*** gcc-33-save/gcc/testsuite/g++.dg/template/access10.C Thu Jan 1 07:00:00 1970 +--- gcc-33-new/gcc/testsuite/g++.dg/template/access10.C Sat May 24 23:26:59 2003 +*************** +*** 0 **** +--- 1,16 ---- ++ // { dg-do compile } ++ ++ // Origin: Giovanni Bajo ++ ++ // PR c++/10849: Incorrect access checking on template specialization. ++ ++ class X { ++ private: ++ template struct Y; ++ }; ++ ++ template <> struct X::Y {}; ++ ++ template struct X::Y {}; ++ ++ template struct X::Y;