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

            Bug ID: 86379
           Summary: Class member access of |using|'d field goes horribly
                    awry in presence of templates
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jwalden+ggo at mit dot edu
  Target Milestone: ---

Created attachment 44345
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44345&action=edit
Mostly-reduced testcase

SpiderMonkey is hitting compile errors with gcc 8/8.1/trunk (per godbolt) when,
inside a member function in a template class, accessing member functions on a
field inherited from a base class.  The error messages indicate that the member
isn't being found in a type that is *entirely different* from the type of the
member being 'using'd, so it looks like a member lookup is happening on an
entirely wrongly-computed type -- no other plausible explanation.

This is a regression in gcc 8; godbolt says 7.3 compiles it just fine.  clang
also has no problems with it.

I've attached a standalone testcase just over 200 lines long; compiler output
is tacked on the end of the file in a comment.  I could reduce further, but 1)
I'm guessing it's obvious which thing is miscomputed where, and 2) I'm unsure
exactly which interlocking parts of this, if removed, won't by pure
happenstance jar it back into alignment.

This is probably a duplicate, but I don't know the search terms to find the
original.  :-(

I can work around these issues by not |using| the various fields and instead
|this->|-qualifying them, but this gets pretty wordy.  If there's a better
workaround, I'd love to know it!

Reply via email to