Skip to content

Commit 9946451

Browse files
authored
Fix possible ODR violation (#25368)
Fix possible ODR violation (this is what clang says when building with C++20 modules and doesn't allow compilation to proceed further)
1 parent d64c37e commit 9946451

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

system/include/emscripten/em_asm.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,9 @@ struct __em_asm_sig_builder {};
193193

194194
template<typename... Args>
195195
struct __em_asm_sig_builder<__em_asm_type_tuple<Args...> > {
196-
static const char buffer[sizeof...(Args) + 1];
196+
inline static const char buffer[sizeof...(Args) + 1] = { __em_asm_sig<Args>::value..., 0 };
197197
};
198198

199-
template<typename... Args>
200-
const char __em_asm_sig_builder<__em_asm_type_tuple<Args...> >::buffer[] = { __em_asm_sig<Args>::value..., 0 };
201-
202199
// We move to type level with decltype(make_tuple(...)) to avoid double
203200
// evaluation of arguments. Use __typeof__ instead of decltype, though,
204201
// because the header should be able to compile with clang's -std=c++03.

0 commit comments

Comments
 (0)