[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 updated this revision to Diff 328561.
sbc100 added a comment.

feedback


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D46443

Files:
  libcxx/include/CMakeLists.txt
  libcxx/include/cstdalign
  libcxx/include/module.modulemap
  libcxx/test/libcxx/double_include.sh.cpp
  libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp
  libcxx/test/libcxx/min_max_macros.compile.pass.cpp
  libcxx/test/libcxx/no_assert_include.compile.pass.cpp
  libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp

Index: libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp
===
--- /dev/null
+++ libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp
@@ -0,0 +1,27 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// test 
+
+// This header was removed in C++20
+// REQUIRES: c++03 || c++11 || c++14 || c++17
+
+#include 
+
+#ifdef alignas
+#error alignas should not be a macro in C++
+#endif
+
+#ifndef __alignas_is_defined
+#error __alignas_is_defined not defined
+#endif
+
+int main(int, char**) {
+
+  return 0;
+}
Index: libcxx/test/libcxx/no_assert_include.compile.pass.cpp
===
--- libcxx/test/libcxx/no_assert_include.compile.pass.cpp
+++ libcxx/test/libcxx/no_assert_include.compile.pass.cpp
@@ -63,6 +63,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
Index: libcxx/test/libcxx/min_max_macros.compile.pass.cpp
===
--- libcxx/test/libcxx/min_max_macros.compile.pass.cpp
+++ libcxx/test/libcxx/min_max_macros.compile.pass.cpp
@@ -96,6 +96,8 @@
 TEST_MACROS();
 #include 
 TEST_MACROS();
+#include 
+TEST_MACROS();
 #include 
 TEST_MACROS();
 #include 
Index: libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp
===
--- /dev/null
+++ libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp
@@ -0,0 +1,23 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// 
+
+#include 
+
+#include "test_macros.h"
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main(int, char**)
+{
+
+  return 0;
+}
Index: libcxx/test/libcxx/double_include.sh.cpp
===
--- libcxx/test/libcxx/double_include.sh.cpp
+++ libcxx/test/libcxx/double_include.sh.cpp
@@ -70,6 +70,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
Index: libcxx/include/module.modulemap
===
--- libcxx/include/module.modulemap
+++ libcxx/include/module.modulemap
@@ -161,7 +161,10 @@
   header "csignal"
   export *
 }
-// FIXME:  is missing.
+module cstdalign {
+  header "cstdalign"
+  export *
+}
 module cstdarg {
   header "cstdarg"
   export *
Index: libcxx/include/cstdalign
===
--- /dev/null
+++ libcxx/include/cstdalign
@@ -0,0 +1,30 @@
+// -*- C++ -*-
+//===--- cstdalign ===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
+/*
+cstdalign synopsis
+
+Macros:
+
+__alignas_is_defined
+
+*/
+
+#include <__config>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#endif  // _LIBCPP_CSTDALIGN
Index: libcxx/include/CMakeLists.txt
===
--- libcxx/include/CMakeLists.txt
+++ libcxx/include/CMakeLists.txt
@@ -55,6 +55,7 @@
   condition_variable
   csetjmp
   csignal
+  cstdalign
   cstdarg
   cstdbool
   cstddef
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 updated this revision to Diff 328557.
sbc100 marked 2 inline comments as done.
sbc100 added a comment.

feedback


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D46443

Files:
  libcxx/include/CMakeLists.txt
  libcxx/include/cstdalign
  libcxx/include/module.modulemap
  libcxx/test/libcxx/double_include.sh.cpp
  libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp
  libcxx/test/libcxx/min_max_macros.compile.pass.cpp
  libcxx/test/libcxx/no_assert_include.compile.pass.cpp
  libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp

Index: libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp
===
--- /dev/null
+++ libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp
@@ -0,0 +1,24 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// test 
+
+#include 
+
+#ifdef alignas
+#error alignas should not be a macro in C++
+#endif
+
+#ifndef __alignas_is_defined
+#error __alignas_is_defined not defined
+#endif
+
+int main(int, char**) {
+
+  return 0;
+}
Index: libcxx/test/libcxx/no_assert_include.compile.pass.cpp
===
--- libcxx/test/libcxx/no_assert_include.compile.pass.cpp
+++ libcxx/test/libcxx/no_assert_include.compile.pass.cpp
@@ -63,6 +63,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
Index: libcxx/test/libcxx/min_max_macros.compile.pass.cpp
===
--- libcxx/test/libcxx/min_max_macros.compile.pass.cpp
+++ libcxx/test/libcxx/min_max_macros.compile.pass.cpp
@@ -96,6 +96,8 @@
 TEST_MACROS();
 #include 
 TEST_MACROS();
+#include 
+TEST_MACROS();
 #include 
 TEST_MACROS();
 #include 
Index: libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp
===
--- /dev/null
+++ libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp
@@ -0,0 +1,23 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// 
+
+#include 
+
+#include "test_macros.h"
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main(int, char**)
+{
+
+  return 0;
+}
Index: libcxx/test/libcxx/double_include.sh.cpp
===
--- libcxx/test/libcxx/double_include.sh.cpp
+++ libcxx/test/libcxx/double_include.sh.cpp
@@ -70,6 +70,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
Index: libcxx/include/module.modulemap
===
--- libcxx/include/module.modulemap
+++ libcxx/include/module.modulemap
@@ -161,7 +161,10 @@
   header "csignal"
   export *
 }
