Skip to content

Commit 0255ef6

Browse files
committed
Provide forward declaration to make GCC happy
1 parent 82c9331 commit 0255ef6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libcxx/src/include/overridable_function.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ _LIBCPP_END_NAMESPACE_STD
6262

6363
# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1
6464
# define _LIBCPP_OVERRIDABLE_FUNCTION(symbol, type, name, arglist) \
65+
_LIBCPP_WEAK type name arglist; \
6566
_LIBCPP_WEAK_IMPORT extern type symbol arglist __asm__("_" _LIBCPP_TOSTRING(symbol)); \
6667
_LIBCPP_BEGIN_NAMESPACE_STD \
6768
template <> \
6869
inline bool __is_function_overridden<static_cast<type(*) arglist>(name)>() { \
6970
return static_cast<type(*) arglist>(name) != symbol; \
7071
} \
7172
_LIBCPP_END_NAMESPACE_STD \
72-
_LIBCPP_WEAK type name arglist
73+
type name arglist
7374

7475
#elif defined(_LIBCPP_OBJECT_FORMAT_ELF)
7576

@@ -82,14 +83,15 @@ _LIBCPP_END_NAMESPACE_STD
8283

8384
# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1
8485
# define _LIBCPP_OVERRIDABLE_FUNCTION(symbol, type, name, arglist) \
86+
_LIBCPP_WEAK type name arglist; \
8587
_LIBCPP_ALIAS(_LIBCPP_TOSTRING(symbol)) static type symbol arglist __asm__(".L." _LIBCPP_TOSTRING(symbol)); \
8688
_LIBCPP_BEGIN_NAMESPACE_STD \
8789
template <> \
8890
inline bool __is_function_overridden<static_cast<type(*) arglist>(name)>() { \
8991
return static_cast<type(*) arglist>(name) != symbol; \
9092
} \
9193
_LIBCPP_END_NAMESPACE_STD \
92-
_LIBCPP_WEAK type name arglist
94+
type name arglist
9395

9496
#else
9597

0 commit comments

Comments
 (0)