-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
Bugzilla Link | 20157 |
Version | trunk |
OS | All |
Blocks | #30794 |
Reporter | LLVM Bugzilla Contributor |
CC | @hfinkel,@RKSimon,@zygoloid |
Fixed by commit(s) | b30c166 |
Extended Description
It seems many uses of a type based on ext_vector_type are not suitable for use in a constexpr, for example:
typedef float attribute((ext_vector_type(4))) float4;
constexpr float4 MultiplyByTwo(float4 x)
{
return x * 2.0f;
}
main.cpp:3:18: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
constexpr float4 MultiplyByTwo(float4 x)
^
main.cpp:5:12: note: subexpression not valid in a constant expression
return x * 2.0f;
^
1 error generated.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"