File tree 4 files changed +4
-8
lines changed
4 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,10 @@ class HalidePythonCompileTimeErrorReporter : public CompileTimeErrorReporter {
16
16
halide_python_print (nullptr , msg);
17
17
}
18
18
19
- void error (const char *msg) override {
19
+ [[noreturn]] void error (const char *msg) override {
20
20
// This method is called *only* from the Compiler -- never from jitted
21
21
// code -- so throwing an Error here is the right thing to do.
22
-
23
22
throw Error (msg);
24
-
25
- // This method must not return!
26
23
}
27
24
};
28
25
Original file line number Diff line number Diff line change @@ -37,9 +37,8 @@ class HalidePythonCompileTimeErrorReporter : public CompileTimeErrorReporter {
37
37
py::print (msg, py::arg (" end" ) = " " );
38
38
}
39
39
40
- void error (const char *msg) override {
40
+ [[noreturn]] void error (const char *msg) override {
41
41
throw Halide::Error (msg);
42
- // This method must not return!
43
42
}
44
43
};
45
44
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ class CompileTimeErrorReporter {
83
83
public:
84
84
virtual ~CompileTimeErrorReporter () = default ;
85
85
virtual void warning (const char *msg) = 0;
86
- virtual void error (const char *msg) = 0;
86
+ [[noreturn]] virtual void error (const char *msg) = 0;
87
87
};
88
88
89
89
/* * The default error reporter logs to stderr, then throws an exception
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class MyCustomErrorReporter : public Halide::CompileTimeErrorReporter {
33
33
warnings_occurred++;
34
34
}
35
35
36
- void error (const char *msg) override {
36
+ [[noreturn]] void error (const char *msg) override {
37
37
// Emitting "error.*:" to stdout or stderr will cause CMake to report the
38
38
// test as a failure on Windows, regardless of error code returned.
39
39
// The error text we get from ErrorReport probably contains some variant
You can’t perform that action at this time.
0 commit comments