Skip to content

Commit 2c4c226

Browse files
committed
Code review snippets to address from @davidben
Also: * sus_if_msvc for attributes should be sus_if_msvc_not_cl * "language is msvc variant" vs "compiler is msvc" * sus_if_gnuc_language * test wrapping for each integer size, esp < 32bit * not destroy nevervalue? since it's in a union can that be a requirement on NeverValueTypes, and is C++ okay with constructing an object in a place where one already exists and was not destroyed?
1 parent 7147b8f commit 2c4c226

File tree

5 files changed

+51
-93
lines changed

5 files changed

+51
-93
lines changed

sus/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ target_sources(subspace PUBLIC
131131
"iter/zip.h"
132132
"macros/__private/compiler_bugs.h"
133133
"macros/assume.h"
134-
"macros/arch.h"
135134
"macros/builtin.h"
136135
"macros/compiler.h"
137136
"macros/eval_macro.h"

sus/macros/arch.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

sus/macros/pure.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
///
2222
/// A pure function is allowed to dereference pointers, and access global
2323
/// memory, but it may not change them. To do so can cause Undefined Behaviour.
24-
#define sus_pure sus_if_msvc_else([[nodiscard]], __attribute__((pure)))
24+
#define sus_pure [[nodiscard]] sus_if_not_msvc_compiler(, __attribute__((pure)))
2525

2626
/// Used to mark a function as "const", meaning it does not change any values
2727
/// outside of its own scope, and does not read global memory.
@@ -31,4 +31,4 @@
3131
/// A const function is allowed to only read from its inputs and determine an
3232
/// output from them, without going through pointers or accessing global memory.
3333
/// To do so anyway can cause Undefined Behaviour.
34-
#define sus_pure_const sus_if_msvc_else([[nodiscard]], __attribute__((const)))
34+
#define sus_pure_const [[nodiscard]] sus_if_msvc_else(, __attribute__((const)))

0 commit comments

Comments
 (0)