From a9727434c3f966d9a22e16b32cde3f005e304f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20Ch=C3=AAne?= Date: Mon, 5 Dec 2011 23:04:40 +0100 Subject: re PR c++/51319 (Eigen3 enums not accepted) gcc/testsuite/ChangeLog 2011-12-05 Fabien Chene PR c++/51319 * g++.dg/lookup/using50.C: New. * g++.dg/lookup/using51.C: New. gcc/cp/ChangeLog 2011-12-05 Fabien Chene PR c++/51319 * semantics.c (finish_id_expression): Strip using declarations early in the function. From-SVN: r182029 --- gcc/cp/semantics.c | 2 ++ gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/lookup/using50.C | 15 +++++++++++++++ gcc/testsuite/g++.dg/lookup/using51.C | 17 +++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 gcc/testsuite/g++.dg/lookup/using50.C create mode 100644 gcc/testsuite/g++.dg/lookup/using51.C (limited to 'gcc') diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index cca601d..9a1043a 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2893,6 +2893,8 @@ finish_id_expression (tree id_expression, const char **error_msg, location_t location) { + decl = strip_using_decl (decl); + /* Initialize the output parameters. */ *idk = CP_ID_KIND_NONE; *error_msg = NULL; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index efb2ed4..12709b7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2011-12-05 Fabien ChĂȘne + + PR c++/51319 + * g++.dg/lookup/using50.C: New. + * g++.dg/lookup/using51.C: New. + 2011-12-05 Jakub Jelinek PR tree-optimization/51396 diff --git a/gcc/testsuite/g++.dg/lookup/using50.C b/gcc/testsuite/g++.dg/lookup/using50.C new file mode 100644 index 0000000..d525a47 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/using50.C @@ -0,0 +1,15 @@ +// PR c++/51319 +// { dg-do compile } + +template struct X {}; + +struct Base +{ + enum { a = 1 }; +}; + +struct Der : Base +{ + using Base::a; + typedef X<(int)a> Y; +}; diff --git a/gcc/testsuite/g++.dg/lookup/using51.C b/gcc/testsuite/g++.dg/lookup/using51.C new file mode 100644 index 0000000..8438f7f --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/using51.C @@ -0,0 +1,17 @@ +// PR c++/51382 +// { dg-do compile } + +template< int Value > +struct Base +{ + enum { b_e = Value }; +}; + +template< typename Type > +struct Derived : Type +{ + Type::b_e; + enum { d_e = b_e }; +}; + +int v = (int)Derived< Base< 3 > >::d_e; -- cgit v1.1