mirror of
https://github.com/gperftools/gperftools
synced 2025-01-03 05:02:04 +00:00
Fix gcc 10 compilation error
Apparently, gcc 10 doesn't support trailing return types for lambdas with an attribute. ``` src/tests/sampling_test.cc: In lambda function: src/tests/sampling_test.cc:70:56: error: expected '{' before '->' token 70 | auto local_noopt = [] (void* ptr) ATTRIBUTE_NOINLINE -> void* { | ^~ src/tests/sampling_test.cc: In function 'void* AllocateAllocate()': src/tests/sampling_test.cc:70:56: error: base operand of '->' has non-pointer type 'AllocateAllocate()::<lambda(void*)>' src/tests/sampling_test.cc:70:59: error: expected unqualified-id before 'void' 70 | auto local_noopt = [] (void* ptr) ATTRIBUTE_NOINLINE -> void* { | ^~~~ ``` Remove the trailing return type as it is deduced from the `noopt` call anyway.
This commit is contained in:
parent
c7dcabf09a
commit
2e1799aa78
@ -67,7 +67,7 @@ static std::string NaiveShellQuote(std::string_view arg) {
|
||||
|
||||
extern "C" ATTRIBUTE_NOINLINE
|
||||
void* AllocateAllocate() {
|
||||
auto local_noopt = [] (void* ptr) ATTRIBUTE_NOINLINE -> void* {
|
||||
auto local_noopt = [] (void* ptr) ATTRIBUTE_NOINLINE {
|
||||
return noopt(ptr);
|
||||
};
|
||||
return local_noopt(malloc(10000));
|
||||
|
Loading…
Reference in New Issue
Block a user