re PR c++/50491 ([C++0x] [4.6/4.7 Regression] "unexpected ast of kind using_decl...
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 23 Sep 2011 00:54:32 +0000 (00:54 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 23 Sep 2011 00:54:32 +0000 (00:54 +0000)
/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

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr50491.C [new file with mode: 0644]

index 8ec7a054e3833e0c49f44863ff221f12ce52b339..249cab60abbd544a883e91af358d876b783ff57c 100644 (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
index 150805f7e8108ac301eabb328d6e6bdff3056b12..0662b29b61f514d8d8738b726bfa1ee2060c3bf9 100644 (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:
index d9410dd4e50a36443329e534520a2f060ae3bfaf..c3aa2c1f73ef95e9e060358c8d58da3543216f41 100644 (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
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr50491.C b/gcc/testsuite/g++.dg/cpp0x/pr50491.C
new file mode 100644 (file)
index 0000000..48e7a1f
--- /dev/null
@@ -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();
+  }
+};