Description

The alignas keyword is not usable with a USTRUCT. It can be used with a normal struct.

Steps to Reproduce
  1. Create a new Basic Code project.
  2. In the GameModeBase.h file for the new project, add the following USTRUCT
    USTRUCT(BlueprintType)
    struct alignas(64) FMapCell
    {
    	GENERATED_BODY()
    
    	int32 TestVar;
    };
    
  3. Build the project in Visual Studio.

RESULT:
The build fails with the following error: error : Struct 'alignas' is missing a valid Unreal prefix, expecting 'Falignas'

EXPECTED:
The build completes successfully.

Have Comments or More Details?

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

2
Login to Vote

Fixed
ComponentUE - Foundation - Core
Affects Versions4.19.24.224.20.3
Target Fix4.22
Fix Commit4516252
Main Commit4772220
Release Commit4862694
CreatedOct 24, 2018
ResolvedOct 29, 2018
UpdatedFeb 12, 2019