diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2018-09-07 18:32:59 +0000 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2018-09-07 18:32:59 +0000 |
commit | 960324471bde3bef99b167a1ae9d7f922994a4cb (patch) | |
tree | c4dcbf80e96d9a07a55b97f16db845c4721ad9f6 /llvm/unittests/Support/ErrorTest.cpp | |
parent | 91c95a35c18937129e1929fb5002d265c5b40cbc (diff) | |
download | llvm-960324471bde3bef99b167a1ae9d7f922994a4cb.zip llvm-960324471bde3bef99b167a1ae9d7f922994a4cb.tar.gz llvm-960324471bde3bef99b167a1ae9d7f922994a4cb.tar.bz2 |
[Error] Reintroduce type validation in createFileError()
This prevents from using ErrorSuccess as an argument to createFileError().
Differential Revision: https://reviews.llvm.org/D51490
llvm-svn: 341689
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
-rw-r--r-- | llvm/unittests/Support/ErrorTest.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp index 2510289..ed1e2bb 100644 --- a/llvm/unittests/Support/ErrorTest.cpp +++ b/llvm/unittests/Support/ErrorTest.cpp @@ -874,6 +874,9 @@ TEST(Error, FileErrorTest) { }, ""); #endif + // Not allowed, would fail at compile-time + //consumeError(createFileError("file.bin", ErrorSuccess())); + Error E1 = make_error<CustomError>(1); Error FE1 = createFileError("file.bin", std::move(E1)); EXPECT_EQ(toString(std::move(FE1)).compare("'file.bin': CustomError {1}"), 0); |