File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,8 @@ class ErrorAsOutParameter {
278278 (void )!!*Err;
279279 }
280280
281+ ErrorAsOutParameter (Error &Err) : Err(&Err) { (void )!!Err; }
282+
281283 ~ErrorAsOutParameter () {
282284 // Clear the checked bit.
283285 if (Err && !*Err)
Original file line number Diff line number Diff line change @@ -257,6 +257,15 @@ TEST(ErrorTest, ErrorAsOutParameterUnchecked) {
257257 << " ErrorAsOutParameter did not clear the checked flag on destruction." ;
258258}
259259
260+ // Test that we can construct an ErrorAsOutParameter from an Error&.
261+ TEST (ErrorTest, ErrorAsOutParameterRefConstructor) {
262+ Error E = Error::success ();
263+ {
264+ ErrorAsOutParameter _ (E); // construct with Error&.
265+ }
266+ (void )!!E;
267+ }
268+
260269// Check 'Error::isA<T>' method handling.
261270TEST (ErrorTest, IsAHandling) {
262271 // Check 'isA' handling.
You can’t perform that action at this time.
0 commit comments