-// FIXME:  is missing.
+module cstdalign {
+  header "cstdalign"
+  export *
+}
 module cstdarg {
   header "cstdarg"
   export *
Index: libcxx/include/cstdalign
===
--- /dev/null
+++ libcxx/include/cstdalign
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===--- cstdalign ===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
+/*
+cstdalign synopsis
+
+Macros:
+
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined
+
+*/
+
+#include <__config>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#endif  // _LIBCPP_CSTDALIGN
Index: libcxx/include/CMakeLists.txt
===
--- libcxx/include/CMakeLists.txt
+++ libcxx/include/CMakeLists.txt
@@ -55,6 +55,7 @@
   condition_variable
   csetjmp
   csignal
+  cstdalign
   cstdarg
   cstdbool
   cstddef
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 marked 2 inline comments as done.
sbc100 added inline comments.



Comment at: libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp:14-28
+#ifdef alignas
+#error alignas should not be a macro in C++
+#endif
+
+#ifdef alignof
+#error alignof should not be a macro in C++
+#endif

ldionne wrote:
> This can be moved outside of `main()`.
I was copying from 
`libcxx/test/std/language.support/cstdint/cstdint.syn/cstdint.pass.cpp` which 
does these checks inside of main.   

Will move them.



Comment at: libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp:27
+#ifndef __alignof_is_defined
+#error __alignof_is_defined not defined
+#endif

ldionne wrote:
> I'm not seeing `__alignof_is_defined` anywhere in the spec?
Removed


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D46443

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


[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Louis Dionne via Phabricator via cfe-commits
ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.



Comment at: libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp:8
+//===--===//
+
+// test 

I think we should add `// REQUIRES: c++03 || c++11 || c++14 || c++17`, because 
a conforming implementation could be not shipping the header in C++20 and 
beyond.



Comment at: libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp:14-28
+#ifdef alignas
+#error alignas should not be a macro in C++
+#endif
+
+#ifdef alignof
+#error alignof should not be a macro in C++
+#endif

This can be moved outside of `main()`.



Comment at: libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp:27
+#ifndef __alignof_is_defined
+#error __alignof_is_defined not defined
+#endif

I'm not seeing `__alignof_is_defined` anywhere in the spec?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D46443

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


[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 updated this revision to Diff 328538.
sbc100 added a comment.

add tests


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D46443

Files:
  libcxx/include/CMakeLists.txt
  libcxx/include/cstdalign
  libcxx/include/module.modulemap
  libcxx/test/libcxx/double_include.sh.cpp
  libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp
  libcxx/test/libcxx/min_max_macros.compile.pass.cpp
  libcxx/test/libcxx/no_assert_include.compile.pass.cpp
  libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp

Index: libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp
===
--- /dev/null
+++ libcxx/test/std/language.support/cstdalign/cstdalign.pass.cpp
@@ -0,0 +1,31 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// test 
+
+#include 
+
+int main(int, char**) {
+#ifdef alignas
+#error alignas should not be a macro in C++
+#endif
+
+#ifdef alignof
+#error alignof should not be a macro in C++
+#endif
+
+#ifndef __alignas_is_defined
+#error __alignas_is_defined not defined
+#endif
+
+#ifndef __alignof_is_defined
+#error __alignof_is_defined not defined
+#endif
+
+  return 0;
+}
Index: libcxx/test/libcxx/no_assert_include.compile.pass.cpp
===
--- libcxx/test/libcxx/no_assert_include.compile.pass.cpp
+++ libcxx/test/libcxx/no_assert_include.compile.pass.cpp
@@ -63,6 +63,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
Index: libcxx/test/libcxx/min_max_macros.compile.pass.cpp
===
--- libcxx/test/libcxx/min_max_macros.compile.pass.cpp
+++ libcxx/test/libcxx/min_max_macros.compile.pass.cpp
@@ -96,6 +96,8 @@
 TEST_MACROS();
 #include 
 TEST_MACROS();
+#include 
+TEST_MACROS();
 #include 
 TEST_MACROS();
 #include 
Index: libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp
===
--- /dev/null
+++ libcxx/test/libcxx/language.support/cstdalign/version.pass.cpp
@@ -0,0 +1,23 @@
+//===--===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+// 
+
+#include 
+
+#include "test_macros.h"
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main(int, char**)
+{
+
+  return 0;
+}
Index: libcxx/test/libcxx/double_include.sh.cpp
===
--- libcxx/test/libcxx/double_include.sh.cpp
+++ libcxx/test/libcxx/double_include.sh.cpp
@@ -70,6 +70,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
Index: libcxx/include/module.modulemap
===
--- libcxx/include/module.modulemap
+++ libcxx/include/module.modulemap
@@ -161,7 +161,10 @@
   header "csignal"
   export *
 }
-// FIXME:  is missing.
+module cstdalign {
+  header "cstdalign"
+  export *
+}
 module cstdarg {
   header "cstdarg"
   export *
Index: libcxx/include/cstdalign
===
--- /dev/null
+++ libcxx/include/cstdalign
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===--- cstdalign ===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
+/*
+cstdalign synopsis
+
+Macros:
+
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined
+
+*/
+
+#include <__config>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#endif  // _LIBCPP_CSTDALIGN
Index: libcxx/include/CMakeLists.txt
===
--- libcxx/include/CMakeLists.txt
+++ libcxx/include/CMakeLists.txt
@@ -55,6 +55,7 @@
   condition_variable
   csetjmp
   csignal
+  cstdalign
   cstdarg
   cstdbool
   cstddef
___
cfe-commits mailing 

[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 added inline comments.



Comment at: libcxx/include/cstdalign:19-22
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined

curdeius wrote:
> You should test that each of these macros is really defined when including 
> `cstdalign`.
Done.  As you can see there is not much to tests since in C++ this is 
essentially an empty header.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D46443

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


[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 added inline comments.



Comment at: libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp:16
 #include 
+#include 
 

curdeius wrote:
> This doesn't seem to be necessary. Or?
> In C++, `alignof` is a keyword.
You are right its not necessary in C++ since its a keyword.   My memory of 
exactly why I added to this file in the original version of the CL back in 2018 
is ... missing.Maybe its to ensure that the inclusion of the C header and 
the macro don't interfere with C++ usage?

I'm happy to revert this line and find a better way to test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D46443

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


[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments.



Comment at: libcxx/include/cstdalign:19-22
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined

You should test that each of these macros is really defined when including 
`cstdalign`.



Comment at: libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp:16
 #include 
+#include 
 

This doesn't seem to be necessary. Or?
In C++, `alignof` is a keyword.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D46443

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


[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 updated this revision to Diff 328524.
sbc100 added a comment.
Herald added a subscriber: mgorny.

feedback


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D46443

Files:
  libcxx/include/CMakeLists.txt
  libcxx/include/cstdalign
  libcxx/include/module.modulemap
  libcxx/test/libcxx/double_include.sh.cpp
  libcxx/test/libcxx/min_max_macros.compile.pass.cpp
  libcxx/test/libcxx/no_assert_include.compile.pass.cpp
  libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp

Index: libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp
===
--- libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp
+++ libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp
@@ -13,6 +13,7 @@
 // Check that the size and alignment of any are what we expect.
 
 #include 
+#include 
 
 #include "test_macros.h"
 
Index: libcxx/test/libcxx/no_assert_include.compile.pass.cpp
===
--- libcxx/test/libcxx/no_assert_include.compile.pass.cpp
+++ libcxx/test/libcxx/no_assert_include.compile.pass.cpp
@@ -63,6 +63,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
Index: libcxx/test/libcxx/min_max_macros.compile.pass.cpp
===
--- libcxx/test/libcxx/min_max_macros.compile.pass.cpp
+++ libcxx/test/libcxx/min_max_macros.compile.pass.cpp
@@ -96,6 +96,8 @@
 TEST_MACROS();
 #include 
 TEST_MACROS();
+#include 
+TEST_MACROS();
 #include 
 TEST_MACROS();
 #include 
Index: libcxx/test/libcxx/double_include.sh.cpp
===
--- libcxx/test/libcxx/double_include.sh.cpp
+++ libcxx/test/libcxx/double_include.sh.cpp
@@ -70,6 +70,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
Index: libcxx/include/module.modulemap
===
--- libcxx/include/module.modulemap
+++ libcxx/include/module.modulemap
@@ -161,7 +161,10 @@
   header "csignal"
   export *
 }
-// FIXME:  is missing.
+module cstdalign {
+  header "cstdlign"
+  export *
+}
 module cstdarg {
   header "cstdarg"
   export *
Index: libcxx/include/cstdalign
===
--- /dev/null
+++ libcxx/include/cstdalign
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===--- cstdalign ===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
+/*
+cstdalign synopsis
+
+Macros:
+
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined
+
+*/
+
+#include <__config>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#endif  // _LIBCPP_CSTDALIGN
Index: libcxx/include/CMakeLists.txt
===
--- libcxx/include/CMakeLists.txt
+++ libcxx/include/CMakeLists.txt
@@ -55,6 +55,7 @@
   condition_variable
   csetjmp
   csignal
+  cstdalign
   cstdarg
   cstdbool
   cstddef
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 updated this revision to Diff 328522.
sbc100 added a comment.
Herald added a project: libc++.
Herald added a reviewer: libc++.

Rebase against mono-repo


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D46443

Files:
  libcxx/include/cstdalign
  libcxx/test/libcxx/min_max_macros.compile.pass.cpp
  libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp


Index: libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp
===
--- libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp
+++ libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp
@@ -13,6 +13,7 @@
 // Check that the size and alignment of any are what we expect.
 
 #include 
+#include 
 
 #include "test_macros.h"
 
Index: libcxx/test/libcxx/min_max_macros.compile.pass.cpp
===
--- libcxx/test/libcxx/min_max_macros.compile.pass.cpp
+++ libcxx/test/libcxx/min_max_macros.compile.pass.cpp
@@ -96,6 +96,8 @@
 TEST_MACROS();
 #include 
 TEST_MACROS();
+#include 
+TEST_MACROS();
 #include 
 TEST_MACROS();
 #include 
Index: libcxx/include/cstdalign
===
--- /dev/null
+++ libcxx/include/cstdalign
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===--- cstdalign 
===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
+/*
+cstdalign synopsis
+
+Macros:
+
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined
+
+*/
+
+#include <__config>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#endif  // _LIBCPP_CSTDALIGN


Index: libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp
===
--- libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp
+++ libcxx/test/libcxx/utilities/any/size_and_alignment.pass.cpp
@@ -13,6 +13,7 @@
 // Check that the size and alignment of any are what we expect.
 
 #include 
+#include 
 
 #include "test_macros.h"
 
Index: libcxx/test/libcxx/min_max_macros.compile.pass.cpp
===
--- libcxx/test/libcxx/min_max_macros.compile.pass.cpp
+++ libcxx/test/libcxx/min_max_macros.compile.pass.cpp
@@ -96,6 +96,8 @@
 TEST_MACROS();
 #include 
 TEST_MACROS();
+#include 
+TEST_MACROS();
 #include 
 TEST_MACROS();
 #include 
Index: libcxx/include/cstdalign
===
--- /dev/null
+++ libcxx/include/cstdalign
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===--- cstdalign ===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
+/*
+cstdalign synopsis
+
+Macros:
+
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined
+
+*/
+
+#include <__config>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#endif  // _LIBCPP_CSTDALIGN
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D46443: Add missing cstdalign header

2021-03-05 Thread Louis Dionne via Phabricator via cfe-commits
ldionne requested changes to this revision.
ldionne added a comment.
This revision now requires changes to proceed.

In D46443#2566394 , 
@hubert.reinterpretcast wrote:

> The resolution of LWG 2828 
>  means that 
> `` exists in C++11 and C++14. The rationale from 
> https://reviews.llvm.org/D96786#2566110 can be taken as saying that adding 
> this header for C++11 conformance is reasonable.

Yes, I agree, let's add it. But the header needs to be added in 
`include/CMakeLists.txt`. There also needs to be a test added to check for the 
contents of the headers, and the auto-generated header tests should be 
modified. Take a look at what I did in https://reviews.llvm.org/D97870 for 
``.


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D46443

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


[PATCH] D46443: Add missing cstdalign header

2021-02-16 Thread Hubert Tong via Phabricator via cfe-commits
hubert.reinterpretcast added a comment.
Herald added a subscriber: wingo.

The resolution of LWG 2828 
 means that `` 
exists in C++11 and C++14. The rationale from 
https://reviews.llvm.org/D96786#2566110 can be taken as saying that adding this 
header for C++11 conformance is reasonable.


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D46443

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


[PATCH] D46443: Add missing cstdalign header

2018-09-24 Thread Louis Dionne via Phabricator via cfe-commits
ldionne added a subscriber: mclow.lists.
ldionne added a comment.

I believe this header has been deprecated. According to 
http://eel.is/c++draft/diff.cpp17.library, the effect of this header is 
nothing. @mclow.lists can you chime in?


Repository:
  rCXX libc++

https://reviews.llvm.org/D46443



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


[PATCH] D46443: Add missing cstdalign header

2018-05-16 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 added a comment.

ping


Repository:
  rCXX libc++

https://reviews.llvm.org/D46443



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


[PATCH] D46443: Add missing cstdalign header

2018-05-04 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 updated this revision to Diff 145247.
sbc100 added a comment.

- revert


Repository:
  rCXX libc++

https://reviews.llvm.org/D46443

Files:
  include/cstdalign
  test/libcxx/min_max_macros.sh.cpp
  test/libcxx/utilities/any/size_and_alignment.pass.cpp


Index: test/libcxx/utilities/any/size_and_alignment.pass.cpp
===
--- test/libcxx/utilities/any/size_and_alignment.pass.cpp
+++ test/libcxx/utilities/any/size_and_alignment.pass.cpp
@@ -14,6 +14,7 @@
 // Check that the size and alignment of any are what we expect.
 
 #include 
+#include 
 
 int main()
 {
Index: test/libcxx/min_max_macros.sh.cpp
===
--- test/libcxx/min_max_macros.sh.cpp
+++ test/libcxx/min_max_macros.sh.cpp
@@ -70,6 +70,8 @@
 TEST_MACROS();
 #include 
 TEST_MACROS();
+#include 
+TEST_MACROS();
 #include 
 TEST_MACROS();
 #include 
Index: include/cstdalign
===
--- /dev/null
+++ include/cstdalign
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===--- cstdalign 
===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
+/*
+cstdalign synopsis
+
+Macros:
+
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined
+
+*/
+
+#include <__config>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#endif  // _LIBCPP_CSTDALIGN


Index: test/libcxx/utilities/any/size_and_alignment.pass.cpp
===
--- test/libcxx/utilities/any/size_and_alignment.pass.cpp
+++ test/libcxx/utilities/any/size_and_alignment.pass.cpp
@@ -14,6 +14,7 @@
 // Check that the size and alignment of any are what we expect.
 
 #include 
+#include 
 
 int main()
 {
Index: test/libcxx/min_max_macros.sh.cpp
===
--- test/libcxx/min_max_macros.sh.cpp
+++ test/libcxx/min_max_macros.sh.cpp
@@ -70,6 +70,8 @@
 TEST_MACROS();
 #include 
 TEST_MACROS();
+#include 
+TEST_MACROS();
 #include 
 TEST_MACROS();
 #include 
Index: include/cstdalign
===
--- /dev/null
+++ include/cstdalign
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===--- cstdalign ===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===--===//
+
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
+/*
+cstdalign synopsis
+
+Macros:
+
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined
+
+*/
+
+#include <__config>
+#include 
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+#endif  // _LIBCPP_CSTDALIGN
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D46443: Add missing cstdalign header

2018-05-04 Thread Sam Clegg via Phabricator via cfe-commits
sbc100 created this revision.
Herald added subscribers: cfe-commits, christof, aheejin.

Repository:
  rCXX libc++

https://reviews.llvm.org/D46443

Files:
  include/cassert
  include/cstdalign
  test/libcxx/min_max_macros.sh.cpp
  test/libcxx/utilities/any/size_and_alignment.pass.cpp


Index: test/libcxx/utilities/any/size_and_alignment.pass.cpp
===
--- test/libcxx/utilities/any/size_and_alignment.pass.cpp
+++ test/libcxx/utilities/any/size_and_alignment.pass.cpp
@@ -14,6 +14,7 @@
 // Check that the size and alignment of any are what we expect.
 
 #include 
+#include 
 
 int main()
 {
Index: test/libcxx/min_max_macros.sh.cpp
===
--- test/libcxx/min_max_macros.sh.cpp
+++ test/libcxx/min_max_macros.sh.cpp
@@ -70,6 +70,8 @@
 TEST_MACROS();
 #include 
 TEST_MACROS();
+#include 
+TEST_MACROS();
 #include 
 TEST_MACROS();
 #include 
Index: include/cstdalign
===
--- include/cstdalign
+++ include/cstdalign
@@ -1,25 +1,33 @@
 // -*- C++ -*-
-//===-- cassert 
---===//
+//===--- cstdalign 
===//
 //
 // The LLVM Compiler Infrastructure
 //
 // This file is dual licensed under the MIT and the University of Illinois Open
 // Source Licenses. See LICENSE.TXT for details.
 //
 
//===--===//
 
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
 /*
-cassert synopsis
+cstdalign synopsis
 
 Macros:
 
-assert
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined
 
 */
 
 #include <__config>
-#include 
+#include 
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
+
+#endif  // _LIBCPP_CSTDALIGN
Index: include/cassert
===
--- include/cassert
+++ include/cassert
@@ -8,6 +8,9 @@
 //
 
//===--===//
 
+#ifndef _LIBCPP_CASSERT
+#define _LIBCPP_CASSERT
+
 /*
 cassert synopsis
 
@@ -23,3 +26,5 @@
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
+
+#endif  // _LIBCPP_CASSERT


Index: test/libcxx/utilities/any/size_and_alignment.pass.cpp
===
--- test/libcxx/utilities/any/size_and_alignment.pass.cpp
+++ test/libcxx/utilities/any/size_and_alignment.pass.cpp
@@ -14,6 +14,7 @@
 // Check that the size and alignment of any are what we expect.
 
 #include 
+#include 
 
 int main()
 {
Index: test/libcxx/min_max_macros.sh.cpp
===
--- test/libcxx/min_max_macros.sh.cpp
+++ test/libcxx/min_max_macros.sh.cpp
@@ -70,6 +70,8 @@
 TEST_MACROS();
 #include 
 TEST_MACROS();
+#include 
+TEST_MACROS();
 #include 
 TEST_MACROS();
 #include 
Index: include/cstdalign
===
--- include/cstdalign
+++ include/cstdalign
@@ -1,25 +1,33 @@
 // -*- C++ -*-
-//===-- cassert ---===//
+//===--- cstdalign ===//
 //
 // The LLVM Compiler Infrastructure
 //
 // This file is dual licensed under the MIT and the University of Illinois Open
 // Source Licenses. See LICENSE.TXT for details.
 //
 //===--===//
 
+#ifndef _LIBCPP_CSTDALIGN
+#define _LIBCPP_CSTDALIGN
+
 /*
-cassert synopsis
+cstdalign synopsis
 
 Macros:
 
-assert
+   alignof
+   alignas
+__alignof_is_defined
+__alignas_is_defined
 
 */
 
 #include <__config>
-#include 
+#include 
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
+
+#endif  // _LIBCPP_CSTDALIGN
Index: include/cassert
===
--- include/cassert
+++ include/cassert
@@ -8,6 +8,9 @@
 //
 //===--===//
 
+#ifndef _LIBCPP_CASSERT
+#define _LIBCPP_CASSERT
+
 /*
 cassert synopsis
 
@@ -23,3 +26,5 @@
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
+
+#endif  // _LIBCPP_CASSERT
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits