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(); + } +};