re PR c++/60894 (Use of redundant struct keyword in function prototype combined with...
authorPaolo Carlini <paolo@gcc.gnu.org>
Fri, 13 Feb 2015 23:57:10 +0000 (23:57 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 13 Feb 2015 23:57:10 +0000 (23:57 +0000)
/cp
2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/60894
* decl.c (lookup_and_check_tag): Use strip_using_decl.

/testsuite
2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/60894
* g++.dg/lookup/using54.C: New.

From-SVN: r220702

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lookup/using54.C [new file with mode: 0644]

index 0738e8b7b143fef79d409271158abb05cc63c6df..6d21c286686804b33c6afaab8c9d2153e88567b3 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/60894
+       * decl.c (lookup_and_check_tag): Use strip_using_decl.
+
 2015-02-13  Jason Merrill  <jason@redhat.com>
 
        PR c++/65054
index bc481bfe2f5091aae1315b45a9bc9350ec7e7976..67c5ae73e361b6f28d8e9f201dd7fef31dd08f6f 100644 (file)
@@ -12205,6 +12205,7 @@ lookup_and_check_tag (enum tag_types tag_code, tree name,
       /* First try ordinary name lookup, ignoring hidden class name
         injected via friend declaration.  */
       decl = lookup_name_prefer_type (name, 2);
+      decl = strip_using_decl (decl);
       /* If that fails, the name will be placed in the smallest
         non-class, non-function-prototype scope according to 3.3.1/5.
         We may already have a hidden name declared as friend in this
index bb13dc15523ecf2d6a4bb2bd72cf48d76b90d0d5..f6e5ccc1c3bc920e025001abb66ab3986832ef26 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-13  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/60894
+       * g++.dg/lookup/using54.C: New.
+
 2015-02-13  Jeff Law  <law@redhat.com>
 
        PR bootstrap/65060
@@ -17,7 +22,7 @@
 2015-02-13  Jeff Law  <law@redhat.com>
 
        PR tree-optimization/64823
-       gcc.dg/uninit-20.c: New test.
+       gcc.dg/uninit-20.c: New test.
 
        PR rtl-optimization/47477
        * gcc.dg/tree-ssa/pr47477.c: New test.
diff --git a/gcc/testsuite/g++.dg/lookup/using54.C b/gcc/testsuite/g++.dg/lookup/using54.C
new file mode 100644 (file)
index 0000000..680bdad
--- /dev/null
@@ -0,0 +1,16 @@
+// PR c++/60894
+
+struct B
+{
+  struct S {};
+};
+
+struct D : B
+{
+  using B::S;
+  void doIt(struct S&);
+};
+
+void D::doIt(struct S&)
+{
+}