From: Bjorn Pettersson Date: Tue, 9 Apr 2019 09:12:32 +0000 (+0000) Subject: [ASTImporter] Fix in ASTImporter::Import_New(const Decl *) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e15e2b1971ee51958ea8899484513e9378a9fc73;p=clang [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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357985 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ASTImporter.h b/include/clang/AST/ASTImporter.h index 8c73db0692..a492573221 100644 --- a/include/clang/AST/ASTImporter.h +++ b/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.