[PATCH] D51490: [Error] Fix template deduction in createFileError

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 30 08:11:30 PDT 2018


aganea added inline comments.


================
Comment at: unittests/Support/ErrorTest.cpp:877
 #endif
+  consumeError(createFileError("file.bin", Error::success()));
+
----------------
This is only provided as an example, not to be commited.

MSVC 2017 15.8 fails with:
```
1>f:\svn\llvm\unittests\support\errortest.cpp(877): error C2672: 'createFileError': no matching overloaded function found
1>f:\svn\llvm\unittests\support\errortest.cpp(877): error C2783: 'llvm::Error llvm::createFileError(std::string,Err)': could not deduce template argument for '<unnamed-symbol>'
1>f:\svn\llvm\include\llvm\support\error.h(1175): note: see declaration of 'llvm::createFileError'
```

Clang (aug. snapshot) fails with:
```
1>F:\svn\llvm\unittests\Support\ErrorTest.cpp(877): error : no matching function for call to 'createFileError'
1>F:\svn\llvm\include\llvm/Support/Error.h(1211):  note: candidate template ignored: requirement '!std::is_base_of<ErrorSuccess, ErrorSuccess>::value' was not satisfied [with Err = llvm::ErrorSuccess]
```


Repository:
  rL LLVM

https://reviews.llvm.org/D51490





More information about the llvm-commits mailing list