[PATCH] D83114: [clang] Fix the incorrect dependence bits for DependentExtIntType.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 12:54:07 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGcd9a241f1650: [clang] Fix the incorrect dependence bits for DependentExtIntType. (authored by hokein).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83114/new/

https://reviews.llvm.org/D83114

Files:
  clang/lib/AST/Type.cpp
  clang/test/Sema/invalid-bitwidth-expr.mm


Index: clang/test/Sema/invalid-bitwidth-expr.mm
===================================================================
--- clang/test/Sema/invalid-bitwidth-expr.mm
+++ clang/test/Sema/invalid-bitwidth-expr.mm
@@ -32,3 +32,8 @@
   int X : func<int>(); // expected-note {{in instantiation of function template}}
 };
 constexpr int ssss = sizeof(Z);
+
+struct Z2 {
+  int X : sizeof(_ExtInt(invalid())); // expected-error {{use of undeclared identifier}}
+};
+constexpr int sssss = sizeof(Z2);
Index: clang/lib/AST/Type.cpp
===================================================================
--- clang/lib/AST/Type.cpp
+++ clang/lib/AST/Type.cpp
@@ -347,15 +347,7 @@
 DependentExtIntType::DependentExtIntType(const ASTContext &Context,
                                          bool IsUnsigned, Expr *NumBitsExpr)
     : Type(DependentExtInt, QualType{},
-           ((NumBitsExpr->isValueDependent() || NumBitsExpr->isTypeDependent())
-                ? TypeDependence::Dependent
-                : TypeDependence::None) |
-               (NumBitsExpr->isInstantiationDependent()
-                    ? TypeDependence::Instantiation
-                    : TypeDependence::None) |
-               (NumBitsExpr->containsUnexpandedParameterPack()
-                    ? TypeDependence::VariablyModified
-                    : TypeDependence::None)),
+           toTypeDependence(NumBitsExpr->getDependence())),
       Context(Context), ExprAndUnsigned(NumBitsExpr, IsUnsigned) {}
 
 bool DependentExtIntType::isUnsigned() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83114.275711.patch
Type: text/x-patch
Size: 1522 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200706/cc9449ae/attachment-0001.bin>


More information about the cfe-commits mailing list