Hi,
the below one-liner appears to fix this regression: to be honest, I
cannot say to have fully analyzed the issue, but testsuite is fine on
x86_64-linux, both mainline and 4_6-branch (indeed the latter is also
affected, 4_4-branch isn't)
Is it Ok? In case, 4_6-branch too?
Thanks,
Paolo.
////////////////////
/cp
2011-09-22 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/50491
* semantics.c (potential_constant_expression_1): Handle USING_DECL.
/testsuite
2011-09-22 Paolo Carlini <paolo.carl...@oracle.com>
PR c++/50491
* g++.dg/cpp0x/pr50491.C: New.
Index: testsuite/g++.dg/cpp0x/pr50491.C
===================================================================
--- testsuite/g++.dg/cpp0x/pr50491.C (revision 0)
+++ testsuite/g++.dg/cpp0x/pr50491.C (revision 0)
@@ -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();
+ }
+};
Index: cp/semantics.c
===================================================================
--- cp/semantics.c (revision 179103)
+++ cp/semantics.c (working copy)
@@ -7751,6 +7751,7 @@ potential_constant_expression_1 (tree t, bool want
/* 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: