Skip to content

Commit 8926c8c

Browse files
committed
fixed -Wlifetime-safety-cross-tu-constructor-suggestions Clang warnings
1 parent c0c2dff commit 8926c8c

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
8282
if(CMAKE_CXX_STANDARD LESS 20)
8383
add_compile_options_safe(-Wno-lifetime-safety-intra-tu-suggestions)
8484
add_compile_options_safe(-Wno-lifetime-safety-intra-tu-constructor-suggestions)
85+
add_compile_options_safe(-Wno-lifetime-safety-cross-tu-constructor-suggestions)
8586
endif()
86-
add_compile_options_safe(-Wno-lifetime-safety-cross-tu-constructor-suggestions)
8787

8888
# TODO: fix these?
8989
add_compile_options(-Wno-padded)

simplecpp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ namespace simplecpp {
278278
public:
279279
class Stream;
280280

281-
explicit TokenList(std::vector<std::string> &filenames);
281+
explicit TokenList(std::vector<std::string> &filenames SIMPLECPP_LIFETIMEBOUND);
282282
/** generates a token list from the given std::istream parameter */
283-
TokenList(std::istream &istr, std::vector<std::string> &filenames, const std::string &filename=std::string(), OutputList *outputList = nullptr);
283+
TokenList(std::istream &istr, std::vector<std::string> &filenames SIMPLECPP_LIFETIMEBOUND, const std::string &filename=std::string(), OutputList *outputList = nullptr);
284284
/** generates a token list from the given buffer */
285285
template<size_t size>
286286
TokenList(const char (&data)[size], std::vector<std::string> &filenames, const std::string &filename=std::string(), OutputList *outputList = nullptr)
@@ -318,7 +318,7 @@ namespace simplecpp {
318318
#endif // __cpp_lib_span
319319

320320
/** generates a token list from the given filename parameter */
321-
TokenList(const std::string &filename, std::vector<std::string> &filenames, OutputList *outputList = nullptr);
321+
TokenList(const std::string &filename, std::vector<std::string> &filenames SIMPLECPP_LIFETIMEBOUND, OutputList *outputList = nullptr);
322322
TokenList(const TokenList &other);
323323
TokenList(TokenList &&other);
324324
~TokenList();
@@ -398,7 +398,7 @@ namespace simplecpp {
398398
const std::string& file(const Location& loc) const;
399399

400400
private:
401-
TokenList(const unsigned char* data, std::size_t size, std::vector<std::string> &filenames, const std::string &filename, OutputList *outputList, int /*unused*/);
401+
TokenList(const unsigned char* data, std::size_t size, std::vector<std::string> &filenames SIMPLECPP_LIFETIMEBOUND, const std::string &filename, OutputList *outputList, int /*unused*/);
402402

403403
void combineOperators();
404404

0 commit comments

Comments
 (0)