Description

If a multi-line comment is made in a header file using the format /*/ at the beginning and ending of the comment, UHT will fail to compile the project and will display the following errors:

1>  C:/Users/Tim.Lincoln/Documents/Unreal Projects/TestComment 4.10/Source/TestComment/MyActor.h(26) : End of class header encountered inside comment
1>Error : Failed to generate code for TestCommentEditor - error code: OtherCompilationError (5)

This may be similar to [Link Removed].

Steps to Reproduce
  1. Create a new code project using the first person template.
  2. Add a new code class to the project that is derived from Actor.
  3. In the source file for the new Actor class, comment out the entire BeginPlay() function.
  4. In the header file, add /*/ above and below the BeginPlay() declaration.
  5. Build the project in Visual Studio.

RESULT:
The build fails with the message End of class header encountered inside comment

EXPECTED:
The build completes successfully.

WORKAROUND:
Adding spaces allows the build to complete successfully. For example, the following works fine:

/* /
virtual void BeginPlay() override;
/ */

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Fixed
ComponentUE - Foundation - Core
Affects Versions4.8.34.10
Target Fix4.10
Fix Commit2657671
Release Commit2712730
CreatedAug 7, 2015
ResolvedAug 17, 2015
UpdatedFeb 5, 2017