[PATCH] D134458: [AST] Add C++11 attribute 'msvc::no_unique_address'

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 14:31:29 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/include/clang/Basic/Attr.td:3505
+  let LangOpts = [MicrosoftExt];
+  let Spellings = [CXX11<"msvc", "no_unique_address", 201803>];
+  let Subjects = SubjectList<[NonBitField], ErrorDiag>;
----------------
Does the `201803` value match what MSVC returns from `__has_cpp_attribute`?


================
Comment at: clang/test/AST/msvc-attrs.cpp:4
+// RUN: FileCheck -check-prefix CHECK-DIAG-NO-MSX %s < %t.stderr.txt
+
+struct Empty {};
----------------
Thanks for the start to the tests! You should also add CodeGen tests as well as Sema tests. The CodeGen tests are to make sure we're codegenning the correct offsets to members, and the Sema tests are to ensure we're matching diagnostic behavior with MSVC rather than accepting code MSVC rejects.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134458



More information about the cfe-commits mailing list