From ee71530f565569b3972c5723b4aef3b6f8613211 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 23 Sep 2011 00:54:32 +0000 Subject: [PATCH] re PR c++/50491 ([C++0x] [4.6/4.7 Regression] "unexpected ast of kind using_decl" on call to using'ed grandparent member function) /cp 2011-09-22 Paolo Carlini PR c++/50491 * semantics.c (potential_constant_expression_1): Handle USING_DECL. /testsuite 2011-09-22 Paolo Carlini PR c++/50491 * g++.dg/cpp0x/pr50491.C: New. From-SVN: r179109 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/semantics.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/pr50491.C | 17 +++++++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr50491.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8ec7a054e38..249cab60abb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2011-09-22 Paolo Carlini + + PR c++/50491 + * semantics.c (potential_constant_expression_1): Handle USING_DECL. + 2011-09-22 Paolo Carlini PR c++/50371 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 150805f7e81..0662b29b61f 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -7751,6 +7751,7 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) /* We can see a FIELD_DECL in a pointer-to-member expression. */ case FIELD_DECL: case PARM_DECL: + case USING_DECL: return true; case AGGR_INIT_EXPR: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d9410dd4e50..c3aa2c1f73e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-09-22 Paolo Carlini + + PR c++/50491 + * g++.dg/cpp0x/pr50491.C: New. + 2011-09-22 Steven G. Kargl PR testsuite/50487 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr50491.C b/gcc/testsuite/g++.dg/cpp0x/pr50491.C new file mode 100644 index 00000000000..48e7a1f743b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr50491.C @@ -0,0 +1,17 @@ +// { dg-options "-std=c++0x" } + +struct GrandParent { + void *get(); +}; + +template +struct Parent : public GrandParent{ +}; + +template +struct Child : public Parent { + using GrandParent::get; + void Foo() { + void* ex = get(); + } +};