This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11106] New: Error message gives partially mangled operator name


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11106

           Summary: Error message gives partially mangled operator name
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bangerth@dealii.org
                CC: gcc-bugs@gcc.gnu.org

The following code is clearly illegal (there really is no such member
that can be injected by the "using" declaration), but the code can be made
legal as in 11097. I make it illegal so that this bug can still be
triggered in case 11097 should already be fixed.

So, here's the code:
----------------------------
template <typename T> struct S {
    struct I {};
};

template <typename T> struct S2 : S<T> {
    using S<T>::operator typename S<T>::I*;
};

S<int>::I i = S2<int>();
----------------------------

The output we get from either 3.3 or mainline is:
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc: In instantiation of `S2<int>':
x.cc:9:   instantiated from here
x.cc:6: error: no members matching `using S<int>::operator PN1SIT_0__E1IE' in `
   struct S<int>'
x.cc:9: error: conversion from `S2<int>' to non-scalar type `S<int>::I'
   requested

Note that the name of the operator is only partially unmangled. This
is not very helpful. The problem already goes back to at least 2.95, so
no regression.

W.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]