diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2024-01-03 16:35:59 +0100 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2024-01-03 17:02:00 +0100 |
commit | 55d5ba905da0db55282dd3985761ddf3dd452fd1 (patch) | |
tree | bb99a039532955b99270c9ac0a5343e8962b6a88 /clang/lib/Sema/SemaChecking.cpp | |
parent | 21fe8b635cfb04de486a3c4ca22eb9f5a5ed78ad (diff) | |
download | llvm-55d5ba905da0db55282dd3985761ddf3dd452fd1.zip llvm-55d5ba905da0db55282dd3985761ddf3dd452fd1.tar.gz llvm-55d5ba905da0db55282dd3985761ddf3dd452fd1.tar.bz2 |
[NFC] Fix compilation in C++20 mode with GCC 12
I ran into the following compiler error when trying to build with GCC 12
and `-DCMAKE_CXX_STANDARD=20`:
```
llvm-project/clang/lib/Sema/SemaChecking.cpp:16690:16: required from here
/usr/include/c++/12/type_traits:971:30: error: default member initializer for '{anonymous}::SequenceChecker::Usage::UsageExpr' required before the end of its enclosing class
```
The error seems correct, GCC just instantiates the `SmallDenseMap`
early and detects it. Clang does not, but that's an acceptable
implementation difference as far as the standard is concerned.
Move constructor outside the class to avoid this problem.
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index da0570b..3168d38 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -16677,7 +16677,7 @@ class SequenceChecker : public ConstEvaluatedExprVisitor<SequenceChecker> { /// Have we issued a diagnostic for this object already? bool Diagnosed = false; - UsageInfo() = default; + UsageInfo(); }; using UsageInfoMap = llvm::SmallDenseMap<Object, UsageInfo, 16>; @@ -17436,6 +17436,8 @@ public: } }; +SequenceChecker::UsageInfo::UsageInfo() = default; + } // namespace void Sema::CheckUnsequencedOperations(const Expr *E) { |