From: Paolo Carlini Date: Fri, 23 Sep 2011 00:54:32 +0000 (+0000) Subject: re PR c++/50491 ([C++0x] [4.6/4.7 Regression] "unexpected ast of kind using_decl... X-Git-Tag: releases/gcc-4.7.0~3626 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee71530f565569b3972c5723b4aef3b6f8613211;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8ec7a054e383..249cab60abbd 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 150805f7e810..0662b29b61f5 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 d9410dd4e50a..c3aa2c1f73ef 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 000000000000..48e7a1f743be --- /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(); + } +};