[clang] 767516c - Fix gcc5 build of ASTMatchersTest.h

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 01:38:21 PDT 2020


Author: Hans Wennborg
Date: 2020-06-05T10:38:03+02:00
New Revision: 767516c5463a58f64cc3e0e1125b761aedceecf5

URL: https://github.com/llvm/llvm-project/commit/767516c5463a58f64cc3e0e1125b761aedceecf5
DIFF: https://github.com/llvm/llvm-project/commit/767516c5463a58f64cc3e0e1125b761aedceecf5.diff

LOG: Fix gcc5 build of ASTMatchersTest.h

After a180d54 the build was failing with:

In file included from /work/llvm.monorepo/clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp:9:0:
/work/llvm.monorepo/clang/unittests/ASTMatchers/ASTMatchersTest.h:
In function ‘llvm::ArrayRef<clang::TestLanguage> clang::ast_matchers::langCxx11OrLater()’:
/work/llvm.monorepo/clang/unittests/ASTMatchers/ASTMatchersTest.h:64:10:
error: could not convert ‘(const clang::TestLanguage*)(& Result)’ from
‘const clang::TestLanguage*’ to ‘llvm::ArrayRef<clang::TestLanguage>’
   return Result;
          ^

Added: 
    

Modified: 
    clang/unittests/ASTMatchers/ASTMatchersTest.h

Removed: 
    


################################################################################
diff  --git a/clang/unittests/ASTMatchers/ASTMatchersTest.h b/clang/unittests/ASTMatchers/ASTMatchersTest.h
index 11aedf65ec29..fec033c4d72e 100644
--- a/clang/unittests/ASTMatchers/ASTMatchersTest.h
+++ b/clang/unittests/ASTMatchers/ASTMatchersTest.h
@@ -61,22 +61,22 @@ class VerifyMatch : public MatchFinder::MatchCallback {
 inline ArrayRef<TestLanguage> langCxx11OrLater() {
   static const TestLanguage Result[] = {Lang_CXX11, Lang_CXX14, Lang_CXX17,
                                         Lang_CXX20};
-  return Result;
+  return ArrayRef<TestLanguage>(Result);
 }
 
 inline ArrayRef<TestLanguage> langCxx14OrLater() {
   static const TestLanguage Result[] = {Lang_CXX14, Lang_CXX17, Lang_CXX20};
-  return Result;
+  return ArrayRef<TestLanguage>(Result);
 }
 
 inline ArrayRef<TestLanguage> langCxx17OrLater() {
   static const TestLanguage Result[] = {Lang_CXX17, Lang_CXX20};
-  return Result;
+  return ArrayRef<TestLanguage>(Result);
 }
 
 inline ArrayRef<TestLanguage> langCxx20OrLater() {
   static const TestLanguage Result[] = {Lang_CXX20};
-  return Result;
+  return ArrayRef<TestLanguage>(Result);
 }
 
 template <typename T>


        


More information about the cfe-commits mailing list