re PR c++/58457 (ICE when placement new operator is used with using keyword and custo...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 18 Sep 2013 18:11:46 +0000 (18:11 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 18 Sep 2013 18:11:46 +0000 (18:11 +0000)
/cp
2013-09-18  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/58457
* class.c (instantiate_type): Loosen a bit the gcc_assert.

/testsuite
2013-09-18  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/58457
* g++.dg/parse/using4.C: New.

From-SVN: r202711

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/using4.C [new file with mode: 0644]

index d53fb51198b74409c1b6c3a0ee1e59cbb6a31614..5ee1f9173b0b6acecc1cd7a4fb83f338337ec48e 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-18  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/58457
+       * class.c (instantiate_type): Loosen a bit the gcc_assert.
+
 2013-09-18  Marek Polacek  <polacek@redhat.com>
 
        PR sanitize/58443
index 3d34b92cfb1b22ecc5cc4da5e34f775bd54a3fce..9e0229fcba3708c2334d8af6f8dc5909daba463a 100644 (file)
@@ -7627,7 +7627,7 @@ instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
      dependent on overload resolution.  */
   gcc_assert (TREE_CODE (rhs) == ADDR_EXPR
              || TREE_CODE (rhs) == COMPONENT_REF
-             || really_overloaded_fn (rhs)
+             || is_overloaded_fn (rhs)
              || (flag_ms_extensions && TREE_CODE (rhs) == FUNCTION_DECL));
 
   /* This should really only be used when attempting to distinguish
index 348691e0b36d0d87cb33efd58870b7a56ad4b2b2..60c0baa719bf2001e77f183ee4738220733ce396 100644 (file)
@@ -1,3 +1,8 @@
+2013-09-18  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/58457
+       * g++.dg/parse/using4.C: New.
+
 2013-09-18  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * gcc.c-torture/execute/pr58419.c (b): Change type to signed char.
diff --git a/gcc/testsuite/g++.dg/parse/using4.C b/gcc/testsuite/g++.dg/parse/using4.C
new file mode 100644 (file)
index 0000000..2abe399
--- /dev/null
@@ -0,0 +1,20 @@
+// PR c++/58457
+
+struct allocator
+{
+  void operator delete (void*);
+  void* operator new (__SIZE_TYPE__, void*);
+};
+
+struct type : public allocator
+{
+  type() {}
+  using allocator::operator new;
+  using allocator::operator delete;
+};
+
+int main()
+{
+  new (0) type;
+  return 0;
+}