diff options
author | Fabien Chêne <fabien@gcc.gnu.org> | 2011-12-05 23:04:40 +0100 |
---|---|---|
committer | Fabien Chêne <fabien@gcc.gnu.org> | 2011-12-05 23:04:40 +0100 |
commit | a9727434c3f966d9a22e16b32cde3f005e304f92 (patch) | |
tree | 2d3527a5b38e2c5f40bce11ac0febc39cf39c7fc | |
parent | 0fb808ea7a0f30531e9a1495b9aafa5267c2f0b5 (diff) | |
download | gcc-a9727434c3f966d9a22e16b32cde3f005e304f92.zip gcc-a9727434c3f966d9a22e16b32cde3f005e304f92.tar.gz gcc-a9727434c3f966d9a22e16b32cde3f005e304f92.tar.bz2 |
re PR c++/51319 (Eigen3 enums not accepted)
gcc/testsuite/ChangeLog
2011-12-05 Fabien Chene <fabien@gcc.gnu.org>
PR c++/51319
* g++.dg/lookup/using50.C: New.
* g++.dg/lookup/using51.C: New.
gcc/cp/ChangeLog
2011-12-05 Fabien Chene <fabien@gcc.gnu.org>
PR c++/51319
* semantics.c (finish_id_expression): Strip using declarations
early in the function.
From-SVN: r182029
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/using50.C | 15 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/lookup/using51.C | 17 |
4 files changed, 40 insertions, 0 deletions
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 <fabien@gcc.gnu.org> + + PR c++/51319 + * g++.dg/lookup/using50.C: New. + * g++.dg/lookup/using51.C: New. + 2011-12-05 Jakub Jelinek <jakub@redhat.com> 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<int> 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; |