From 5cca2c25a7ddc2348fd0e7c31bf572fecf9e48e4 Mon Sep 17 00:00:00 2001 From: Bjorn Pettersson Date: Tue, 9 Apr 2019 09:12:32 +0000 Subject: [PATCH] [ASTImporter] Fix in ASTImporter::Import_New(const Decl *) Make sure ASTImporter::Import_New(const Decl *) returns a Expected and not Expected to make the clang/unittests/AST/ASTImporterTest.cpp compile without the warning clang/unittests/AST/ASTImporterTest.cpp:117:12: error: no viable conversion from 'Expected' to 'Expected' return Imported; (I got the above when building with clang 3.6). llvm-svn: 357985 --- clang/include/clang/AST/ASTImporter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/include/clang/AST/ASTImporter.h b/clang/include/clang/AST/ASTImporter.h index 8c73db0..a492573 100644 --- a/clang/include/clang/AST/ASTImporter.h +++ b/clang/include/clang/AST/ASTImporter.h @@ -215,7 +215,7 @@ class TypeSourceInfo; /// \returns The equivalent declaration in the "to" context, or the import /// error. llvm::Expected Import_New(Decl *FromD); - llvm::Expected Import_New(const Decl *FromD) { + llvm::Expected Import_New(const Decl *FromD) { return Import_New(const_cast(FromD)); } // FIXME: Remove this version. -- 2.7.4