[Bug Report] Unreal Header Tool parsing breaks on multi-line c++ comments

Branch: Source build, 4.10 (#define BRANCH_NAME “+depot+UE4-Releases+4.10”)

Description: Unreal Header Tool parsing fails silently with valid c++ multi-line comment syntax.

Repro steps:

  1. Compile this (fix up slightly with API and whatever else):

    /*
    */
    UCLASS()
    class UThisClassIsDetectedAsExpected : public UObject
    {
    GENERATED_BODY()
    };

    /*
    /*
    */
    UCLASS()
    class UThisClassWillBeIgnoredAlongWithSubsequentClassesDeclaredInThisSameFile : public UObject
    {
    GENERATED_BODY()
    };

The result of the bug is that when you compile your project, UnrealHeaderTool.exe crashes (assert fails) with this:
**
1> [PathToHeaderFile]: LogWindows:Error: Windows GetLastError: The operation completed successfully. (0)
1> [PathToHeaderFile] : LogWindows:Error: === Critical error: ===
1> Assertion failed: FoundClass [File:\Public\Engine\Source\Programs\UnrealHeaderTool\Private\HeaderParser.cpp] [Line: 4410]
1>Error : Failed to generate code for [ProjectName] - error code: CrashOrAssert (3)
1> UnrealHeaderTool failed for target [ProjectName] (platform: Win64, module info: [ProjectPath]\Intermediate\Build\Win64[ProjectName]\Development\UnrealHeaderTool.manifest).
**

Easy workaround by not using nested multi-line comments. But very hard to track down the root cause when it happens

Hello scamp,

Thank you for reporting this issue. It seems that this only occurs when multiple UClasses are being declared in the same header file and the nested comments are being used, such as in your reproduction case. I’ve placed a bug in for the issue under the number UE-28400. I’ll be sure to let you know when any updates are made to the bug in the future.

Have a nice day!