[PATCH] D126093: Sema: adjust assertion to account for deduced types
Saleem Abdulrasool via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 24 10:50:22 PDT 2022
This revision was automatically updated to reflect the committed changes.
compnerd marked an inline comment as done.
Closed by commit rGb159108bc5eb: Sema: adjust assertion to account for deduced types (authored by compnerd).
Changed prior to commit:
https://reviews.llvm.org/D126093?vs=431084&id=431720#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126093/new/
https://reviews.llvm.org/D126093
Files:
clang/include/clang/Sema/DeclSpec.h
clang/test/Sema/typerep-typespec.c
Index: clang/test/Sema/typerep-typespec.c
===================================================================
--- /dev/null
+++ clang/test/Sema/typerep-typespec.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -std=c11 %s -fsyntax-only -verify
+// REQUIRES: asserts
+
+struct dispatch_object_s;
+void _dispatch_queue_get_head(struct dispatch_object_s *volatile dq_items_head) {
+ (_Atomic __typeof__(dq_items_head) *)0; // expected-warning{{expression result unused}}
+}
+void g(void) {
+ (_Atomic __typeof__(struct dispatch_object_s *volatile) *)0; // expected-warning{{expression result unused}}
+}
Index: clang/include/clang/Sema/DeclSpec.h
===================================================================
--- clang/include/clang/Sema/DeclSpec.h
+++ clang/include/clang/Sema/DeclSpec.h
@@ -516,7 +516,8 @@
SourceLocation getTypeSpecSatLoc() const { return TSSatLoc; }
SourceLocation getTypeSpecTypeNameLoc() const {
- assert(isDeclRep((TST) TypeSpecType) || TypeSpecType == TST_typename);
+ assert(isDeclRep((TST)TypeSpecType) || isTypeRep((TST)TypeSpecType) ||
+ isExprRep((TST)TypeSpecType));
return TSTNameLoc;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126093.431720.patch
Type: text/x-patch
Size: 1148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220524/d0569dde/attachment.bin>
More information about the cfe-commits
mailing list