diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2018-08-17 01:10:33 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2018-08-17 01:10:33 +0000 |
| commit | 9e86844d547199ce13b61b854aa685ae5f82c6ca (patch) | |
| tree | 48628ada83d0d9a2390f2172cb6869c07fe815f6 | |
| parent | 9e2fe8be02214b419cc87d56ad9c341a0f296964 (diff) | |
| download | bcm5719-llvm-9e86844d547199ce13b61b854aa685ae5f82c6ca.tar.gz bcm5719-llvm-9e86844d547199ce13b61b854aa685ae5f82c6ca.zip | |
[ADT] Replace a member initializer of a union with an explicit
constructor.
This breaking an old/weird host compiler is my best bet for the current
crashes I'm getting from bots since this functionality was added to this
ADT.
llvm-svn: 339975
| -rw-r--r-- | llvm/include/llvm/ADT/PointerSumType.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/include/llvm/ADT/PointerSumType.h b/llvm/include/llvm/ADT/PointerSumType.h index ab4b86515ca..f5b20533fe1 100644 --- a/llvm/include/llvm/ADT/PointerSumType.h +++ b/llvm/include/llvm/ADT/PointerSumType.h @@ -80,8 +80,12 @@ template <typename TagT, typename... MemberTs> class PointerSumType { // when we *read* a value, we copy the underlying storage out to avoid relying // on one member or the other being active. union StorageT { - // Ensure we get a null default constructed value. - uintptr_t Value = 0; + // Ensure we get a null default constructed value. We don't use a member + // initializer because some compilers seem to not implement those correctly + // for a union. + StorageT() : Value(0) {} + + uintptr_t Value; typename HelperT::template Lookup<HelperT::MinTag>::PointerT MinTagPointer; }; |

