[llvm] r300143 - Fix compiler error in Attributes.cpp
Konstantin Zhuravlyov via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 12 16:57:37 PDT 2017
Author: kzhuravl
Date: Wed Apr 12 18:57:37 2017
New Revision: 300143
URL: http://llvm.org/viewvc/llvm-project?rev=300143&view=rev
Log:
Fix compiler error in Attributes.cpp
```
Compiling Attributes.cpp ...
../../../Attributes.cpp: In member function 'std::__1::pair<unsigned int, llvm::Optional<unsigned int> > llvm::AttributeSet::getAllocSizeArgs() const':
../../../Attributes.cpp:542:69: error: operands to ?: have different types 'std::__1::pair<unsigned int, llvm::Optional<unsigned int> >' and 'std::__1::pair<int, int>'
return SetNode ? SetNode->getAllocSizeArgs() : std::make_pair(0, 0);
^
../../../Attributes.cpp:543:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
```
Differential Revision: https://reviews.llvm.org/D31981
Modified:
llvm/trunk/lib/IR/Attributes.cpp
Modified: llvm/trunk/lib/IR/Attributes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Attributes.cpp?rev=300143&r1=300142&r2=300143&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Attributes.cpp (original)
+++ llvm/trunk/lib/IR/Attributes.cpp Wed Apr 12 18:57:37 2017
@@ -539,7 +539,8 @@ uint64_t AttributeSet::getDereferenceabl
}
std::pair<unsigned, Optional<unsigned>> AttributeSet::getAllocSizeArgs() const {
- return SetNode ? SetNode->getAllocSizeArgs() : std::make_pair(0, 0);
+ return SetNode ? SetNode->getAllocSizeArgs()
+ : std::pair<unsigned, Optional<unsigned>>(0, 0);
}
std::string AttributeSet::getAsString(bool InAttrGrp) const {
More information about the llvm-commits
mailing list