The `unused-lambda-capture` will be triggered by the following code:
```cpp
void foo(int);
int main() {
const int i = 0;
auto l = [i](){foo(i);};
}
```
The issue here is that reading from the constant variable `i` does not
constitute an ODR-use, and consequently the variable does not have to be
captured. See
https://github.com/llvm/llvm-project/issues/34213#issuecomment-980987311
for a related discussion.
However, MSVC sees it differently.
In order to make both compilers happy, mark this variable with
`AZ_UNUSED`, since lambda captures can't be marked with attributes like
`[[maybe_unused]]`.
Signed-off-by: Chris Burel <burelc@amazon.com>
Using a `static_assert(false, ...)` expression in the `else` block of a
`if constexpr` statement doesn't work. The `else` block is not protected by
the `constexpr`-ness of the `if`s, so it is always compiled. Consequently
it will always fail to compile.
Signed-off-by: Chris Burel <burelc@amazon.com>
`RepoPath` is implemented with an `AZ::IO::Path`, which is not `constexpr`.
Consequently, its constructors also cannot be `constexpr`.
This also marks the function definitions in the header as `inline`, to
avoid ODR violations.
Signed-off-by: Chris Burel <burelc@amazon.com>
This overload has significant impact on overload resolution. Consider these
overloads:
```cpp
void to_string(AZStd::string& dest, AZStd::wstring_view src);
void to_string(string& str, bool value);
```
And then calling code like this:
```
WCHAR src[260];
AZStd::string dst;
AZStd::to_string(dst, src); // Which overload does this call?
```
If the .cpp has not included `MCore/Source/StringConversions.h`, the call
to `to_string()` will convert the `WCHAR[260]` type to a
`AZStd::wstring_view`, and call the first overload. But if
`StringConversions.h` _has_ been included, the implicit conversion of
`WCHAR[260]` to `bool` has a higher precedence, and it will be chosen
instead.
This overload was causing some uses of `to_string` in
`AnimGraph/GameController.cpp` to resolve to the wrong overload in unity
builds.
Signed-off-by: Chris Burel <burelc@amazon.com>
The previous code had the `alignas()` in the wrong place, it needs to be
left of the typename.
Furthermore, `CONTEXT` has a default alignment of 16, so using `alignas(8)`
underaligns.
Signed-off-by: Chris Burel <burelc@amazon.com>
This macro was expecting that parenthesis used in the macro would be
removed during macro expansion, when they are not removed. The result was
a function call like this:
```cpp
AZ_Assert(g_SymGetSearchPath != 0, ("Can not load %s function!","SymGetSearchPath"));
```
The parenthesis cause the contents of the parenthsis to be evaluated first,
and the result is an expression using the comma operator. The comma
operator evaluates the left expression, discards the result, then
evaluates the right expression, and returns that. So the above dropping
the message, and just leaving:
```cpp
AZ_Assert(g_SymGetSearchPath != 0, "SymGetSearchPath");
```
Signed-off-by: Chris Burel <burelc@amazon.com>
Added new attribute "DisableEditButtonWheNoAssetSelected" to PropertyAssetCtrl. By default it's false, keeping the original behavior of leaving the edit button enabled and if it's clicked while there is no asset assigned it'll try to create a new one.
PhysX mesh asset property uses now this new feature.
Signed-off-by: moraaar moraaar@amazon.com
When `"Atom": {"GraphicsDevMode": true}` is found in a `.setreg` file,
PDBs for all shaders will be emitted to their corresponding output
locations. This allows global PDB generation without needing to
explicitly modify each `.shader` file to include the `GenerateDebugInfo`
compilation option.
Signed-off-by: Jeremy Ong <jcong@amazon.com>
* Collects failed assets on LyTestTools test failures
Signed-off-by: evanchia <evanchia@amazon.com>
* Changed query to all lines because of current asset logging bug
Signed-off-by: evanchia <evanchia@amazon.com>
* fixes per pr feedback
Signed-off-by: evanchia <evanchia@amazon.com>
* testing removing change for AR failure
Signed-off-by: evanchia <evanchia@amazon.com>
* Moved asset log artifact collection to after the results have been collected
Signed-off-by: evanchia <evanchia@amazon.com>
* Adding debug line to help debug AR failure
Signed-off-by: evanchia <evanchia@amazon.com>
* Made asset log collection non failing
Signed-off-by: evanchia <evanchia@amazon.com>
* moved asset log collection after test result collection
Signed-off-by: evanchia <evanchia@amazon.com>
* changed asset saving to non failing
Signed-off-by: evanchia <evanchia@amazon.com>
* improved logging and comments
Signed-off-by: evanchia <evanchia@amazon.com>
Terrain default surface material
This adds the ability to set a default material on detail material regions as a fallback material for when there are no materials for an assigned surface tag, or there's only one surface tag but its weight is less than 1.0.
This also fixes some issues
- The terrain surface list component now correctly sends notifications on tag changes.
- The terrain area material notifications bus now has two separate change notifications - one for material, the other for tag
- The terrain renderer will now only consider a single region per point queried instead of any region that might have a matching surface tag.
When duplicating an entity with a Gradient SurfaceData Component, it's possible to get a hang/crash due to a race condition between entity deactivation and the gradient preview job refresh. This change ensures that the preview job is canceled on deactivation.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>