diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cb861cb6674..0f23cbca9b7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2012-11-13 Dodji Seketeli + + PR c++/54466 + * pt.c (lookup_template_class_1): TYPE_STUB_DECL should be + accessed on the main variant of the type. + 2012-11-12 Ed Smith-Rowland <3dw4rd@verizon.net> * parser.c (cp_parser_objc_class_ivars): diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 50d12b08348..802c79b8755 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -7372,9 +7372,9 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context, if (CLASS_TYPE_P (template_type)) { TREE_PRIVATE (type_decl) - = TREE_PRIVATE (TYPE_STUB_DECL (template_type)); + = TREE_PRIVATE (TYPE_MAIN_DECL (template_type)); TREE_PROTECTED (type_decl) - = TREE_PROTECTED (TYPE_STUB_DECL (template_type)); + = TREE_PROTECTED (TYPE_MAIN_DECL (template_type)); if (CLASSTYPE_VISIBILITY_SPECIFIED (template_type)) { DECL_VISIBILITY_SPECIFIED (type_decl) = 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1eba36dd8f8..e82a88fb9a9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-11-13 Dodji Seketeli + + PR c++/54466 + * g++.dg/cpp0x/alias-decl-26.C: New test file. + 2012-11-13 H.J. Lu * gcc.target/i386/avx256-unaligned-load-2.c: Requre !ia32 diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-26.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-26.C new file mode 100644 index 00000000000..dd4cc0286a1 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-26.C @@ -0,0 +1,10 @@ +// Origin: PR c++/54466 +// { dg-do compile { target c++11 } } + +template + struct X { }; + +template + using Y = const X; + +using Z = Y;