Obj: make no_location constexpr

This ensures that the variable is initialized at compile time and may
allow the compiler to apply more initializations.
This commit is contained in:
Max Kellermann 2020-02-07 11:12:23 +01:00
parent 2a7f2e0217
commit 2ac48ff1d4
2 changed files with 1 additions and 2 deletions

View file

@ -10,7 +10,6 @@
#include "File.h"
#include "plugin/Manager.h"
Location no_location("<no location>", 0, 0, 0, 0);
Location start_location("<start uninitialized>", 0, 0, 0, 0);
Location end_location("<end uninitialized>", 0, 0, 0, 0);

View file

@ -31,7 +31,7 @@ typedef Location yyltype;
YYLTYPE GetCurrentLocation();
// Used to mean "no location associated with this object".
extern Location no_location;
inline constexpr Location no_location("<no location>", 0, 0, 0, 0);
// Current start/end location.
extern Location start_location;