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  <paolo.carlini@oracle.com>

	PR c++/50491
	* semantics.c (potential_constant_expression_1): Handle USING_DECL.

/testsuite
2011-09-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/50491
	* g++.dg/cpp0x/pr50491.C: New.

From-SVN: r179109
This commit is contained in:
Paolo Carlini 2011-09-23 00:54:32 +00:00 committed by Paolo Carlini
parent f8b4d70d01
commit ee71530f56
4 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-09-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50491
* semantics.c (potential_constant_expression_1): Handle USING_DECL.
2011-09-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50371

View File

@ -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:

View File

@ -1,3 +1,8 @@
2011-09-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/50491
* g++.dg/cpp0x/pr50491.C: New.
2011-09-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR testsuite/50487

View File

@ -0,0 +1,17 @@
// { dg-options "-std=c++0x" }
struct GrandParent {
void *get();
};
template<class OBJ>
struct Parent : public GrandParent{
};
template<typename T>
struct Child : public Parent<T> {
using GrandParent::get;
void Foo() {
void* ex = get();
}
};