mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
sql: Work around Clang 17/18 run-time call to consteval function
There was an issue with Clang that causes `consteval` function calls from default initializers of fields to be made at run-time. This manifested itself in the case of `ByteString::formatted` as an undefined reference to `check_format_parameter_consistency` once format string checking was enabled for Clang builds. The workaround is simple (just move it to the member initializer list), and unblocks a useful change.
This commit is contained in:
1 parent
ca806a3e18
commit
9d3b73743e
1 file changed
+3
-2
@@ -26,7 +26,8 @@
|
||||
class SQLRepl {
|
||||
public:
|
||||
explicit SQLRepl(Core::EventLoop& loop, ByteString const& database_name, NonnullRefPtr<SQL::SQLClient> sql_client)
|
||||
: m_sql_client(move(sql_client))
|
||||
: m_history_path(ByteString::formatted("{}/.sql-history", Core::StandardPaths::home_directory()))
|
||||
, m_sql_client(move(sql_client))
|
||||
, m_loop(loop)
|
||||
{
|
||||
m_editor = Line::Editor::construct();
|
||||
@@ -147,7 +148,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
ByteString m_history_path { ByteString::formatted("{}/.sql-history", Core::StandardPaths::home_directory()) };
|
||||
ByteString m_history_path;
|
||||
RefPtr<Line::Editor> m_editor { nullptr };
|
||||
int m_repl_line_level { 0 };
|
||||
bool m_keep_running { true };
|
||||
|
||||
Reference in new issue
Block a user