Skip to content

Problem with multiple template function instantiations on linux & mac #871

@nwgh

Description

@nwgh

I'm working on a codebase where I have a template member function of a class that is explicitly instantiated twice. Template definition is at https://searchfox.org/mozilla-central/rev/5e1e8d2f244bd8c210a578ff1f65c3b720efe34e/netwerk/protocol/http/Http2Session.cpp#676 with explicit instantiations a few lines down at https://searchfox.org/mozilla-central/rev/5e1e8d2f244bd8c210a578ff1f65c3b720efe34e/netwerk/protocol/http/Http2Session.cpp#707 and https://searchfox.org/mozilla-central/rev/5e1e8d2f244bd8c210a578ff1f65c3b720efe34e/netwerk/protocol/http/Http2Session.cpp#712

On both my mac and linux machines, I get the error function mozilla::net::Http2Session::CreateFrameHeader(charType dest, uint16_t frameLength, uint8_t frameType, uint8_t frameFlags, uint32_t streamID) [with charType=char *]" explicitly instantiated more than once twice (once for each instantiation, with the appropriate with charType bit for each line). This doesn't happen on my win10 machine using the same versions of everything. This is valid code that compiles on all 3 platforms without errors or warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.parser

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions