public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67267] New: demangler does not handle "sr" correctly
@ 2015-08-19  5:03 ian at airs dot com
  0 siblings, 0 replies; only message in thread
From: ian at airs dot com @ 2015-08-19  5:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67267

            Bug ID: 67267
           Summary: demangler does not handle "sr" correctly
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ian at airs dot com
                CC: gbenson at redhat dot com
  Target Milestone: ---

I don't have the source for this, but g++ generated this symbol name:

_ZN9__gnu_cxx17__normal_iteratorIPK1EIN1F1G1HEESt6vectorIS5_SaIS5_EEEC2IPS5_EERKNS0_IT_NS_11__enable_ifIXsr3std10__are_sameISE_SD_EE7__valueESA_E1IEEE

The demangler failed to demangle it.  However, this is a valid mangled name. 
The demangler does not handle the sr correctly.  It treats sr as a type
followed by a name.  However, the description of sr is this:

  <unresolved-name> ::= [gs] <base-unresolved-name>
                    ::= sr <unresolved-type> <base-unresolved-name>
                    ::= srN <unresolved-type> <unresolved-qualifier-level>+ E
<base-unresolved-name>
                    ::= [gs] sr <unresolved-qualifier-level>+ E
<base-unresolved-name>  

  <unresolved-type> ::= <template-param>
                    ::= <decltype>
                    ::= <substitution>

  <unresolved-qualifier-level> ::= <simple-id>

  <simple-id> ::= <source-name> [ <template-args> ]

  <base-unresolved-name> ::= <simple-id>
                         ::= on <operator-name>
                         ::= on <operator-name> <template-args>
                         ::= dn <destructor-name>

In this mangled name the string following "sr" does not match
<unresolved-type>, so this is the <unresolved-qualifier-level>+ E case.  The
demangler does not handle that case.

The correct demangling is something like

__gnu_cxx::__normal_iterator<E<F::G::H> const*, std::vector<E<F::G::H>,
std::allocator<E<F::G::H> > >
>::__normal_iterator<E<F::G::H>*>(__gnu_cxx::__normal_iterator<E<F::G::H>*,
__gnu_cxx::__enable_if<std::__are_same<E<F::G::H>*, E<F::G::H>*>::__value,
std::vector<E<F::G::H>, std::allocator<E<F::G::H> > > >::I> const&)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-08-19  5:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-19  5:03 [Bug c++/67267] New: demangler does not handle "sr" correctly ian at airs dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).