Launchpad has imported 6 comments from the remote bug at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44628.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://documentation.ubuntu.com/launchpad/user/reference/bugs/multi-project-bugs/about-multi-project-bugs/#bugs-in-external-trackers.

------------------------------------------------------------------------
On 2010-06-22T09:47:14+00:00 Matthias Klose wrote:

seen with 4.3 and newer

template <typename T>
class Temp
{
  int Val;
  public:
  operator T&(void)  { return Val; }

  virtual T& operator=(T a )
  {
    Val = a;
    return Val;
  }
};

class Int : public Temp<int>
{
  public:
  Int& operator=(int a)
  {
    return (*this);
  }
};


Program received signal SIGSEGV, Segmentation fault.
cp_build_unary_op (code=ADDR_EXPR, xarg=<value optimized out>, noconvert=<value 
optimized out>, 
    complain=3) at ../../src/gcc/cp/typeck.c:4671
4671        return error_mark_node;

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/520043/comments/2

------------------------------------------------------------------------
On 2010-06-22T10:57:32+00:00 Rguenth wrote:

2.95 says

t.C:19: conflicting return type specified for virtual function `class Int & 
Int::operator =(int)'
t.C:9:   overriding definition as `int & Temp<int>::operator =(int)'

and EDG

t.C(18): error: return type is not identical to nor covariant with return type 
"int &" of overridden virtual function function "Temp<T>::operator=(T) [with 
T=int]"
          Int& operator=(int a)
               ^

compilation aborted for t.C (code 2)


Reply at: 
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/520043/comments/3

------------------------------------------------------------------------
On 2010-06-30T17:09:20+00:00 Paolo-carlini wrote:

I have a patch.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/520043/comments/4

------------------------------------------------------------------------
On 2010-06-30T20:47:02+00:00 Paolo-k wrote:

Subject: Bug 44628

Author: paolo
Date: Wed Jun 30 20:46:46 2010
New Revision: 161639

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161639
Log:
/cp
2010-06-30  Paolo Carlini  <[email protected]>

        PR c++/44628
        * typeck.c (cp_build_unary_op): Early return error_mark_node when
        arg is NULL_TREE too.
        * call.c (convert_class_to_reference): Return error_mark_node when
        expr is NULL_TREE.

/testsuite
2010-06-30  Paolo Carlini  <[email protected]>

        PR c++/44628
        * g++.dg/template/crash100.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/template/crash100.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog


Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/520043/comments/5

------------------------------------------------------------------------
On 2010-06-30T22:06:47+00:00 Paolo-k wrote:

Subject: Bug 44628

Author: paolo
Date: Wed Jun 30 22:06:28 2010
New Revision: 161645

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161645
Log:
/cp
2010-06-30  Paolo Carlini  <[email protected]>

        PR c++/44628
        * typeck.c (cp_build_unary_op): Early return error_mark_node when
        arg is NULL_TREE too.
        * call.c (convert_class_to_reference): Return error_mark_node when
        expr is NULL_TREE.

/testsuite
2010-06-30  Paolo Carlini  <[email protected]>

        PR c++/44628
        * g++.dg/template/crash97.C: New.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/g++.dg/template/crash97.C
Modified:
    branches/gcc-4_5-branch/gcc/cp/ChangeLog
    branches/gcc-4_5-branch/gcc/cp/call.c
    branches/gcc-4_5-branch/gcc/cp/typeck.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/520043/comments/6

------------------------------------------------------------------------
On 2010-06-30T22:07:42+00:00 Paolo-carlini wrote:

Fixed for 4.5.1 and mainline.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/520043/comments/7

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/520043

Title:
  [PR44628] g++ segfaults on templated class virtuals

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/520043/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to