aaron.ballman added a comment.

Can you also add semantic tests that verify the attribute only works in C++, 
only appertains to a record (as opposed to other kinds of declarations like 
functions), and doesn't accept arguments. Some other tests that may be 
interesting:

  // Should test redeclaration behavior.
  struct [[clang::standalone_debug]] redecl;
  struct redecl {};
  
  struct [[clang::standalone_debug]] S; // Does this make sense on forward 
declare that's never defined?
  
  struct foo {
    struct [[clang::standalone_debug]] { // anonymous types?
      int x;
    };
  };
  
  union [[clang::standalone_debug]] U { // Non-struct record types?
    int x;
    float f;
  };
  
  union [[clang::standalone_debug]] Oof { // Non-struct record types with a 
constructor?
    Oof() {}
    int x;
    float f;
  };



================
Comment at: clang/include/clang/Basic/Attr.td:1666
+  let Subjects = SubjectList<[CXXRecord]>;
+  let Documentation = [Undocumented];
+  let SimpleHandler = 1;
----------------
rnk wrote:
> I understand that this patch is mainly to open discussion, but we should 
> document the attribute before landing the patch.
+1 to this (no new undocumented attributes, please).


================
Comment at: clang/test/CodeGenCXX/force-debug-attribute.cpp:1
+// RUN: %clang_cc1 -DSETATTR=0 -emit-llvm -std=c++14 
-debug-info-kind=constructor %s -o - | FileCheck %s --check-prefix=DEBUG
+// RUN: %clang_cc1 -DSETATTR=1 -emit-llvm -std=c++14 
-debug-info-kind=constructor %s -o - | FileCheck %s --check-prefix=WITHATTR
----------------
Is there something C++14 specific about the test, or should that be dropped?

Should we specify a triple? (I have no idea if debug info is target-specific.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97411

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to