aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2011-09-23 00:54:32 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2011-09-23 00:54:32 +0000
commitee71530f565569b3972c5723b4aef3b6f8613211 (patch)
treef1571fce2ec69168cc809a1a8256b5db5f9692b2 /gcc
parentf8b4d70d01982e40d1670cdb166a320d525b6adf (diff)
downloadgcc-ee71530f565569b3972c5723b4aef3b6f8613211.zip
gcc-ee71530f565569b3972c5723b4aef3b6f8613211.tar.gz
gcc-ee71530f565569b3972c5723b4aef3b6f8613211.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/semantics.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr50491.C17
4 files changed, 28 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8ec7a05..249cab6 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
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
* pt.c (invalid_nontype_parm_type_p): Handle NULLPTR_TYPE.
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 150805f..0662b29 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 d9410dd..c3aa2c1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..48e7a1f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr50491.C
@@ -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();
+ }
+};