[PATCH] D83263: [WIP] Clang crashed while checking for deletion of copy and move ctors

Vy Nguyen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 6 17:11:56 PDT 2020


oontvoo updated this revision to Diff 275866.
oontvoo added a comment.

add test


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83263

Files:
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/test/SemaCXX/trivial-abi-templated-type.cpp


Index: clang/test/SemaCXX/trivial-abi-templated-type.cpp
===================================================================
--- /dev/null
+++ clang/test/SemaCXX/trivial-abi-templated-type.cpp
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
+// expected-no-diagnostics
+
+template <class>
+class __attribute__((trivial_abi)) a { a(a &&); };
Index: clang/lib/Sema/SemaDeclCXX.cpp
===================================================================
--- clang/lib/Sema/SemaDeclCXX.cpp
+++ clang/lib/Sema/SemaDeclCXX.cpp
@@ -6591,7 +6591,7 @@
   }
 
   // See if trivial_abi has to be dropped.
-  if (Record->hasAttr<TrivialABIAttr>())
+  if (!Record->isDependentType() && Record->hasAttr<TrivialABIAttr>())
     checkIllFormedTrivialABIStruct(*Record);
 
   // Set HasTrivialSpecialMemberForCall if the record has attribute


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83263.275866.patch
Type: text/x-patch
Size: 845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200707/f1f27eb9/attachment.bin>


More information about the cfe-commits mailing list