File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 16
16
#include < mrdox/Support/Format.hpp>
17
17
#include < exception>
18
18
#include < iterator>
19
+ #include < source_location>
19
20
#include < string>
20
21
#include < string_view>
21
22
#include < type_traits>
@@ -37,7 +38,8 @@ class [[nodiscard]] MRDOX_DECL
37
38
static
38
39
std::string
39
40
appendSourceLocation (
40
- std::string&&, std::source_location const &);
41
+ std::string&&,
42
+ std::source_location const &);
41
43
42
44
public:
43
45
/* * Constructor.
@@ -76,9 +78,9 @@ class [[nodiscard]] MRDOX_DECL
76
78
std::string reason,
77
79
std::source_location loc =
78
80
std::source_location::current ())
79
- : message_ (appendSourceLocation (
80
- std::string (reason), loc))
81
+ : message_ (appendSourceLocation (std::string (reason), loc))
81
82
, reason_ (std::move (reason))
83
+ , loc_ (loc)
82
84
{
83
85
MRDOX_ASSERT (! message_.empty ());
84
86
}
@@ -101,7 +103,10 @@ class [[nodiscard]] MRDOX_DECL
101
103
}
102
104
103
105
explicit
104
- Error (std::vector<Error> const & errors);
106
+ Error (
107
+ std::vector<Error> const & errors,
108
+ std::source_location loc =
109
+ std::source_location::current ());
105
110
106
111
/* * Return true if this holds an error.
107
112
*/
Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ appendSourceLocation(
40
40
41
41
Error::
42
42
Error (
43
- std::vector<Error> const & errors)
43
+ std::vector<Error> const & errors,
44
+ std::source_location loc)
44
45
{
45
46
MRDOX_ASSERT (errors.size () > 0 );
46
47
if (errors.size () == 1 )
56
57
message_.append (err.message ());
57
58
message_.push_back (' \n ' );
58
59
}
60
+ reason_ = message_;
61
+ loc_ = loc;
59
62
}
60
63
61
64
SourceLocation::
You can’t perform that action at this time.
0 commit comments