[clang-tools-extra] ce1e249 - Fix compilation error in clangd/refactor/tweaks/ExpandAutoType.cpp

Kadir Cetinkaya via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 25 05:18:04 PDT 2019


Author: Kadir Cetinkaya
Date: 2019-10-25T14:16:59+02:00
New Revision: ce1e249a688dced25735e38242df561e387b8e2b

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

LOG: Fix compilation error in clangd/refactor/tweaks/ExpandAutoType.cpp

Summary:
During the compilation of the `clangd/refactor/tweaks/ExpandAutoType.cpp`, MSVC returns the following error:

llvm-monorepo\llvm\tools\clang\tools\extra\clangd\refactor\tweaks\ExpandAutoType.cpp(85): error C2146: syntax error: missing ')' before identifier 'and'
llvm-monorepo\llvm\tools\clang\tools\extra\clangd\refactor\tweaks\ExpandAutoType.cpp(85): error C2065: 'and': undeclared identifier
llvm-monorepo\llvm\tools\clang\tools\extra\clangd\refactor\tweaks\ExpandAutoType.cpp(86): error C2143: syntax error: missing ';' before '<template-id>'
llvm-monorepo\llvm\tools\clang\tools\extra\clangd\refactor\tweaks\ExpandAutoType.cpp(73): fatal error C1075: '{': no matching token found

So, && must be used instead of `and`.

Patch By Pavel Samolysov (@psamolysov) !

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D69427

Added: 
    

Modified: 
    clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp b/clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp
index 76c14ae723d7..02c9cdb8280f 100644
--- a/clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp
+++ b/clang-tools-extra/clangd/refactor/tweaks/ExpandAutoType.cpp
@@ -82,7 +82,7 @@ Expected<Tweak::Effect> ExpandAutoType::apply(const Selection& Inputs) {
   }
 
   // if it's a lambda expression, return an error message
-  if (isa<RecordType>(*DeducedType) and
+  if (isa<RecordType>(*DeducedType) &&
       dyn_cast<RecordType>(*DeducedType)->getDecl()->isLambda()) {
     return createErrorMessage("Could not expand type of lambda expression",
                               Inputs);


        


More information about the cfe-commits mailing list