Description

Looks like CL-3215392 added changes in FArchive where the operator<< method for bool is a member operator in Editor (as opposed to a global operator in non-editor and old builds).

This causes shadowing issues so subclasses that implement additional operator<< methods, or override existing ones will break compilation.

Some classes (like FMemoryArchive) get around this with `using FArchive::<<`.

Should probably investigate to see all the classes this could affect.

Steps to Reproduce
  1. Add the below code to any class in QAGame
  2. Attempt to compile QAGame
static void Test()
{
    TArray<uint8> ObjectBytes;
    FMemoryWriter MemoryWriter(ObjectBytes, true);
    FObjectAndNameAsStringProxyArchive test(MemoryWriter, false);

    bool testBool = false;
    test << testBool;
}

Expected: The compile succeeds.
Actual: The compile fails with: `error C2679: binary '<<': no operator found which takes a right-hand operand of type 'bool' (or there is no acceptable conversion)`

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-42052 in the post.

2
Login to Vote

Fixed
ComponentUE - Foundation - Core
Affects Versions4.15
Target Fix4.16
Fix Commit3309231
Main Commit3315211
CreatedFeb 16, 2017
ResolvedFeb 17, 2017
UpdatedApr 27, 2018