Compiler Error C2024
'alignas' attribute applies to variables, data members and tag types only
The compiler found an alignas
specifier applied to a function or other type that can't be aligned.
To resolve this error, remove the alignas
specifier.
The following sample generates C2024:
// C2024.cpp
namespace alignas(2) ns { // C2024
void func(alignas(8) int x) {} // C2024
}
Possible resolution:
// C2024b.cpp
// compile with: /c
namespace ns {
void func(int x) {}
}
Pripomienky
https://aka.ms/ContentUserFeedback.
Pripravujeme: V priebehu roka 2024 postupne zrušíme službu Problémy v službe GitHub ako mechanizmus pripomienok týkajúcich sa obsahu a nahradíme ju novým systémom pripomienok. Ďalšie informácie nájdete na stránke:Odoslať a zobraziť pripomienky pre