[llvm-branch-commits] [clang] f00a20e - [clang-format] Add the possibility to align assignments spanning empty lines or comments

2021-01-25 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2021-01-25T09:36:55+01:00
New Revision: f00a20e51c1d186e72844939aad10416e1cc99de

URL: 
https://github.com/llvm/llvm-project/commit/f00a20e51c1d186e72844939aad10416e1cc99de
DIFF: 
https://github.com/llvm/llvm-project/commit/f00a20e51c1d186e72844939aad10416e1cc99de.diff

LOG: [clang-format] Add the possibility to align assignments spanning empty 
lines or comments

Currently, empty lines and comments break alignment of assignments on 
consecutive
lines. This makes the AlignConsecutiveAssignments option an enum that allows 
controlling
whether empty lines or empty lines and comments should be ignored when aligning
assignments.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, tinloaf

Differential Revision: https://reviews.llvm.org/D93986

Added: 


Modified: 
clang/docs/ClangFormatStyleOptions.rst
clang/docs/ReleaseNotes.rst
clang/docs/tools/dump_format_style.py
clang/include/clang/Format/Format.h
clang/lib/Format/Format.cpp
clang/lib/Format/WhitespaceManager.cpp
clang/unittests/Format/FormatTest.cpp

Removed: 




diff  --git a/clang/docs/ClangFormatStyleOptions.rst 
b/clang/docs/ClangFormatStyleOptions.rst
index 27dcee83a538..6877cac28278 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -195,23 +195,84 @@ the configuration (without a prefix: ``Auto``).
 
 
 
-**AlignConsecutiveAssignments** (``bool``)
-  If ``true``, aligns consecutive assignments.
+**AlignConsecutiveAssignments** (``AlignConsecutiveStyle``)
+  Style of aligning consecutive assignments.
 
-  This will align the assignment operators of consecutive lines. This
-  will result in formattings like
+  ``Consecutive`` will result in formattings like:
 
   .. code-block:: c++
 
-int  = 12;
-int b= 23;
-int ccc  = 23;
+int a= 1;
+int somelongname = 2;
+double c = 3;
 
-**AlignConsecutiveBitFields** (``bool``)
-  If ``true``, aligns consecutive bitfield members.
+  Possible values:
+
+  * ``ACS_None`` (in configuration: ``None``)
+ Do not align assignments on consecutive lines.
+
+  * ``ACS_Consecutive`` (in configuration: ``Consecutive``)
+ Align assignments on consecutive lines. This will result in
+ formattings like:
+
+ .. code-block:: c++
+
+   int a= 1;
+   int somelongname = 2;
+   double c = 3;
+
+   int d = 3;
+   /* A comment. */
+   double e = 4;
+
+  * ``ACS_AcrossEmptyLines`` (in configuration: ``AcrossEmptyLines``)
+ Same as ACS_Consecutive, but also spans over empty lines, e.g.
+
+ .. code-block:: c++
+
+   int a= 1;
+   int somelongname = 2;
+   double c = 3;
+
+   int d= 3;
+   /* A comment. */
+   double e = 4;
+
+  * ``ACS_AcrossComments`` (in configuration: ``AcrossComments``)
+ Same as ACS_Consecutive, but also spans over lines only containing
+ comments, e.g.
+
+ .. code-block:: c++
+
+   int a= 1;
+   int somelongname = 2;
+   double c = 3;
+
+   int d= 3;
+   /* A comment. */
+   double e = 4;
+
+  * ``ACS_AcrossEmptyLinesAndComments``
+(in configuration: ``AcrossEmptyLinesAndComments``)
+
+ Same as ACS_Consecutive, but also spans over lines only containing
+ comments and empty lines, e.g.
+
+ .. code-block:: c++
+
+   int a= 1;
+   int somelongname = 2;
+   double c = 3;
+
+   int d= 3;
+   /* A comment. */
+   double e = 4;
+
+**AlignConsecutiveBitFields** (``AlignConsecutiveStyle``)
+  Style of aligning consecutive bit field.
 
-  This will align the bitfield separators of consecutive lines. This
-  will result in formattings like
+  ``Consecutive`` will align the bitfield separators of consecutive lines.
+  This will result in formattings like:
 
   .. code-block:: c++
 
@@ -219,23 +280,146 @@ the configuration (without a prefix: ``Auto``).
 int b: 12;
 int ccc  : 8;
 
-**AlignConsecutiveDeclarations** (``bool``)
-  If ``true``, aligns consecutive declarations.
+  Possible values:
+
+  * ``ACS_None`` (in configuration: ``None``)
+ Do not align bit fields on consecutive lines.
+
+  * ``ACS_Consecutive`` (in configuration: ``Consecutive``)
+ Align bit fields on consecutive lines. This will result in
+ formattings like:
+
+ .. code-block:: c++
+
+   int  : 1;
+   int b: 12;
+   int ccc  : 8;
+
+   int d : 2;
+   /* A comment. */
+   int ee : 3;
+
+  * ``ACS_AcrossEmptyLines`` (in configuration: ``AcrossEmptyLines``)
+ Same as ACS_Consecutive, but also spans over empty lines, e.g.
+
+ .. code-block:: c++
+
+   int  : 1;
+   int b: 12;
+   int ccc  : 8;
+
+   int d: 2;
+   /* A comment. */
+   int ee : 3;
+
+  * ``ACS_Acro

[llvm-branch-commits] [clang] 7b9d88a - Revert "[clang-format] Add the possibility to align assignments spanning empty lines or comments"

2021-01-25 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2021-01-25T09:40:46+01:00
New Revision: 7b9d88ab389e19d26432b1c1a6d57f554feb9a20

URL: 
https://github.com/llvm/llvm-project/commit/7b9d88ab389e19d26432b1c1a6d57f554feb9a20
DIFF: 
https://github.com/llvm/llvm-project/commit/7b9d88ab389e19d26432b1c1a6d57f554feb9a20.diff

LOG: Revert "[clang-format] Add the possibility to align assignments spanning 
empty lines or comments"

This reverts commit f00a20e51c1d186e72844939aad10416e1cc99de.

Added: 


Modified: 
clang/docs/ClangFormatStyleOptions.rst
clang/docs/ReleaseNotes.rst
clang/docs/tools/dump_format_style.py
clang/include/clang/Format/Format.h
clang/lib/Format/Format.cpp
clang/lib/Format/WhitespaceManager.cpp
clang/unittests/Format/FormatTest.cpp

Removed: 




diff  --git a/clang/docs/ClangFormatStyleOptions.rst 
b/clang/docs/ClangFormatStyleOptions.rst
index 6877cac28278..27dcee83a538 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -195,84 +195,23 @@ the configuration (without a prefix: ``Auto``).
 
 
 
-**AlignConsecutiveAssignments** (``AlignConsecutiveStyle``)
-  Style of aligning consecutive assignments.
+**AlignConsecutiveAssignments** (``bool``)
+  If ``true``, aligns consecutive assignments.
 
-  ``Consecutive`` will result in formattings like:
+  This will align the assignment operators of consecutive lines. This
+  will result in formattings like
 
   .. code-block:: c++
 
-int a= 1;
-int somelongname = 2;
-double c = 3;
+int  = 12;
+int b= 23;
+int ccc  = 23;
 
-  Possible values:
-
-  * ``ACS_None`` (in configuration: ``None``)
- Do not align assignments on consecutive lines.
-
-  * ``ACS_Consecutive`` (in configuration: ``Consecutive``)
- Align assignments on consecutive lines. This will result in
- formattings like:
-
- .. code-block:: c++
-
-   int a= 1;
-   int somelongname = 2;
-   double c = 3;
-
-   int d = 3;
-   /* A comment. */
-   double e = 4;
-
-  * ``ACS_AcrossEmptyLines`` (in configuration: ``AcrossEmptyLines``)
- Same as ACS_Consecutive, but also spans over empty lines, e.g.
-
- .. code-block:: c++
-
-   int a= 1;
-   int somelongname = 2;
-   double c = 3;
-
-   int d= 3;
-   /* A comment. */
-   double e = 4;
-
-  * ``ACS_AcrossComments`` (in configuration: ``AcrossComments``)
- Same as ACS_Consecutive, but also spans over lines only containing
- comments, e.g.
-
- .. code-block:: c++
-
-   int a= 1;
-   int somelongname = 2;
-   double c = 3;
-
-   int d= 3;
-   /* A comment. */
-   double e = 4;
-
-  * ``ACS_AcrossEmptyLinesAndComments``
-(in configuration: ``AcrossEmptyLinesAndComments``)
-
- Same as ACS_Consecutive, but also spans over lines only containing
- comments and empty lines, e.g.
-
- .. code-block:: c++
-
-   int a= 1;
-   int somelongname = 2;
-   double c = 3;
-
-   int d= 3;
-   /* A comment. */
-   double e = 4;
-
-**AlignConsecutiveBitFields** (``AlignConsecutiveStyle``)
-  Style of aligning consecutive bit field.
+**AlignConsecutiveBitFields** (``bool``)
+  If ``true``, aligns consecutive bitfield members.
 
-  ``Consecutive`` will align the bitfield separators of consecutive lines.
-  This will result in formattings like:
+  This will align the bitfield separators of consecutive lines. This
+  will result in formattings like
 
   .. code-block:: c++
 
@@ -280,146 +219,23 @@ the configuration (without a prefix: ``Auto``).
 int b: 12;
 int ccc  : 8;
 
-  Possible values:
-
-  * ``ACS_None`` (in configuration: ``None``)
- Do not align bit fields on consecutive lines.
-
-  * ``ACS_Consecutive`` (in configuration: ``Consecutive``)
- Align bit fields on consecutive lines. This will result in
- formattings like:
-
- .. code-block:: c++
-
-   int  : 1;
-   int b: 12;
-   int ccc  : 8;
-
-   int d : 2;
-   /* A comment. */
-   int ee : 3;
-
-  * ``ACS_AcrossEmptyLines`` (in configuration: ``AcrossEmptyLines``)
- Same as ACS_Consecutive, but also spans over empty lines, e.g.
-
- .. code-block:: c++
-
-   int  : 1;
-   int b: 12;
-   int ccc  : 8;
-
-   int d: 2;
-   /* A comment. */
-   int ee : 3;
-
-  * ``ACS_AcrossComments`` (in configuration: ``AcrossComments``)
- Same as ACS_Consecutive, but also spans over lines only containing
- comments, e.g.
-
- .. code-block:: c++
-
-   int  : 1;
-   int b: 12;
-   int ccc  : 8;
-
-   int d  : 2;
-   /* A comment. */
-   int ee : 3;
-
-  * ``ACS_AcrossEmptyLinesAndComments``
-  (in configuration: ``AcrossEmptyLinesAndComment

[llvm-branch-commits] [clang] 2563147 - [clang-format] Add the possibility to align assignments spanning empty lines or comments

2021-01-25 Thread Marek Kurdej via llvm-branch-commits

Author: Lukas Barth
Date: 2021-01-25T09:41:50+01:00
New Revision: 256314711f3fa724bff1bb2d8b93c5252265b5c7

URL: 
https://github.com/llvm/llvm-project/commit/256314711f3fa724bff1bb2d8b93c5252265b5c7
DIFF: 
https://github.com/llvm/llvm-project/commit/256314711f3fa724bff1bb2d8b93c5252265b5c7.diff

LOG: [clang-format] Add the possibility to align assignments spanning empty 
lines or comments

Currently, empty lines and comments break alignment of assignments on 
consecutive
lines. This makes the AlignConsecutiveAssignments option an enum that allows 
controlling
whether empty lines or empty lines and comments should be ignored when aligning
assignments.

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, tinloaf

Differential Revision: https://reviews.llvm.org/D93986

Added: 


Modified: 
clang/docs/ClangFormatStyleOptions.rst
clang/docs/ReleaseNotes.rst
clang/docs/tools/dump_format_style.py
clang/include/clang/Format/Format.h
clang/lib/Format/Format.cpp
clang/lib/Format/WhitespaceManager.cpp
clang/unittests/Format/FormatTest.cpp

Removed: 




diff  --git a/clang/docs/ClangFormatStyleOptions.rst 
b/clang/docs/ClangFormatStyleOptions.rst
index 27dcee83a538..6877cac28278 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -195,23 +195,84 @@ the configuration (without a prefix: ``Auto``).
 
 
 
-**AlignConsecutiveAssignments** (``bool``)
-  If ``true``, aligns consecutive assignments.
+**AlignConsecutiveAssignments** (``AlignConsecutiveStyle``)
+  Style of aligning consecutive assignments.
 
-  This will align the assignment operators of consecutive lines. This
-  will result in formattings like
+  ``Consecutive`` will result in formattings like:
 
   .. code-block:: c++
 
-int  = 12;
-int b= 23;
-int ccc  = 23;
+int a= 1;
+int somelongname = 2;
+double c = 3;
 
-**AlignConsecutiveBitFields** (``bool``)
-  If ``true``, aligns consecutive bitfield members.
+  Possible values:
+
+  * ``ACS_None`` (in configuration: ``None``)
+ Do not align assignments on consecutive lines.
+
+  * ``ACS_Consecutive`` (in configuration: ``Consecutive``)
+ Align assignments on consecutive lines. This will result in
+ formattings like:
+
+ .. code-block:: c++
+
+   int a= 1;
+   int somelongname = 2;
+   double c = 3;
+
+   int d = 3;
+   /* A comment. */
+   double e = 4;
+
+  * ``ACS_AcrossEmptyLines`` (in configuration: ``AcrossEmptyLines``)
+ Same as ACS_Consecutive, but also spans over empty lines, e.g.
+
+ .. code-block:: c++
+
+   int a= 1;
+   int somelongname = 2;
+   double c = 3;
+
+   int d= 3;
+   /* A comment. */
+   double e = 4;
+
+  * ``ACS_AcrossComments`` (in configuration: ``AcrossComments``)
+ Same as ACS_Consecutive, but also spans over lines only containing
+ comments, e.g.
+
+ .. code-block:: c++
+
+   int a= 1;
+   int somelongname = 2;
+   double c = 3;
+
+   int d= 3;
+   /* A comment. */
+   double e = 4;
+
+  * ``ACS_AcrossEmptyLinesAndComments``
+(in configuration: ``AcrossEmptyLinesAndComments``)
+
+ Same as ACS_Consecutive, but also spans over lines only containing
+ comments and empty lines, e.g.
+
+ .. code-block:: c++
+
+   int a= 1;
+   int somelongname = 2;
+   double c = 3;
+
+   int d= 3;
+   /* A comment. */
+   double e = 4;
+
+**AlignConsecutiveBitFields** (``AlignConsecutiveStyle``)
+  Style of aligning consecutive bit field.
 
-  This will align the bitfield separators of consecutive lines. This
-  will result in formattings like
+  ``Consecutive`` will align the bitfield separators of consecutive lines.
+  This will result in formattings like:
 
   .. code-block:: c++
 
@@ -219,23 +280,146 @@ the configuration (without a prefix: ``Auto``).
 int b: 12;
 int ccc  : 8;
 
-**AlignConsecutiveDeclarations** (``bool``)
-  If ``true``, aligns consecutive declarations.
+  Possible values:
+
+  * ``ACS_None`` (in configuration: ``None``)
+ Do not align bit fields on consecutive lines.
+
+  * ``ACS_Consecutive`` (in configuration: ``Consecutive``)
+ Align bit fields on consecutive lines. This will result in
+ formattings like:
+
+ .. code-block:: c++
+
+   int  : 1;
+   int b: 12;
+   int ccc  : 8;
+
+   int d : 2;
+   /* A comment. */
+   int ee : 3;
+
+  * ``ACS_AcrossEmptyLines`` (in configuration: ``AcrossEmptyLines``)
+ Same as ACS_Consecutive, but also spans over empty lines, e.g.
+
+ .. code-block:: c++
+
+   int  : 1;
+   int b: 12;
+   int ccc  : 8;
+
+   int d: 2;
+   /* A comment. */
+   int ee : 3;
+
+  * ``ACS_Acros

[llvm-branch-commits] [libcxxabi] 5e7a93a - [libc++] Set CMAKE_FOLDER. NFC.

2021-01-25 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2021-01-25T09:51:16+01:00
New Revision: 5e7a93a954e68b002edd2cd7fb1b2a61186c7124

URL: 
https://github.com/llvm/llvm-project/commit/5e7a93a954e68b002edd2cd7fb1b2a61186c7124
DIFF: 
https://github.com/llvm/llvm-project/commit/5e7a93a954e68b002edd2cd7fb1b2a61186c7124.diff

LOG: [libc++] Set CMAKE_FOLDER. NFC.

* This variable populates the default value of FOLDER target property. It is 
used in some IDE's (e.g. MSVC) to group different targets together.

Added: 


Modified: 
libcxx/CMakeLists.txt
libcxx/benchmarks/CMakeLists.txt
libcxxabi/CMakeLists.txt

Removed: 




diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 6a55245ab87a..4e7e8f978546 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -19,6 +19,8 @@ set(CMAKE_MODULE_PATH
   ${CMAKE_MODULE_PATH}
   )
 
+set(CMAKE_FOLDER "libc++")
+
 set(LIBCXX_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXX_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
 set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")

diff  --git a/libcxx/benchmarks/CMakeLists.txt 
b/libcxx/benchmarks/CMakeLists.txt
index 42d25c20c811..0327f05ccfa6 100644
--- a/libcxx/benchmarks/CMakeLists.txt
+++ b/libcxx/benchmarks/CMakeLists.txt
@@ -5,6 +5,8 @@ include(CheckCXXCompilerFlag)
 # Build Google Benchmark for libc++
 #==
 
+set(CMAKE_FOLDER "${CMAKE_FOLDER}/Benchmarks")
+
 set(BENCHMARK_LIBCXX_COMPILE_FLAGS
 -Wno-unused-command-line-argument
 -nostdinc++

diff  --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index ede8bd71da4c..b803347c2a8e 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -17,6 +17,8 @@ set(CMAKE_MODULE_PATH
   ${CMAKE_MODULE_PATH}
   )
 
+set(CMAKE_FOLDER "libc++")
+
 set(LIBCXXABI_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXXABI_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
 set(LIBCXXABI_LIBCXX_PATH "${CMAKE_CURRENT_LIST_DIR}/../libcxx" CACHE PATH



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


[llvm-branch-commits] [clang] 33a63a3 - [clang-format] [docs] Fix RST indentation.

2021-01-25 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2021-01-25T11:00:46+01:00
New Revision: 33a63a36d3cb0a59ef80054a02babe7a28a9842a

URL: 
https://github.com/llvm/llvm-project/commit/33a63a36d3cb0a59ef80054a02babe7a28a9842a
DIFF: 
https://github.com/llvm/llvm-project/commit/33a63a36d3cb0a59ef80054a02babe7a28a9842a.diff

LOG: [clang-format] [docs] Fix RST indentation.

Added: 


Modified: 
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Format/Format.h

Removed: 




diff  --git a/clang/docs/ClangFormatStyleOptions.rst 
b/clang/docs/ClangFormatStyleOptions.rst
index 6877cac28278..3141dd5510fc 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -327,7 +327,7 @@ the configuration (without a prefix: ``Auto``).
int ee : 3;
 
   * ``ACS_AcrossEmptyLinesAndComments``
-  (in configuration: ``AcrossEmptyLinesAndComments``)
+(in configuration: ``AcrossEmptyLinesAndComments``)
 
  Same as ACS_Consecutive, but also spans over lines only containing
  comments and empty lines, e.g.
@@ -401,7 +401,7 @@ the configuration (without a prefix: ``Auto``).
bool c = false;
 
   * ``ACS_AcrossEmptyLinesAndComments``
-  (in configuration: ``AcrossEmptyLinesAndComments``)
+(in configuration: ``AcrossEmptyLinesAndComments``)
 
  Same as ACS_Consecutive, but also spans over lines only containing
  comments and empty lines, e.g.
@@ -476,7 +476,7 @@ the configuration (without a prefix: ``Auto``).
#define bar(y, z) (y + z)
 
   * ``ACS_AcrossEmptyLinesAndComments``
-  (in configuration: ``AcrossEmptyLinesAndComments``)
+(in configuration: ``AcrossEmptyLinesAndComments``)
 
  Same as ACS_Consecutive, but also spans over lines only containing
  comments and empty lines, e.g.

diff  --git a/clang/include/clang/Format/Format.h 
b/clang/include/clang/Format/Format.h
index a95689097b00..fcc38e25542f 100644
--- a/clang/include/clang/Format/Format.h
+++ b/clang/include/clang/Format/Format.h
@@ -153,7 +153,7 @@ struct FormatStyle {
   ///\endcode
   ///
   /// * ``ACS_AcrossEmptyLinesAndComments``
-  /// (in configuration: ``AcrossEmptyLinesAndComments``)
+  ///   (in configuration: ``AcrossEmptyLinesAndComments``)
   ///
   ///Same as ACS_Consecutive, but also spans over lines only containing
   ///comments and empty lines, e.g.
@@ -290,7 +290,7 @@ struct FormatStyle {
   ///\endcode
   ///
   /// * ``ACS_AcrossEmptyLinesAndComments``
-  /// (in configuration: ``AcrossEmptyLinesAndComments``)
+  ///   (in configuration: ``AcrossEmptyLinesAndComments``)
   ///
   ///Same as ACS_Consecutive, but also spans over lines only containing
   ///comments and empty lines, e.g.
@@ -359,7 +359,7 @@ struct FormatStyle {
   ///\endcode
   ///
   /// * ``ACS_AcrossEmptyLinesAndComments``
-  /// (in configuration: ``AcrossEmptyLinesAndComments``)
+  ///   (in configuration: ``AcrossEmptyLinesAndComments``)
   ///
   ///Same as ACS_Consecutive, but also spans over lines only containing
   ///comments and empty lines, e.g.



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


[llvm-branch-commits] [clang] 3395a33 - [clang-format] add case aware include sorting

2021-01-25 Thread Marek Kurdej via llvm-branch-commits

Author: Lukas Barth
Date: 2021-01-25T18:53:22+01:00
New Revision: 3395a336b02538d0bb768ccfae11c9b6151b102e

URL: 
https://github.com/llvm/llvm-project/commit/3395a336b02538d0bb768ccfae11c9b6151b102e
DIFF: 
https://github.com/llvm/llvm-project/commit/3395a336b02538d0bb768ccfae11c9b6151b102e.diff

LOG: [clang-format] add case aware include sorting

* Adds an option to [clang-format] which sorts
  headers in an alphabetical manner using case
  only for tie-breakers. The options is off by
  default in favor of the current ASCIIbetical
  sorting style.

Reviewed By: curdeius, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D95017

Added: 


Modified: 
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Tooling/Inclusions/IncludeStyle.h
clang/lib/Format/Format.cpp
clang/unittests/Format/FormatTest.cpp
clang/unittests/Format/SortIncludesTest.cpp

Removed: 




diff  --git a/clang/docs/ClangFormatStyleOptions.rst 
b/clang/docs/ClangFormatStyleOptions.rst
index 3141dd5510fc..d5ce1b7b2e8e 100644
--- a/clang/docs/ClangFormatStyleOptions.rst
+++ b/clang/docs/ClangFormatStyleOptions.rst
@@ -2282,6 +2282,26 @@ the configuration (without a prefix: ``Auto``).
   ``ClassImpl.hpp`` would not have the main include file put on top
   before any other include.
 
+**IncludeSortAlphabetically** (``bool``)
+  Specify if sorting should be done in an alphabetical and
+  case sensitive fashion.
+
+  When ``false``, includes are sorted in an ASCIIbetical
+  fashion.
+  When ``true``, includes are sorted in an alphabetical
+  fashion with case used as a tie-breaker.
+
+  .. code-block:: c++
+
+ false:   true:
+ #include "A/B.h"   vs.   #include "A/B.h"
+ #include "A/b.h" #include "A/b.h"
+ #include "B/A.h" #include "a/b.h"
+ #include "B/a.h" #include "B/A.h"
+ #include "a/b.h" #include "B/a.h"
+
+  This option is off by default.
+
 **IndentCaseBlocks** (``bool``)
   Indent case label blocks one level from the case label.
 

diff  --git a/clang/include/clang/Tooling/Inclusions/IncludeStyle.h 
b/clang/include/clang/Tooling/Inclusions/IncludeStyle.h
index 4caaf4121f15..652a7b61a0a4 100644
--- a/clang/include/clang/Tooling/Inclusions/IncludeStyle.h
+++ b/clang/include/clang/Tooling/Inclusions/IncludeStyle.h
@@ -147,6 +147,26 @@ struct IncludeStyle {
   /// ``ClassImpl.hpp`` would not have the main include file put on top
   /// before any other include.
   std::string IncludeIsMainSourceRegex;
+
+  /// Specify if sorting should be done in an alphabetical and
+  /// case sensitive fashion.
+  ///
+  /// When ``false``, includes are sorted in an ASCIIbetical
+  /// fashion.
+  /// When ``true``, includes are sorted in an alphabetical
+  /// fashion with case used as a tie-breaker.
+  ///
+  /// \code
+  ///   false:   true:
+  ///   #include "A/B.h"   vs.   #include "A/B.h"
+  ///   #include "A/b.h" #include "A/b.h"
+  ///   #include "B/A.h" #include "a/b.h"
+  ///   #include "B/a.h" #include "B/A.h"
+  ///   #include "a/b.h" #include "B/a.h"
+  /// \endcode
+  ///
+  /// This option is off by default.
+  bool IncludeSortAlphabetically;
 };
 
 } // namespace tooling

diff  --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index cd1c6e4f6023..0986ef845a4e 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -571,6 +571,8 @@ template <> struct MappingTraits {
 IO.mapOptional("IncludeIsMainRegex", 
Style.IncludeStyle.IncludeIsMainRegex);
 IO.mapOptional("IncludeIsMainSourceRegex",
Style.IncludeStyle.IncludeIsMainSourceRegex);
+IO.mapOptional("IncludeSortAlphabetically",
+   Style.IncludeStyle.IncludeSortAlphabetically);
 IO.mapOptional("IndentCaseLabels", Style.IndentCaseLabels);
 IO.mapOptional("IndentCaseBlocks", Style.IndentCaseBlocks);
 IO.mapOptional("IndentGotoLabels", Style.IndentGotoLabels);
@@ -940,6 +942,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind 
Language) {
   {".*", 1, 0, false}};
   LLVMStyle.IncludeStyle.IncludeIsMainRegex = "(Test)?$";
   LLVMStyle.IncludeStyle.IncludeBlocks = tooling::IncludeStyle::IBS_Preserve;
+  LLVMStyle.IncludeStyle.IncludeSortAlphabetically = false;
   LLVMStyle.IndentCaseLabels = false;
   LLVMStyle.IndentCaseBlocks = false;
   LLVMStyle.IndentGotoLabels = true;
@@ -2194,10 +2197,23 @@ static void sortCppIncludes(const FormatStyle &Style,
   for (unsigned i = 0, e = Includes.size(); i != e; ++i) {
 Indices.push_back(i);
   }
-  llvm::stable_sort(Indices, [&](unsigned LHSI, unsigned RHSI) {
-return std::tie(Includes[LHSI].Priority, Includes[

[llvm-branch-commits] [libcxx] 1f12501 - [libc++] [C++2b] [P1048] Add is_scoped_enum and is_scoped_enum_v.

2021-01-12 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2021-01-12T17:08:20+01:00
New Revision: 1f1250151f222ba391d05dcc173f4b6c65d05ca2

URL: 
https://github.com/llvm/llvm-project/commit/1f1250151f222ba391d05dcc173f4b6c65d05ca2
DIFF: 
https://github.com/llvm/llvm-project/commit/1f1250151f222ba391d05dcc173f4b6c65d05ca2.diff

LOG: [libc++] [C++2b] [P1048] Add is_scoped_enum and is_scoped_enum_v.

* https://wg21.link/p1048

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D94409

Added: 

libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp

Modified: 
libcxx/docs/Cxx2bStatusPaperStatus.csv
libcxx/docs/FeatureTestMacroTable.rst
libcxx/include/type_traits
libcxx/include/version

libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
libcxx/utils/generate_feature_test_macro_components.py

Removed: 




diff  --git a/libcxx/docs/Cxx2bStatusPaperStatus.csv 
b/libcxx/docs/Cxx2bStatusPaperStatus.csv
index c79509528add..f5c893fdbd48 100644
--- a/libcxx/docs/Cxx2bStatusPaperStatus.csv
+++ b/libcxx/docs/Cxx2bStatusPaperStatus.csv
@@ -1,6 +1,6 @@
 "Paper #","Group","Paper Name","Meeting","Status","First released version"
 "`P0881R7 `__","LWG","A Proposal to add stacktrace 
library","Autumn 2020","",""
 "`P0943R6 `__","LWG","Support C atomics in 
C++","Autumn 2020","",""
-"`P1048R1 `__","LWG","A proposal for a type trait 
to detect scoped enumerations","Autumn 2020","",""
+"`P1048R1 `__","LWG","A proposal for a type trait 
to detect scoped enumerations","Autumn 2020","|Complete|","12.0"
 "`P1679R3 `__","LWG","string contains 
function","Autumn 2020","",""
 "","","","","",""

diff  --git a/libcxx/docs/FeatureTestMacroTable.rst 
b/libcxx/docs/FeatureTestMacroTable.rst
index 99fb4e790c7d..8221bbe2a4af 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -292,7 +292,7 @@ Status
 - -
 **C++ 2b**
 ---
-``__cpp_lib_is_scoped_enum``  *unimplemented*
+``__cpp_lib_is_scoped_enum``  ``202011L``
 - -
 ``__cpp_lib_stacktrace``  *unimplemented*
 - -

diff  --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 99b2a8f9f025..48884eab8e86 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -51,6 +51,7 @@ namespace std
 template  struct is_arithmetic;
 template  struct is_fundamental;
 template  struct is_member_pointer;
+template  struct is_scoped_enum; // C++2b
 template  struct is_scalar;
 template  struct is_object;
 template  struct is_compound;
@@ -284,6 +285,8 @@ namespace std
 = is_compound::value; // 
C++17
   template  inline constexpr bool is_member_pointer_v
 = is_member_pointer::value;   // 
C++17
+  template  inline constexpr bool is_scoped_enum_v
+= is_scoped_enum::value;  // 
C++2b
 
   // See C++14 20.10.4.3, type properties
   template  inline constexpr bool is_const_v
@@ -4177,6 +4180,25 @@ struct __has_operator_addressof
 
 #endif  // _LIBCPP_CXX03_LANG
 
+// is_scoped_enum [meta.unary.prop]
+
+#if _LIBCPP_STD_VER > 20
+template  >
+struct __is_scoped_enum_helper : false_type {};
+
+template 
+struct __is_scoped_enum_helper<_Tp, true>
+: public bool_constant > > 
{};
+
+template 
+struct _LIBCPP_TEMPLATE_VIS is_scoped_enum
+: public __is_scoped_enum_helper<_Tp> {};
+
+template 
+_LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_scoped_enum_v =
+is_scoped_enum<_Tp>::value;
+#endif
+
 #if _LIBCPP_STD_VER > 14
 
 template 

diff  --git a/libcxx/include/version b/libcxx/include/version
index 3920b69a601c..9e5fc81da44e 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -355,7 +355,7 @@ __cpp_lib_void_t
201411L 
 #endif
 
 #if _LIBCPP_STD_VER > 20
-// # define __cpp_lib_is_scoped_enum   202011L
+# define __cpp_lib_is_scoped_enum   202011L
 // # define __cpp_lib_stacktrace   202011L
 // # define __cpp_lib_stdatomic_h  202011L
 // # define __cpp_lib_string_contains  202011L

diff  --git 
a/libcxx/test/std/language.support/support.limits/supp

[llvm-branch-commits] [libcxx] f3b979b - [libc++] Use ioctl when available to get random_device entropy.

2021-01-21 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2021-01-21T18:01:02+01:00
New Revision: f3b979b65e9ff81b656d26d9f2a1c731301fd445

URL: 
https://github.com/llvm/llvm-project/commit/f3b979b65e9ff81b656d26d9f2a1c731301fd445
DIFF: 
https://github.com/llvm/llvm-project/commit/f3b979b65e9ff81b656d26d9f2a1c731301fd445.diff

LOG: [libc++] Use ioctl when available to get random_device entropy.

Implemented the idea from D94571 to improve entropy on Linux.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D94953

Added: 


Modified: 
libcxx/src/random.cpp
libcxx/test/std/numerics/rand/rand.device/entropy.pass.cpp

Removed: 




diff  --git a/libcxx/src/random.cpp b/libcxx/src/random.cpp
index 04adc59f9bc9..7d0431e5ca54 100644
--- a/libcxx/src/random.cpp
+++ b/libcxx/src/random.cpp
@@ -13,6 +13,7 @@
 #define _CRT_RAND_S
 #endif // defined(_LIBCPP_USING_WIN32_RANDOM)
 
+#include "limits"
 #include "random"
 #include "system_error"
 
@@ -29,6 +30,10 @@
 #elif defined(_LIBCPP_USING_DEV_RANDOM)
 #include 
 #include 
+#if __has_include() && __has_include()
+#include 
+#include 
+#endif
 #elif defined(_LIBCPP_USING_NACL_RANDOM)
 #include 
 #endif
@@ -172,7 +177,21 @@ random_device::operator()()
 double
 random_device::entropy() const _NOEXCEPT
 {
+#if defined(_LIBCPP_USING_DEV_RANDOM) && defined(RNDGETENTCNT)
+  int ent;
+  if (::ioctl(__f_, RNDGETENTCNT, &ent) < 0)
+return 0;
+
+  if (ent < 0)
 return 0;
+
+  if (ent > std::numeric_limits::digits)
+return std::numeric_limits::digits;
+
+  return ent;
+#else
+  return 0;
+#endif
 }
 
 _LIBCPP_END_NAMESPACE_STD

diff  --git a/libcxx/test/std/numerics/rand/rand.device/entropy.pass.cpp 
b/libcxx/test/std/numerics/rand/rand.device/entropy.pass.cpp
index 4f09d05012ea..3f9ea85bfc05 100644
--- a/libcxx/test/std/numerics/rand/rand.device/entropy.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.device/entropy.pass.cpp
@@ -16,14 +16,15 @@
 
 #include 
 #include 
+#include 
 
 #include "test_macros.h"
 
-int main(int, char**)
-{
-std::random_device r;
-double e = r.entropy();
-((void)e); // Prevent unused warning
+int main(int, char**) {
+  std::random_device r;
+  double e = r.entropy();
+  assert(e >= 0);
+  assert(e <= sizeof(typename std::random_device::result_type) * CHAR_BIT);
 
   return 0;
 }



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


[llvm-branch-commits] [libcxx] 3f0b637 - [libc++] [docs] Mark contract-related papers as removed from C++20.

2020-12-30 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-30T14:24:26+01:00
New Revision: 3f0b637d6b3ef967383610051f040c2a7d40d206

URL: 
https://github.com/llvm/llvm-project/commit/3f0b637d6b3ef967383610051f040c2a7d40d206
DIFF: 
https://github.com/llvm/llvm-project/commit/3f0b637d6b3ef967383610051f040c2a7d40d206.diff

LOG: [libc++] [docs] Mark contract-related papers as removed from C++20.

Added: 


Modified: 
libcxx/docs/Cxx2aStatusPaperStatus.csv

Removed: 




diff  --git a/libcxx/docs/Cxx2aStatusPaperStatus.csv 
b/libcxx/docs/Cxx2aStatusPaperStatus.csv
index fe5b2f5d4771..c2a84a4b4353 100644
--- a/libcxx/docs/Cxx2aStatusPaperStatus.csv
+++ b/libcxx/docs/Cxx2aStatusPaperStatus.csv
@@ -31,7 +31,7 @@
 "`P0475R1 `__","LWG","LWG 2511: guaranteed copy 
elision for piecewise construction","Rapperswil","",""
 "`P0476R2 `__","LWG","Bit-casting object 
representations","Rapperswil","",""
 "`P0528R3 `__","CWG","The Curious Case of Padding 
Bits, Featuring Atomic Compare-and-Exchange","Rapperswil","",""
-"`P0542R5 `__","CWG","Support for contract based 
programming in C++","Rapperswil","",""
+"`P0542R5 `__","CWG","Support for contract based 
programming in C++","Rapperswil","*Removed in Cologne*","n/a"
 "`P0556R3 `__","LWG","Integral power-of-2 
operations","Rapperswil","|Complete|","9.0"
 "`P0619R4 `__","LWG","Reviewing Deprecated 
Facilities of C++17 for C++20","Rapperswil","|Partial| [#note-P0619]_",""
 "`P0646R1 `__","LWG","Improving the Return Value of 
Erase-Like Algorithms","Rapperswil","|Complete|","10.0"
@@ -39,7 +39,7 @@
 "`P0758R1 `__","LWG","Implicit conversion traits 
and utility functions","Rapperswil","|Complete|",""
 "`P0759R1 `__","LWG","fpos 
Requirements","Rapperswil","|Complete|","11.0"
 "`P0769R2 `__","LWG","Add shift to 
","Rapperswil","",""
-"`P0788R3 `__","LWG","Standard Library 
Specification in a Concepts and Contracts World","Rapperswil","",""
+"`P0788R3 `__","LWG","Standard Library 
Specification in a Concepts and Contracts World","Rapperswil","*Removed in 
Cologne*","n/a"
 "`P0879R0 `__","LWG","Constexpr for swap and swap 
related functions Also resolves LWG issue 2800.","Rapperswil","",""
 "`P0887R1 `__","LWG","The identity 
metafunction","Rapperswil","|Complete|","8.0"
 "`P0892R2 
`__","CWG","explicit(bool)","Rapperswil","",""



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


[llvm-branch-commits] [libcxx] b6fb020 - [libc++] [CI] Install Tip-of-Trunk clang.

2021-01-07 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2021-01-07T12:04:09+01:00
New Revision: b6fb0209b6d4e93126f613eca335db84886bf939

URL: 
https://github.com/llvm/llvm-project/commit/b6fb0209b6d4e93126f613eca335db84886bf939
DIFF: 
https://github.com/llvm/llvm-project/commit/b6fb0209b6d4e93126f613eca335db84886bf939.diff

LOG: [libc++] [CI] Install Tip-of-Trunk clang.

* Check created symlinks.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D93520

Added: 


Modified: 
libcxx/utils/ci/Dockerfile

Removed: 




diff  --git a/libcxx/utils/ci/Dockerfile b/libcxx/utils/ci/Dockerfile
index fea46d8cd81e..63f747203796 100644
--- a/libcxx/utils/ci/Dockerfile
+++ b/libcxx/utils/ci/Dockerfile
@@ -50,19 +50,28 @@ RUN apt-get update && apt-get install -y libc6-dev-i386 # 
Required to cross-comp
 
 # Install the most recently released LLVM
 RUN apt-get update && apt-get install -y lsb-release wget 
software-properties-common
-RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
-RUN ln -s $(find /usr/bin -regex '^.+/clang\+\+-[0-9.]+$') /usr/bin/clang++
-RUN ln -s $(find /usr/bin -regex '^.+/clang-[0-9.]+$') /usr/bin/clang
+RUN wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
+RUN bash /tmp/llvm.sh
+RUN LLVM_VERSION=$(find /usr/bin -regex '^.+/clang-[0-9.]+$') && 
LLVM_VERSION=${LLVM_VERSION#*clang-} && echo "LLVM_VERSION=$LLVM_VERSION" > 
/tmp/env.sh
+RUN ln -s $(find /usr/bin -regex '^.+/clang\+\+-[0-9.]+$') /usr/bin/clang++ && 
[ -e $(readlink /usr/bin/clang++) ]
+RUN ln -s $(find /usr/bin -regex '^.+/clang-[0-9.]+$') /usr/bin/clang && [ -e 
$(readlink /usr/bin/clang) ]
 
-RUN apt-get update && apt-get install -y clang-format-11
-# Make a symbolic link to git-clang-format (pointing to 
git-clang-format-), if it doesn't exist.
-RUN which git-clang-format || $(cd /usr/bin/ && ln -s $(ls git-clang-format-* 
| sort -rV | head -n 1) git-clang-format)
+# Install the not-yet-released LLVM
+RUN . /tmp/env.sh && echo "LLVM_TOT_VERSION=$(($LLVM_VERSION + 1))" >> 
/tmp/env.sh
+RUN . /tmp/env.sh && bash /tmp/llvm.sh ${LLVM_TOT_VERSION}
+RUN . /tmp/env.sh && ln -s /usr/bin/clang++-${LLVM_TOT_VERSION} 
/usr/bin/clang++-tot && [ -e $(readlink /usr/bin/clang++-tot) ]
+RUN . /tmp/env.sh && ln -s /usr/bin/clang-${LLVM_TOT_VERSION} 
/usr/bin/clang-tot && [ -e $(readlink /usr/bin/clang-tot) ]
+
+# Install clang-format
+RUN . /tmp/env.sh && apt-get install -y clang-format-$LLVM_VERSION
+RUN ln -s $(find /usr/bin -regex '^.+/clang-format-[0-9.]+$') 
/usr/bin/clang-format && [ -e $(readlink /usr/bin/clang-format) ]
+RUN ln -s $(find /usr/bin -regex '^.+/git-clang-format-[0-9.]+$') 
/usr/bin/git-clang-format && [ -e $(readlink /usr/bin/git-clang-format) ]
 
 # Install a recent GCC
 RUN add-apt-repository ppa:ubuntu-toolchain-r/test
 RUN apt-get update && apt install -y gcc-10 g++-10
-RUN ln -f -s /usr/bin/g++-10 /usr/bin/g++
-RUN ln -f -s /usr/bin/gcc-10 /usr/bin/gcc
+RUN ln -f -s /usr/bin/g++-10 /usr/bin/g++ && [ -e $(readlink /usr/bin/g++) ]
+RUN ln -f -s /usr/bin/gcc-10 /usr/bin/gcc && [ -e $(readlink /usr/bin/gcc) ]
 
 # Install a recent CMake
 RUN wget 
https://github.com/Kitware/CMake/releases/download/v3.18.2/cmake-3.18.2-Linux-x86_64.sh
 -O /tmp/install-cmake.sh



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


[llvm-branch-commits] [clang] ee27c76 - [clang-format] Skip UTF8 Byte Order Mark while sorting includes

2021-01-11 Thread Marek Kurdej via llvm-branch-commits

Author: Rafał Jelonek
Date: 2021-01-11T09:32:55+01:00
New Revision: ee27c767bd2062c81f0affc0e8992f60a755f099

URL: 
https://github.com/llvm/llvm-project/commit/ee27c767bd2062c81f0affc0e8992f60a755f099
DIFF: 
https://github.com/llvm/llvm-project/commit/ee27c767bd2062c81f0affc0e8992f60a755f099.diff

LOG: [clang-format] Skip UTF8 Byte Order Mark while sorting includes

If file contain BOM then first instruction (include or clang-format off) is 
ignored

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D94201

Added: 


Modified: 
clang/lib/Format/Format.cpp
clang/unittests/Format/SortIncludesTest.cpp

Removed: 




diff  --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 54424ae190e2..5adfed5f3d32 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -2253,7 +2253,9 @@ tooling::Replacements sortCppIncludes(const FormatStyle 
&Style, StringRef Code,
   StringRef FileName,
   tooling::Replacements &Replaces,
   unsigned *Cursor) {
-  unsigned Prev = 0;
+  unsigned Prev = llvm::StringSwitch(Code)
+  .StartsWith("\xEF\xBB\xBF", 3) // UTF-8 BOM
+  .Default(0);
   unsigned SearchFrom = 0;
   llvm::Regex IncludeRegex(CppIncludeRegexPattern);
   SmallVector Matches;

diff  --git a/clang/unittests/Format/SortIncludesTest.cpp 
b/clang/unittests/Format/SortIncludesTest.cpp
index d64c97820003..6dc9d9850c59 100644
--- a/clang/unittests/Format/SortIncludesTest.cpp
+++ b/clang/unittests/Format/SortIncludesTest.cpp
@@ -879,6 +879,42 @@ TEST_F(SortIncludesTest, 
DoNotRegroupGroupsInGoogleObjCStyle) {
  "#include \"a.h\""));
 }
 
+TEST_F(SortIncludesTest, skipUTF8ByteOrderMarkMerge) {
+  Style.IncludeBlocks = Style.IBS_Merge;
+  std::string Code = "\xEF\xBB\xBF#include \"d.h\"\r\n"
+ "#include \"b.h\"\r\n"
+ "\r\n"
+ "#include \"c.h\"\r\n"
+ "#include \"a.h\"\r\n"
+ "#include \"e.h\"\r\n";
+
+  std::string Expected = "\xEF\xBB\xBF#include \"e.h\"\r\n"
+ "#include \"a.h\"\r\n"
+ "#include \"b.h\"\r\n"
+ "#include \"c.h\"\r\n"
+ "#include \"d.h\"\r\n";
+
+  EXPECT_EQ(Expected, sort(Code, "e.cpp", 1));
+}
+
+TEST_F(SortIncludesTest, skipUTF8ByteOrderMarkPreserve) {
+  Style.IncludeBlocks = Style.IBS_Preserve;
+  std::string Code = "\xEF\xBB\xBF#include \"d.h\"\r\n"
+ "#include \"b.h\"\r\n"
+ "\r\n"
+ "#include \"c.h\"\r\n"
+ "#include \"a.h\"\r\n"
+ "#include \"e.h\"\r\n";
+
+  std::string Expected = "\xEF\xBB\xBF#include \"b.h\"\r\n"
+ "#include \"d.h\"\r\n"
+ "\r\n"
+ "#include \"a.h\"\r\n"
+ "#include \"c.h\"\r\n"
+ "#include \"e.h\"\r\n";
+
+  EXPECT_EQ(Expected, sort(Code, "e.cpp", 2));
+}
 } // end namespace
 } // end namespace format
 } // end namespace clang



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


[llvm-branch-commits] [clang] 7473940 - [clang-format] turn on formatting after "clang-format on" while sorting includes

2021-01-11 Thread Marek Kurdej via llvm-branch-commits

Author: Rafał Jelonek
Date: 2021-01-11T09:41:15+01:00
New Revision: 7473940bae0f263832456d2c99a4bd606ed0d76e

URL: 
https://github.com/llvm/llvm-project/commit/7473940bae0f263832456d2c99a4bd606ed0d76e
DIFF: 
https://github.com/llvm/llvm-project/commit/7473940bae0f263832456d2c99a4bd606ed0d76e.diff

LOG: [clang-format] turn on formatting after "clang-format on" while sorting 
includes

Formatting is not active after "clang-format on" due to merging lines while 
formatting is off. Also, use trimmed line. Behaviour with LF is different than 
with CRLF.

Reviewed By: curdeius, MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D94206

Added: 


Modified: 
clang/lib/Format/Format.cpp
clang/unittests/Format/SortIncludesTest.cpp

Removed: 




diff  --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 5adfed5f3d32..37b6c4c8a20e 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -2291,7 +2291,8 @@ tooling::Replacements sortCppIncludes(const FormatStyle 
&Style, StringRef Code,
  Style.IncludeStyle.IncludeBlocks ==
  tooling::IncludeStyle::IBS_Regroup);
 
-if (!FormattingOff && !Line.endswith("\\")) {
+bool MergeWithNextLine = Trimmed.endswith("\\");
+if (!FormattingOff && !MergeWithNextLine) {
   if (IncludeRegex.match(Line, &Matches)) {
 StringRef IncludeName = Matches[2];
 int Category = Categories.getIncludePriority(
@@ -2309,10 +2310,12 @@ tooling::Replacements sortCppIncludes(const FormatStyle 
&Style, StringRef Code,
 IncludesInBlock.clear();
 FirstIncludeBlock = false;
   }
-  Prev = Pos + 1;
 }
 if (Pos == StringRef::npos || Pos + 1 == Code.size())
   break;
+
+if (!MergeWithNextLine)
+  Prev = Pos + 1;
 SearchFrom = Pos + 1;
   }
   if (!IncludesInBlock.empty()) {

diff  --git a/clang/unittests/Format/SortIncludesTest.cpp 
b/clang/unittests/Format/SortIncludesTest.cpp
index 6dc9d9850c59..f2f0e9391ece 100644
--- a/clang/unittests/Format/SortIncludesTest.cpp
+++ b/clang/unittests/Format/SortIncludesTest.cpp
@@ -207,6 +207,27 @@ TEST_F(SortIncludesTest, SupportClangFormatOff) {
  "#include \n"
  "#include \n"
  "// clang-format on\n"));
+
+  Style.IncludeBlocks = Style.IBS_Merge;
+  std::string Code = "// clang-format off\r\n"
+ "#include \"d.h\"\r\n"
+ "#include \"b.h\"\r\n"
+ "// clang-format on\r\n"
+ "\r\n"
+ "#include \"c.h\"\r\n"
+ "#include \"a.h\"\r\n"
+ "#include \"e.h\"\r\n";
+
+  std::string Expected = "// clang-format off\r\n"
+ "#include \"d.h\"\r\n"
+ "#include \"b.h\"\r\n"
+ "// clang-format on\r\n"
+ "\r\n"
+ "#include \"e.h\"\r\n"
+ "#include \"a.h\"\r\n"
+ "#include \"c.h\"\r\n";
+
+  EXPECT_EQ(Expected, sort(Code, "e.cpp", 1));
 }
 
 TEST_F(SortIncludesTest, SupportClangFormatOffCStyle) {
@@ -915,6 +936,22 @@ TEST_F(SortIncludesTest, skipUTF8ByteOrderMarkPreserve) {
 
   EXPECT_EQ(Expected, sort(Code, "e.cpp", 2));
 }
+
+TEST_F(SortIncludesTest, MergeLines) {
+  Style.IncludeBlocks = Style.IBS_Merge;
+  std::string Code = "#include \"c.h\"\r\n"
+ "#include \"b\\\r\n"
+ ".h\"\r\n"
+ "#include \"a.h\"\r\n";
+
+  std::string Expected = "#include \"a.h\"\r\n"
+ "#include \"b\\\r\n"
+ ".h\"\r\n"
+ "#include \"c.h\"\r\n";
+
+  EXPECT_EQ(Expected, sort(Code, "a.cpp", 1));
+}
+
 } // end namespace
 } // end namespace format
 } // end namespace clang



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


[llvm-branch-commits] [clang] 89878e8 - [clang-format] Find main include after block ended with #pragma hdrstop

2021-01-11 Thread Marek Kurdej via llvm-branch-commits

Author: Rafał Jelonek
Date: 2021-01-11T09:49:34+01:00
New Revision: 89878e8c966a82ed6b7f0254700017f0a97fb7d7

URL: 
https://github.com/llvm/llvm-project/commit/89878e8c966a82ed6b7f0254700017f0a97fb7d7
DIFF: 
https://github.com/llvm/llvm-project/commit/89878e8c966a82ed6b7f0254700017f0a97fb7d7.diff

LOG: [clang-format] Find main include after block ended with #pragma hdrstop

Find main include in first include block not ended with #pragma hdrstop

Reviewed By: curdeius

Differential Revision: https://reviews.llvm.org/D94217

Added: 


Modified: 
clang/lib/Format/Format.cpp
clang/unittests/Format/SortIncludesTest.cpp

Removed: 




diff  --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 37b6c4c8a20e..fc62a3419d48 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -2308,7 +2308,10 @@ tooling::Replacements sortCppIncludes(const FormatStyle 
&Style, StringRef Code,
 sortCppIncludes(Style, IncludesInBlock, Ranges, FileName, Code,
 Replaces, Cursor);
 IncludesInBlock.clear();
-FirstIncludeBlock = false;
+if (Trimmed.startswith("#pragma hdrstop")) // Precompiled headers.
+  FirstIncludeBlock = true;
+else
+  FirstIncludeBlock = false;
   }
 }
 if (Pos == StringRef::npos || Pos + 1 == Code.size())

diff  --git a/clang/unittests/Format/SortIncludesTest.cpp 
b/clang/unittests/Format/SortIncludesTest.cpp
index f2f0e9391ece..41ff7afad10e 100644
--- a/clang/unittests/Format/SortIncludesTest.cpp
+++ b/clang/unittests/Format/SortIncludesTest.cpp
@@ -900,6 +900,45 @@ TEST_F(SortIncludesTest, 
DoNotRegroupGroupsInGoogleObjCStyle) {
  "#include \"a.h\""));
 }
 
+TEST_F(SortIncludesTest, DoNotTreatPrecompiledHeadersAsFirstBlock) {
+  Style.IncludeBlocks = Style.IBS_Merge;
+  std::string Code = "#include \"d.h\"\r\n"
+ "#include \"b.h\"\r\n"
+ "#pragma hdrstop\r\n"
+ "\r\n"
+ "#include \"c.h\"\r\n"
+ "#include \"a.h\"\r\n"
+ "#include \"e.h\"\r\n";
+
+  std::string Expected = "#include \"b.h\"\r\n"
+ "#include \"d.h\"\r\n"
+ "#pragma hdrstop\r\n"
+ "\r\n"
+ "#include \"e.h\"\r\n"
+ "#include \"a.h\"\r\n"
+ "#include \"c.h\"\r\n";
+
+  EXPECT_EQ(Expected, sort(Code, "e.cpp", 2));
+
+  Code = "#include \"d.h\"\n"
+ "#include \"b.h\"\n"
+ "#pragma hdrstop( \"c:\\projects\\include\\myinc.pch\" )\n"
+ "\n"
+ "#include \"c.h\"\n"
+ "#include \"a.h\"\n"
+ "#include \"e.h\"\n";
+
+  Expected = "#include \"b.h\"\n"
+ "#include \"d.h\"\n"
+ "#pragma hdrstop(\"c:\\projects\\include\\myinc.pch\")\n"
+ "\n"
+ "#include \"e.h\"\n"
+ "#include \"a.h\"\n"
+ "#include \"c.h\"\n";
+
+  EXPECT_EQ(Expected, sort(Code, "e.cpp", 2));
+}
+
 TEST_F(SortIncludesTest, skipUTF8ByteOrderMarkMerge) {
   Style.IncludeBlocks = Style.IBS_Merge;
   std::string Code = "\xEF\xBB\xBF#include \"d.h\"\r\n"



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


[llvm-branch-commits] [libcxx] 30a7d43 - [libc++] Turn off auto-formatting of generated files. NFC.

2021-01-11 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2021-01-11T20:49:26+01:00
New Revision: 30a7d430e869bb0d8c61efa04f56e4dd2377

URL: 
https://github.com/llvm/llvm-project/commit/30a7d430e869bb0d8c61efa04f56e4dd2377
DIFF: 
https://github.com/llvm/llvm-project/commit/30a7d430e869bb0d8c61efa04f56e4dd2377.diff

LOG: [libc++] Turn off auto-formatting of generated files. NFC.

This adds `// clang-format off` in the auto-generated file to avoid lint 
warnings.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D94410

Added: 


Modified: 

libcxx/test/std/language.support/support.limits/support.limits.general/algorithm.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/any.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/array.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/barrier.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/chrono.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/cmath.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/compare.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/complex.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/concepts.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/cstddef.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/deque.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/exception.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/execution.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/forward_list.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/functional.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/iomanip.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/istream.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/iterator.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/latch.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/list.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/locale.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/map.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/mutex.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/new.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/numbers.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/numeric.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/ostream.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/regex.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/scoped_allocator.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/semaphore.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/set.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/shared_mutex.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/span.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/string.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/thread.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/tuple.version.pass.cpp

libcxx/test/std/language.support/support.limits/support.limits.general/type_traits.version.pass.cpp

[llvm-branch-commits] [libcxx] d1da346 - [libc++] Fix synopsis in string::ends_with test. NFC.

2020-12-15 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-15T19:03:11+01:00
New Revision: d1da346296fd19f110975f6f9facdb486d0e0e28

URL: 
https://github.com/llvm/llvm-project/commit/d1da346296fd19f110975f6f9facdb486d0e0e28
DIFF: 
https://github.com/llvm/llvm-project/commit/d1da346296fd19f110975f6f9facdb486d0e0e28.diff

LOG: [libc++] Fix synopsis in string::ends_with test. NFC.

Added: 


Modified: 

libcxx/test/std/strings/string.view/string.view.template/ends_with.ptr.pass.cpp

Removed: 




diff  --git 
a/libcxx/test/std/strings/string.view/string.view.template/ends_with.ptr.pass.cpp
 
b/libcxx/test/std/strings/string.view/string.view.template/ends_with.ptr.pass.cpp
index b10a546c10c7..51339641632e 100644
--- 
a/libcxx/test/std/strings/string.view/string.view.template/ends_with.ptr.pass.cpp
+++ 
b/libcxx/test/std/strings/string.view/string.view.template/ends_with.ptr.pass.cpp
@@ -9,7 +9,7 @@
 
 // 
 
-//   constexpr bool starts_with(const CharT *x) const;
+//   constexpr bool ends_with(const CharT *x) const;
 
 #include 
 #include 



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


[llvm-branch-commits] [libcxxabi] 3b62506 - [libc++] [libc++abi] Use C++20 standard.

2020-11-22 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-22T15:57:25+01:00
New Revision: 3b625060fc91598d28196e559196bfc7b9a929f9

URL: 
https://github.com/llvm/llvm-project/commit/3b625060fc91598d28196e559196bfc7b9a929f9
DIFF: 
https://github.com/llvm/llvm-project/commit/3b625060fc91598d28196e559196bfc7b9a929f9.diff

LOG: [libc++] [libc++abi] Use C++20 standard.

This change is needed to use char8_t when building libc++.
Using the same standard in libc++abi for coherence.

See https://reviews.llvm.org/D91517.

Reviewed By: ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D91691

Added: 


Modified: 
libcxx/CMakeLists.txt
libcxxabi/src/CMakeLists.txt

Removed: 




diff  --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index dd4c93b59d33..f4c7e9992f71 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -514,11 +514,11 @@ remove_flags(-Wno-pedantic -pedantic-errors -pedantic)
 # Required flags ==
 function(cxx_add_basic_build_flags target)
 
-  # Require C++17 for all targets. C++17 is needed to use aligned allocation
-  # in the dylib.
+  # Require C++20 for all targets. C++17 is needed to use aligned allocation
+  # in the dylib. C++20 is needed to use char8_t.
   set_target_properties(${target} PROPERTIES
-CXX_STANDARD 17
-CXX_STANDARD_REQUIRED YES
+CXX_STANDARD 20
+CXX_STANDARD_REQUIRED NO
 CXX_EXTENSIONS NO)
 
   # When building the dylib, don't warn for unavailable aligned allocation

diff  --git a/libcxxabi/src/CMakeLists.txt b/libcxxabi/src/CMakeLists.txt
index 7353c2086b94..a8e12aa36e64 100644
--- a/libcxxabi/src/CMakeLists.txt
+++ b/libcxxabi/src/CMakeLists.txt
@@ -174,9 +174,9 @@ if (LIBCXXABI_ENABLE_SHARED)
   CXX_EXTENSIONS
 OFF
   CXX_STANDARD
-17
+20
   CXX_STANDARD_REQUIRED
-ON
+OFF
   COMPILE_FLAGS
 "${LIBCXXABI_COMPILE_FLAGS}"
   LINK_FLAGS
@@ -241,9 +241,9 @@ if (LIBCXXABI_ENABLE_STATIC)
   CXX_EXTENSIONS
 OFF
   CXX_STANDARD
-17
+20
   CXX_STANDARD_REQUIRED
-ON
+OFF
   COMPILE_FLAGS
 "${LIBCXXABI_COMPILE_FLAGS}"
   LINK_FLAGS



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


[llvm-branch-commits] [libcxx] de212de - [libc++] [www] Mark P0482 as "In Progress", as some parts of it are already implemented.

2020-11-23 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-23T09:10:20+01:00
New Revision: de212de22edc5ce9786c1814c829fefcd94ab564

URL: 
https://github.com/llvm/llvm-project/commit/de212de22edc5ce9786c1814c829fefcd94ab564
DIFF: 
https://github.com/llvm/llvm-project/commit/de212de22edc5ce9786c1814c829fefcd94ab564.diff

LOG: [libc++] [www] Mark P0482 as "In Progress", as some parts of it are 
already implemented.

Added: 


Modified: 
libcxx/www/cxx2a_status.html

Removed: 




diff  --git a/libcxx/www/cxx2a_status.html b/libcxx/www/cxx2a_status.html
index f0d1acfccdf5..f90714493f8f 100644
--- a/libcxx/www/cxx2a_status.html
+++ b/libcxx/www/cxx2a_status.html
@@ -72,7 +72,7 @@ Paper Status
https://wg21.link/P0768R1";>P0768R1CWGLibrary 
Support for the Spaceship (Comparison) 
OperatorAlbuquerqueComplete
https://wg21.link/P0777R1";>P0777R1LWGTreating 
Unnecessary 
decayAlbuquerqueComplete7.0
https://wg21.link/P0122R7";>P0122R7LWGJacksonvilleComplete7.0
-   https://wg21.link/P0355R7";>P0355R7LWGExtending 
chrono to Calendars and Time ZonesJacksonvilleIn 
progress
+   https://wg21.link/P0355R7";>P0355R7LWGExtending 
chrono to Calendars and Time ZonesJacksonvilleIn 
Progress
https://wg21.link/P0551R3";>P0551R3LWGThou Shalt Not 
Specialize std Function 
Templates!JacksonvilleComplete11.0
https://wg21.link/P0753R2";>P0753R2LWGManipulators 
for C++ Synchronized Buffered 
OstreamJacksonville
https://wg21.link/P0754R2";>P0754R2LWGJacksonvilleComplete7.0
@@ -101,7 +101,7 @@ Paper Status
https://wg21.link/P0892R2";>P0892R2CWGexplicit(bool)Rapperswil
https://wg21.link/P0898R3";>P0898R3LWGStandard 
Library ConceptsRapperswil
https://wg21.link/P0935R0";>P0935R0LWGEradicating 
unnecessarily explicit default constructors from the standard 
libraryRapperswil
-   https://wg21.link/P0941R2";>P0941R2CWGIntegrating 
feature-test macros into the C++ WDRapperswilIn 
progress
+   https://wg21.link/P0941R2";>P0941R2CWGIntegrating 
feature-test macros into the C++ WDRapperswilIn 
Progress
https://wg21.link/P1023R0";>P1023R0LWGconstexpr 
comparison operators for 
std::arrayRapperswilComplete8.0
https://wg21.link/P1025R1";>P1025R1CWGUpdate The 
Reference To The Unicode StandardRapperswil
https://wg21.link/P1120R0";>P1120R0CWGConsistency 
improvements for <=> and other comparison 
operatorsRapperswil
@@ -110,7 +110,7 @@ Paper Status
https://wg21.link/P0318R1";>P0318R1LWGunwrap_ref_decay
 and unwrap_referenceSan DiegoComplete8.0
https://wg21.link/P0356R5";>P0356R5LWGSimplified 
partial function applicationSan Diego 

https://wg21.link/P0357R3";>P0357R3LWGreference_wrapper
 for incomplete typesSan DiegoComplete8.0
-   https://wg21.link/P0482R6";>P0482R6CWGchar8_t: A 
type for UTF-8 characters and stringsSan Diego 

+   https://wg21.link/P0482R6";>P0482R6CWGchar8_t: A 
type for UTF-8 characters and stringsSan DiegoIn 
Progress
https://wg21.link/P0487R1";>P0487R1LWGFixing 
operator>>(basic_istream&, CharT*) (LWG 2499)San 
DiegoComplete8.0
https://wg21.link/P0591R4";>P0591R4LWGUtility 
functions to implement uses-allocator constructionSan 
Diego 
https://wg21.link/P0595R2";>P0595R2CWGP0595R2 
std::is_constant_evaluated()San 
DiegoComplete9.0
@@ -182,7 +182,7 @@ Paper Status
https://wg21.link/P1522";>P1522LWGIterator 
Difference Type and Integer OverflowCologne
https://wg21.link/P1523";>P1523LWGViews and Size 
TypesCologne
https://wg21.link/P1612";>P1612LWGRelocate Endian’s 
SpecificationCologneComplete10.0
-   https://wg21.link/P1614";>P1614LWGThe Mothership has 
LandedCologneIn progress
+   https://wg21.link/P1614";>P1614LWGThe Mothership has 
LandedCologneIn Progress
https://wg21.link/P1638";>P1638LWGbasic_istream_view::iterator
 should not be copyableCologne
https://wg21.link/P1643";>P1643LWGAdd wait/notify to 
atomic_refCologne
https://wg21.link/P1644";>P1644LWGAdd wait/notify to 
atomicCologne



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


[llvm-branch-commits] [libcxx] 209e59d - [libc++] Mark a few tests as unsupported on gcc-7.

2020-11-25 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-25T14:14:30+01:00
New Revision: 209e59d7b2b94e1809060e762a825ae8eb437272

URL: 
https://github.com/llvm/llvm-project/commit/209e59d7b2b94e1809060e762a825ae8eb437272
DIFF: 
https://github.com/llvm/llvm-project/commit/209e59d7b2b94e1809060e762a825ae8eb437272.diff

LOG: [libc++] Mark a few tests as unsupported on gcc-7.

Added: 


Modified: 

libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp

libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp

Removed: 




diff  --git 
a/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
 
b/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
index 1fa2ee0efb1b..aa4c4559696c 100644
--- 
a/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
+++ 
b/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
@@ -8,6 +8,7 @@
 
 // 
 // UNSUPPORTED: c++03, c++11, c++14
+// UNSUPPORTED: gcc-7
 // XFAIL: libcpp-no-deduction-guides
 
 // template

diff  --git 
a/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
 
b/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
index 07c9002b5b7d..d7a8868977c8 100644
--- 
a/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
+++ 
b/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
@@ -8,6 +8,7 @@
 
 // 
 // UNSUPPORTED: c++03, c++11, c++14
+// UNSUPPORTED: gcc-7
 // XFAIL: libcpp-no-deduction-guides
 
 // template



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


[llvm-branch-commits] [libcxx] b2b21a2 - Fix gcc warnings: -Wsign-compare, -Wparentheses.

2020-11-25 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-25T14:38:54+01:00
New Revision: b2b21a20e7bf72117bd3fe5895012016172da213

URL: 
https://github.com/llvm/llvm-project/commit/b2b21a20e7bf72117bd3fe5895012016172da213
DIFF: 
https://github.com/llvm/llvm-project/commit/b2b21a20e7bf72117bd3fe5895012016172da213.diff

LOG: Fix gcc warnings: -Wsign-compare, -Wparentheses.

Added: 


Modified: 
libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
libcxx/test/support/filesystem_test_helper.h

Removed: 




diff  --git a/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp 
b/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
index 1bc1500ea6a7..2ca5ec4482bf 100644
--- a/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
+++ b/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
@@ -40,12 +40,12 @@ void test_access() {
 assert(a[0] % b[0] == 42 % 4);
 assert(a[0] << b[0] == (42 << 4));
 assert(a[0] >> b[0] == (42 >> 4));
-assert(a[0] < b[0] == false);
-assert(a[0] <= b[0] == false);
-assert(a[0] > b[0] == true);
-assert(a[0] >= b[0] == true);
-assert(a[0] == b[0] == false);
-assert(a[0] != b[0] == true);
+assert((a[0] < b[0]) == false);
+assert((a[0] <= b[0]) == false);
+assert((a[0] > b[0]) == true);
+assert((a[0] >= b[0]) == true);
+assert((a[0] == b[0]) == false);
+assert((a[0] != b[0]) == true);
 assert((a[0] & b[0]) == (42 & 4));
 assert((a[0] | b[0]) == (42 | 4));
 assert((a[0] ^ b[0]) == (42 ^ 4));
@@ -198,12 +198,12 @@ void test_access() {
 assert(a[0] % b[0] == 42 % 4);
 assert(a[0] << b[0] == (42 << 4));
 assert(a[0] >> b[0] == (42 >> 4));
-assert(a[0] < b[0] == false);
-assert(a[0] <= b[0] == false);
-assert(a[0] > b[0] == true);
-assert(a[0] >= b[0] == true);
-assert(a[0] == b[0] == false);
-assert(a[0] != b[0] == true);
+assert((a[0] < b[0]) == false);
+assert((a[0] <= b[0]) == false);
+assert((a[0] > b[0]) == true);
+assert((a[0] >= b[0]) == true);
+assert((a[0] == b[0]) == false);
+assert((a[0] != b[0]) == true);
 assert((a[0] & b[0]) == (42 & 4));
 assert((a[0] | b[0]) == (42 | 4));
 assert((a[0] ^ b[0]) == (42 ^ 4));

diff  --git a/libcxx/test/support/filesystem_test_helper.h 
b/libcxx/test/support/filesystem_test_helper.h
index 840c6aa3ce51..ad7ade3a1a58 100644
--- a/libcxx/test/support/filesystem_test_helper.h
+++ b/libcxx/test/support/filesystem_test_helper.h
@@ -184,7 +184,9 @@ struct scoped_test_env
 
 filename = sanitize_path(std::move(filename));
 
-if (size > std::numeric_limits::max()) {
+if (size >
+static_cast::type>(
+std::numeric_limits::max())) {
 fprintf(stderr, "create_file(%s, %ju) too large\n",
 filename.c_str(), size);
 abort();



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


[llvm-branch-commits] [libcxxabi] 8334bca - [libc++abi] Fix gcc warnings: -Wpragmas.

2020-11-25 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-25T14:59:17+01:00
New Revision: 8334bcac61c8b63a1f8e047cc7b56ab087548816

URL: 
https://github.com/llvm/llvm-project/commit/8334bcac61c8b63a1f8e047cc7b56ab087548816
DIFF: 
https://github.com/llvm/llvm-project/commit/8334bcac61c8b63a1f8e047cc7b56ab087548816.diff

LOG: [libc++abi] Fix gcc warnings: -Wpragmas.

Added: 


Modified: 
libcxxabi/test/dynamic_cast.pass.cpp
libcxxabi/test/dynamic_cast3.pass.cpp
libcxxabi/test/dynamic_cast5.pass.cpp
libcxxabi/test/unwind_06.pass.cpp

Removed: 




diff  --git a/libcxxabi/test/dynamic_cast.pass.cpp 
b/libcxxabi/test/dynamic_cast.pass.cpp
index 49ecddb4177b..69f5dc3aa8b6 100644
--- a/libcxxabi/test/dynamic_cast.pass.cpp
+++ b/libcxxabi/test/dynamic_cast.pass.cpp
@@ -12,7 +12,7 @@
 // bases.
 #if defined(__clang__)
 #   pragma clang diagnostic ignored "-Winaccessible-base"
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) && (__GNUC__ >= 10)
 #   pragma GCC diagnostic ignored "-Winaccessible-base"
 #endif
 

diff  --git a/libcxxabi/test/dynamic_cast3.pass.cpp 
b/libcxxabi/test/dynamic_cast3.pass.cpp
index 9c25cac865b9..2eefafa2b42b 100644
--- a/libcxxabi/test/dynamic_cast3.pass.cpp
+++ b/libcxxabi/test/dynamic_cast3.pass.cpp
@@ -13,7 +13,7 @@
 // bases.
 #if defined(__clang__)
 #   pragma clang diagnostic ignored "-Winaccessible-base"
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) && (__GNUC__ >= 10)
 #   pragma GCC diagnostic ignored "-Winaccessible-base"
 #endif
 

diff  --git a/libcxxabi/test/dynamic_cast5.pass.cpp 
b/libcxxabi/test/dynamic_cast5.pass.cpp
index 0a9689c23d6b..7fdf106aae5b 100644
--- a/libcxxabi/test/dynamic_cast5.pass.cpp
+++ b/libcxxabi/test/dynamic_cast5.pass.cpp
@@ -13,7 +13,7 @@
 // bases.
 #if defined(__clang__)
 #   pragma clang diagnostic ignored "-Winaccessible-base"
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) && (__GNUC__ >= 10)
 #   pragma GCC diagnostic ignored "-Winaccessible-base"
 #endif
 

diff  --git a/libcxxabi/test/unwind_06.pass.cpp 
b/libcxxabi/test/unwind_06.pass.cpp
index 0c34c4949376..f8e9f8953aa9 100644
--- a/libcxxabi/test/unwind_06.pass.cpp
+++ b/libcxxabi/test/unwind_06.pass.cpp
@@ -14,7 +14,7 @@
 #include 
 
 // Suppress diagnostics about deprecated volatile operations
-#if defined(__GNUC__) && !defined(__clang__)
+#if defined(__GNUC__) && (__GNUC__ >= 10) && !defined(__clang__)
 # pragma GCC diagnostic ignored "-Wvolatile"
 #endif
 



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


[llvm-branch-commits] [libcxxabi] 7a0bc89 - [libc++abi] Mark a few tests as XFAIL on gcc-7, gcc-8, gcc-9 (they were probably never tested anyway, gcc-10 passes them).

2020-11-25 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-25T15:21:20+01:00
New Revision: 7a0bc898f599b92dc6bfd596cdfa50cf58a5d9c9

URL: 
https://github.com/llvm/llvm-project/commit/7a0bc898f599b92dc6bfd596cdfa50cf58a5d9c9
DIFF: 
https://github.com/llvm/llvm-project/commit/7a0bc898f599b92dc6bfd596cdfa50cf58a5d9c9.diff

LOG: [libc++abi] Mark a few tests as XFAIL on gcc-7, gcc-8, gcc-9 (they were 
probably never tested anyway, gcc-10 passes them).

Added: 


Modified: 
libcxxabi/test/dynamic_cast.pass.cpp
libcxxabi/test/dynamic_cast3.pass.cpp
libcxxabi/test/dynamic_cast5.pass.cpp

Removed: 




diff  --git a/libcxxabi/test/dynamic_cast.pass.cpp 
b/libcxxabi/test/dynamic_cast.pass.cpp
index 69f5dc3aa8b6..c1a5980d552b 100644
--- a/libcxxabi/test/dynamic_cast.pass.cpp
+++ b/libcxxabi/test/dynamic_cast.pass.cpp
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+// XFAIL: gcc-7, gcc-8, gcc-9
+
 #include 
 
 // This test explicitly tests dynamic cast with types that have inaccessible

diff  --git a/libcxxabi/test/dynamic_cast3.pass.cpp 
b/libcxxabi/test/dynamic_cast3.pass.cpp
index 2eefafa2b42b..2364f4c1b5bd 100644
--- a/libcxxabi/test/dynamic_cast3.pass.cpp
+++ b/libcxxabi/test/dynamic_cast3.pass.cpp
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+// XFAIL: gcc-7, gcc-8, gcc-9
+
 #include 
 #include "support/timer.h"
 

diff  --git a/libcxxabi/test/dynamic_cast5.pass.cpp 
b/libcxxabi/test/dynamic_cast5.pass.cpp
index 7fdf106aae5b..357bb804766e 100644
--- a/libcxxabi/test/dynamic_cast5.pass.cpp
+++ b/libcxxabi/test/dynamic_cast5.pass.cpp
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+// XFAIL: gcc-7, gcc-8, gcc-9
+
 #include 
 #include "support/timer.h"
 



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


[llvm-branch-commits] [libcxx] dde0fcd - [libc++] [libc++abi] Mark a few tests as unsupported/xfail on gcc-7/8/9.

2020-11-26 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-26T08:59:52+01:00
New Revision: dde0fcd7a7da4066c18ab5e73e0477e856da158f

URL: 
https://github.com/llvm/llvm-project/commit/dde0fcd7a7da4066c18ab5e73e0477e856da158f
DIFF: 
https://github.com/llvm/llvm-project/commit/dde0fcd7a7da4066c18ab5e73e0477e856da158f.diff

LOG: [libc++] [libc++abi] Mark a few tests as unsupported/xfail on gcc-7/8/9.

This should make the builder http://lab.llvm.org:8011/#/builders/101/ happy.
It uses gcc-9 and not Tip-Of-Trunk as its name indicates BTW.
GCC-10 passes all these tests.

Fix gcc warnings: -Wsign-compare, -Wparentheses, -Wpragmas.

Reviewed By: ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D92099

Added: 


Modified: 
libcxx/test/std/experimental/simd/simd.access/default.pass.cpp

libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp

libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
libcxx/test/support/filesystem_test_helper.h
libcxxabi/test/dynamic_cast.pass.cpp
libcxxabi/test/dynamic_cast3.pass.cpp
libcxxabi/test/dynamic_cast5.pass.cpp
libcxxabi/test/unwind_06.pass.cpp

Removed: 




diff  --git a/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp 
b/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
index 1bc1500ea6a7..2ca5ec4482bf 100644
--- a/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
+++ b/libcxx/test/std/experimental/simd/simd.access/default.pass.cpp
@@ -40,12 +40,12 @@ void test_access() {
 assert(a[0] % b[0] == 42 % 4);
 assert(a[0] << b[0] == (42 << 4));
 assert(a[0] >> b[0] == (42 >> 4));
-assert(a[0] < b[0] == false);
-assert(a[0] <= b[0] == false);
-assert(a[0] > b[0] == true);
-assert(a[0] >= b[0] == true);
-assert(a[0] == b[0] == false);
-assert(a[0] != b[0] == true);
+assert((a[0] < b[0]) == false);
+assert((a[0] <= b[0]) == false);
+assert((a[0] > b[0]) == true);
+assert((a[0] >= b[0]) == true);
+assert((a[0] == b[0]) == false);
+assert((a[0] != b[0]) == true);
 assert((a[0] & b[0]) == (42 & 4));
 assert((a[0] | b[0]) == (42 | 4));
 assert((a[0] ^ b[0]) == (42 ^ 4));
@@ -198,12 +198,12 @@ void test_access() {
 assert(a[0] % b[0] == 42 % 4);
 assert(a[0] << b[0] == (42 << 4));
 assert(a[0] >> b[0] == (42 >> 4));
-assert(a[0] < b[0] == false);
-assert(a[0] <= b[0] == false);
-assert(a[0] > b[0] == true);
-assert(a[0] >= b[0] == true);
-assert(a[0] == b[0] == false);
-assert(a[0] != b[0] == true);
+assert((a[0] < b[0]) == false);
+assert((a[0] <= b[0]) == false);
+assert((a[0] > b[0]) == true);
+assert((a[0] >= b[0]) == true);
+assert((a[0] == b[0]) == false);
+assert((a[0] != b[0]) == true);
 assert((a[0] & b[0]) == (42 & 4));
 assert((a[0] | b[0]) == (42 | 4));
 assert((a[0] ^ b[0]) == (42 ^ 4));

diff  --git 
a/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
 
b/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
index 1fa2ee0efb1b..aa4c4559696c 100644
--- 
a/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
+++ 
b/libcxx/test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp
@@ -8,6 +8,7 @@
 
 // 
 // UNSUPPORTED: c++03, c++11, c++14
+// UNSUPPORTED: gcc-7
 // XFAIL: libcpp-no-deduction-guides
 
 // template

diff  --git 
a/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
 
b/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
index 07c9002b5b7d..d7a8868977c8 100644
--- 
a/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
+++ 
b/libcxx/test/std/strings/basic.string/string.cons/string_view_size_size_deduction.fail.cpp
@@ -8,6 +8,7 @@
 
 // 
 // UNSUPPORTED: c++03, c++11, c++14
+// UNSUPPORTED: gcc-7
 // XFAIL: libcpp-no-deduction-guides
 
 // template

diff  --git a/libcxx/test/support/filesystem_test_helper.h 
b/libcxx/test/support/filesystem_test_helper.h
index 840c6aa3ce51..ad7ade3a1a58 100644
--- a/libcxx/test/support/filesystem_test_helper.h
+++ b/libcxx/test/support/filesystem_test_helper.h
@@ -184,7 +184,9 @@ struct scoped_test_env
 
 filename = sanitize_path(std::move(filename));
 
-if (size > std::numeric_limits::max()) {
+if (size >
+static_cast::type>(
+std::numeric_limits::max())) {
 fprintf(stderr, "create_file(%s, %ju) too large\n",
 filename.c_str(), size);
 abort();

diff  --git a/libcxxabi/test/dynamic_cast.pass.cpp 
b/libcxxabi/test/dynamic_cast.pass.cpp
index 49ecddb4177b..c1a5980d552b 100644
--- a/libcxxabi/test/dynamic_cast.pass.cpp
+++ b/libcxxabi/test/dynamic_cast.pass.cpp
@@ -6,13 +

[llvm-branch-commits] [libcxx] 69d2567 - [libc++] [www] Fix HTML. NFC.

2020-11-26 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-26T09:31:20+01:00
New Revision: 69d25676246d05a10ab0bbee72835e82a962e404

URL: 
https://github.com/llvm/llvm-project/commit/69d25676246d05a10ab0bbee72835e82a962e404
DIFF: 
https://github.com/llvm/llvm-project/commit/69d25676246d05a10ab0bbee72835e82a962e404.diff

LOG: [libc++] [www] Fix HTML. NFC.

Needed for a future automatic update to RST.

Added: 


Modified: 
libcxx/www/cxx1z_status.html
libcxx/www/cxx2a_status.html

Removed: 




diff  --git a/libcxx/www/cxx1z_status.html b/libcxx/www/cxx1z_status.html
index 893af09d2d68..d07c7b45f7ca 100644
--- a/libcxx/www/cxx1z_status.html
+++ b/libcxx/www/cxx1z_status.html
@@ -137,10 +137,10 @@ Paper Status
https://wg21.link/P0504R0";>P0504R0LWGRevisiting 
in-place tag types for 
any/optional/variantIssaquahComplete4.0
https://wg21.link/P0505R0";>P0505R0LWGWording for GB 
50 - constexpr for 
chronoIssaquahComplete4.0
https://wg21.link/P0508R0";>P0508R0LWGWording for GB 
58 - structured bindings for 
node_handlesIssaquah
-   https://wg21.link/P0509R1";>P0509R1LWGUpdating 
“Restrictions on exception handling”IssaquahNothing to 
don/a
+   https://wg21.link/P0509R1";>P0509R1LWGUpdating 
"Restrictions on exception handling"IssaquahNothing to 
don/a
https://wg21.link/P0510R0";>P0510R0LWGDisallowing 
references, incomplete types, arrays, and empty 
variantsIssaquahComplete4.0
https://wg21.link/P0513R0";>P0513R0LWGPoisoning the 
HashIssaquahComplete5.0
-   https://wg21.link/P0516R0";>P0516R0LWGClarify That 
shared_future’s Copy Operations have Wide 
ContractsIssaquahComplete4.0
+   https://wg21.link/P0516R0";>P0516R0LWGClarify That 
shared_future's Copy Operations have Wide 
ContractsIssaquahComplete4.0
https://wg21.link/P0517R0";>P0517R0LWGMake 
future_error 
ConstructibleIssaquahComplete4.0
https://wg21.link/P0521R0";>P0521R0LWGProposed 
Resolution for CA 14 (shared_ptr 
use_count/unique)IssaquahNothing to 
don/a


diff  --git a/libcxx/www/cxx2a_status.html b/libcxx/www/cxx2a_status.html
index bd112d8573bb..9a086549b695 100644
--- a/libcxx/www/cxx2a_status.html
+++ b/libcxx/www/cxx2a_status.html
@@ -158,7 +158,7 @@ Paper Status
 

https://wg21.link/P0325";>P0325LWGto_array from LFTS 
with updatesCologneComplete10.0
-   https://wg21.link/P0408";>P0408LWGEfficient Access 
to basic_stringbuf ’s BufferCologne
+   https://wg21.link/P0408";>P0408LWGEfficient Access 
to basic_stringbuf's BufferCologne
https://wg21.link/P0466";>P0466LWGLayout-compatibility
 and Pointer-interconvertibility 
TraitsCologne
https://wg21.link/P0553";>P0553LWGBit 
operationsCologneComplete9.0
https://wg21.link/P0631";>P0631LWGMath 
ConstantsCologneComplete11.0
@@ -181,7 +181,7 @@ Paper Status
https://wg21.link/P1502";>P1502LWGStandard library 
header units for C++20Cologne
https://wg21.link/P1522";>P1522LWGIterator 
Difference Type and Integer OverflowCologne
https://wg21.link/P1523";>P1523LWGViews and Size 
TypesCologne
-   https://wg21.link/P1612";>P1612LWGRelocate Endian’s 
SpecificationCologneComplete10.0
+   https://wg21.link/P1612";>P1612LWGRelocate Endian's 
SpecificationCologneComplete10.0
https://wg21.link/P1614";>P1614LWGThe Mothership has 
LandedCologneIn Progress
https://wg21.link/P1638";>P1638LWGbasic_istream_view::iterator
 should not be copyableCologne
https://wg21.link/P1643";>P1643LWGAdd wait/notify to 
atomic_refCologne
@@ -222,7 +222,7 @@ Paper Status
https://wg21.link/P1959";>P1959LWGRemove 
std::weak_equality and std::strong_equalityBelfast 

https://wg21.link/P1960";>P1960LWGNB Comment Changes 
Reviewed by SG1Belfast 
https://wg21.link/P1961";>P1961LWGHarmonizing the 
definitions of total order for pointersBelfast 

-   https://wg21.link/P1965";>P1965LWGBlanket Wording 
for Specifying “Hidden Friends”Belfast 

+   https://wg21.link/P1965";>P1965LWGBlanket Wording 
for Specifying "Hidden Friends"Belfast 

 

https://wg21.link/P0586";>P0586LWGSafe integral 
comparisonsPrague 
@@ -467,7 +467,7 @@ Library Working group Issues Status
https://wg21.link/LWG3277";>3277Pre-increment on prvalues is 
not a requirement of 
weakly_incrementableBelfast
https://wg21.link/LWG3149";>3149DefaultConstructible 
should require default initializationBelfast
 
--->
+   
https://wg21.link/LWG1203";>1203More 
useful rvalue stream insertionPrague12.0
https://wg21.link/LWG2859";>2859Definition 
of reachable in [ptr.launder] misses pointer arithmetic from 
pointer-interconvertible objectPrague
https://wg21.link/LWG3018";>3018shared_ptr of 
function typePrague



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.

[llvm-branch-commits] [libcxx] 841132e - [libc++] [P0966] [C++20] Fix bug PR45368 by correctly implementing P0966: string::reserve should not shrink.

2020-11-26 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-26T10:13:12+01:00
New Revision: 841132efda2157c5f9e07cf31469470a6481ffd9

URL: 
https://github.com/llvm/llvm-project/commit/841132efda2157c5f9e07cf31469470a6481ffd9
DIFF: 
https://github.com/llvm/llvm-project/commit/841132efda2157c5f9e07cf31469470a6481ffd9.diff

LOG: [libc++] [P0966] [C++20] Fix bug PR45368 by correctly implementing P0966: 
string::reserve should not shrink.

This patch fixes the implementation as well as the tests that didn't actually 
test the wanted behaviour.
You'll find all the details in the bug report.
It adds as well deprecation warning for reserve() (without argument) and adds a 
test.

http://wg21.link/P0966R1
https://bugs.llvm.org/show_bug.cgi?id=45368
https://reviews.llvm.org/D54992

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D91778

Added: 
libcxx/test/libcxx/strings/basic.string/string.capacity/reserve.pass.cpp

libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp
libcxx/test/std/strings/basic.string/string.capacity/reserve_size.pass.cpp

Modified: 
libcxx/docs/Cxx2aStatus.rst
libcxx/docs/Cxx2aStatusPaperStatus.csv
libcxx/include/__config
libcxx/include/string
libcxx/test/std/strings/basic.string/string.capacity/reserve.pass.cpp

Removed: 




diff  --git a/libcxx/docs/Cxx2aStatus.rst b/libcxx/docs/Cxx2aStatus.rst
index 562250cebd9b..4fd4e356710f 100644
--- a/libcxx/docs/Cxx2aStatus.rst
+++ b/libcxx/docs/Cxx2aStatus.rst
@@ -40,6 +40,7 @@ Paper Status
 
.. [#note-P0202] P0202: The missing bits in P0202 are in ``copy`` and 
``copy_backwards`` (and the ones that call them: ``copy_n``, ``set_union``, 
``set_
diff erence``, and ``set_symmetric_
diff erence``). This is because the first two algorithms have specializations 
that call ``memmove`` which is not constexpr. See `Bug 25165 
`__
.. [#note-P0600] P0600: The missing bits in P0600 are in |sect|\ 
[mem.res.class], |sect|\ [mem.poly.allocator.class], and |sect|\ 
[container.node.overview].
+   .. [#note-P0966] P0966: It was previously erroneously marked as complete in 
version 8.0. See `bug 45368 `__.
 
.. [#note-P0619] P0619: Only ``std::allocator`` part is implemented.
 

diff  --git a/libcxx/docs/Cxx2aStatusPaperStatus.csv 
b/libcxx/docs/Cxx2aStatusPaperStatus.csv
index ee7acab20ba2..cf476c87a130 100644
--- a/libcxx/docs/Cxx2aStatusPaperStatus.csv
+++ b/libcxx/docs/Cxx2aStatusPaperStatus.csv
@@ -24,7 +24,7 @@
 "`P0809R0 `__","LWG","Comparing Unordered 
Containers","Jacksonville","",""
 "`P0858R0 `__","LWG","Constexpr iterator 
requirements","Jacksonville","",""
 "`P0905R1 `__","CWG","Symmetry for 
spaceship","Jacksonville","",""
-"`P0966R1 `__","LWG","``string::reserve``\  Should 
Not Shrink","Jacksonville","|Complete|","8.0"
+"`P0966R1 `__","LWG","``string::reserve``\  Should 
Not Shrink","Jacksonville","|Complete| [#note-P0966]_","12.0"
 "","","","","",""
 "`P0019R8 `__","LWG","Atomic Ref","Rapperswil","",""
 "`P0458R2 `__","LWG","Checking for Existence of an 
Element in Associative Containers","Rapperswil","|Complete|",""

diff  --git a/libcxx/include/__config b/libcxx/include/__config
index 069fc4193b53..de40ffc3162e 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -991,6 +991,12 @@ typedef unsigned int   char32_t;
 #  define _LIBCPP_DEPRECATED_IN_CXX17
 #endif
 
+#if _LIBCPP_STD_VER > 17
+#  define _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_DEPRECATED
+#else
+#  define _LIBCPP_DEPRECATED_IN_CXX20
+#endif
+
 // Macros to enter and leave a state where deprecation warnings are suppressed.
 #if !defined(_LIBCPP_SUPPRESS_DEPRECATED_PUSH) && \
 (defined(_LIBCPP_COMPILER_CLANG) || defined(_LIBCPP_COMPILER_GCC))

diff  --git a/libcxx/include/string b/libcxx/include/string
index 9f7a2a9e5cb0..d3e53592f5f1 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -153,7 +153,8 @@ public:
 void resize(size_type n, value_type c);
 void resize(size_type n);
 
-void reserve(size_type res_arg = 0);
+void reserve(size_type res_arg);
+void reserve(); // deprecated in C++20
 void shrink_to_fit();
 void clear() noexcept;
 bool empty() const noexcept;
@@ -954,13 +955,13 @@ public:
 void resize(size_type __n, value_type __c);
 _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, 
value_type());}
 
-void reserve(size_type __res_arg);
+void reserve(size_type __requested_capacity);
 _LIBCPP_INLINE_VISIBILITY void __resize_default_init(size_type __n);
 
+_LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_INLINE_VISIBILITY
+void reserve() _NOEXCEPT {shrink_to_fit();}
 _LI

[llvm-branch-commits] [libcxx] 8db009d - [libc++] Fix gcc warning -Wsign-compare.

2020-11-26 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-26T10:20:09+01:00
New Revision: 8db009d273676ef4c20254b75f8f8b54dca44d38

URL: 
https://github.com/llvm/llvm-project/commit/8db009d273676ef4c20254b75f8f8b54dca44d38
DIFF: 
https://github.com/llvm/llvm-project/commit/8db009d273676ef4c20254b75f8f8b54dca44d38.diff

LOG: [libc++] Fix gcc warning -Wsign-compare.

Added: 


Modified: 
libcxx/test/support/filesystem_test_helper.h

Removed: 




diff  --git a/libcxx/test/support/filesystem_test_helper.h 
b/libcxx/test/support/filesystem_test_helper.h
index ad7ade3a1a58..81366580db89 100644
--- a/libcxx/test/support/filesystem_test_helper.h
+++ b/libcxx/test/support/filesystem_test_helper.h
@@ -185,7 +185,7 @@ struct scoped_test_env
 filename = sanitize_path(std::move(filename));
 
 if (size >
-static_cast::type>(
+static_cast::type>(
 std::numeric_limits::max())) {
 fprintf(stderr, "create_file(%s, %ju) too large\n",
 filename.c_str(), size);



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


[llvm-branch-commits] [llvm] d8ffb1f - [llvm-profgen] [docs] Fix invalid header. Add to ToC. NFC.

2020-11-26 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-26T10:45:05+01:00
New Revision: d8ffb1f6a7572b64d5fa6b821c5c143e0e90bb6d

URL: 
https://github.com/llvm/llvm-project/commit/d8ffb1f6a7572b64d5fa6b821c5c143e0e90bb6d
DIFF: 
https://github.com/llvm/llvm-project/commit/d8ffb1f6a7572b64d5fa6b821c5c143e0e90bb6d.diff

LOG: [llvm-profgen] [docs] Fix invalid header. Add to ToC. NFC.

Added: 


Modified: 
llvm/docs/CommandGuide/index.rst
llvm/docs/CommandGuide/llvm-profgen.rst

Removed: 




diff  --git a/llvm/docs/CommandGuide/index.rst 
b/llvm/docs/CommandGuide/index.rst
index f822be96ceb0..f6a1fa970642 100644
--- a/llvm/docs/CommandGuide/index.rst
+++ b/llvm/docs/CommandGuide/index.rst
@@ -74,5 +74,6 @@ Developer Tools
tblgen
lit
llvm-exegesis
-   llvm-pdbutil
llvm-locstats
+   llvm-pdbutil
+   llvm-profgen

diff  --git a/llvm/docs/CommandGuide/llvm-profgen.rst 
b/llvm/docs/CommandGuide/llvm-profgen.rst
index 5197b2318e95..d9f9692f6011 100644
--- a/llvm/docs/CommandGuide/llvm-profgen.rst
+++ b/llvm/docs/CommandGuide/llvm-profgen.rst
@@ -1,5 +1,5 @@
 llvm-profgen - LLVM SPGO profile generation tool
-=
+
 
 .. program:: llvm-profgen
 



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


[llvm-branch-commits] [libcxx] 5641b1d - [libc++] Mark a few more tests as unsupported on gcc-8/9.

2020-11-26 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-26T12:40:50+01:00
New Revision: 5641b1dfddff847f7f3edc484537f9314c283225

URL: 
https://github.com/llvm/llvm-project/commit/5641b1dfddff847f7f3edc484537f9314c283225
DIFF: 
https://github.com/llvm/llvm-project/commit/5641b1dfddff847f7f3edc484537f9314c283225.diff

LOG: [libc++] Mark a few more tests as unsupported on gcc-8/9.

This will fix remaining failures on gcc-9 buildbot: 
http://lab.llvm.org:8011/#/builders/101.
gcc-8 and gcc-9 do not support constexpr destructors nor constexpr allocation.

Fix gcc warnings: -Wconversion, -Wpragmas.

Added: 


Modified: 

libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp

libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp

libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp

libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp

libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp

libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp

libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy.pass.cpp

libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_at.pass.cpp

libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_n.pass.cpp

libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
libcxxabi/src/demangle/Utility.h

Removed: 




diff  --git 
a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp
 
b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp
index ab354f42a1d8..e42277828750 100644
--- 
a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp
+++ 
b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.pass.cpp
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+// UNSUPPORTED: gcc-8, gcc-9
+
 // 
 
 // template 

diff  --git 
a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp
 
b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp
index 5cdb5e070bed..0960285ed543 100644
--- 
a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp
+++ 
b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate_hint.pass.cpp
@@ -7,6 +7,7 @@
 
//===--===//
 
 // UNSUPPORTED: clang-8
+// UNSUPPORTED: gcc-8, gcc-9
 
 // 
 

diff  --git 
a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp
 
b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp
index a3465ff22d66..6015a6150b4b 100644
--- 
a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp
+++ 
b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/construct.pass.cpp
@@ -7,6 +7,7 @@
 
//===--===//
 
 // UNSUPPORTED: clang-8
+// UNSUPPORTED: gcc-8, gcc-9
 
 // 
 

diff  --git 
a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp
 
b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp
index 2f153eedc6fc..a23345942db7 100644
--- 
a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp
+++ 
b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/deallocate.pass.cpp
@@ -6,6 +6,8 @@
 //
 
//===--===//
 
+// UNSUPPORTED: gcc-8, gcc-9
+
 // 
 
 // template 

diff  --git 
a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp
 
b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp
index 6d7b0bd5c44c..e85813b3ebf2 100644
--- 
a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp
+++ 
b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/destroy.pass.cpp
@@ -7,6 +7,8 @@
 
//===--===//
 
 // UNSUPPORTED: clang-8
+// constexpr destructors are only supported starting with gcc 10
+// UNSUPPORTED: gcc-8, gcc-9
 
 // 
 

diff  --git 
a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.pass.cpp
 
b/libcxx/test/std/utilities/memory/default.al

[llvm-branch-commits] [libcxx] b215198 - [libc++] [docs] Exclude helper files from Sphinx configuration to avoid generating empty pages.

2020-11-27 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-11-27T13:47:20+01:00
New Revision: b215198bb05b4274800ac6e97f4f27319227cade

URL: 
https://github.com/llvm/llvm-project/commit/b215198bb05b4274800ac6e97f4f27319227cade
DIFF: 
https://github.com/llvm/llvm-project/commit/b215198bb05b4274800ac6e97f4f27319227cade.diff

LOG: [libc++] [docs] Exclude helper files from Sphinx configuration to avoid 
generating empty pages.

Added: 
libcxx/docs/Helpers/Styles.rst

Modified: 
libcxx/docs/Cxx1yStatus.rst
libcxx/docs/Cxx1zStatus.rst
libcxx/docs/Cxx2aStatus.rst
libcxx/docs/conf.py

Removed: 
libcxx/docs/Styles.rst



diff  --git a/libcxx/docs/Cxx1yStatus.rst b/libcxx/docs/Cxx1yStatus.rst
index 3cf4938f9770..91744a7eee0c 100644
--- a/libcxx/docs/Cxx1yStatus.rst
+++ b/libcxx/docs/Cxx1yStatus.rst
@@ -4,7 +4,7 @@
 libc++ C++14 Status
 
 
-.. include:: Styles.rst
+.. include:: Helpers/Styles.rst
 
 .. contents::
:local:

diff  --git a/libcxx/docs/Cxx1zStatus.rst b/libcxx/docs/Cxx1zStatus.rst
index efa4d09fad1c..54a1629209a9 100644
--- a/libcxx/docs/Cxx1zStatus.rst
+++ b/libcxx/docs/Cxx1zStatus.rst
@@ -4,7 +4,7 @@
 libc++ C++17 Status
 
 
-.. include:: Styles.rst
+.. include:: Helpers/Styles.rst
 
 .. contents::
:local:

diff  --git a/libcxx/docs/Cxx2aStatus.rst b/libcxx/docs/Cxx2aStatus.rst
index 4fd4e356710f..fc5b779aecc9 100644
--- a/libcxx/docs/Cxx2aStatus.rst
+++ b/libcxx/docs/Cxx2aStatus.rst
@@ -4,7 +4,7 @@
 libc++ C++2a Status
 
 
-.. include:: Styles.rst
+.. include:: Helpers/Styles.rst
 
 .. contents::
:local:

diff  --git a/libcxx/docs/Styles.rst b/libcxx/docs/Helpers/Styles.rst
similarity index 100%
rename from libcxx/docs/Styles.rst
rename to libcxx/docs/Helpers/Styles.rst

diff  --git a/libcxx/docs/conf.py b/libcxx/docs/conf.py
index dee50d46d43b..95cd98bc471c 100644
--- a/libcxx/docs/conf.py
+++ b/libcxx/docs/conf.py
@@ -63,7 +63,7 @@
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-exclude_patterns = ['_build']
+exclude_patterns = ['_build', 'Helpers']
 
 # The reST default role (used for this markup: `text`) to use for all 
documents.
 #default_role = None



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


[llvm-branch-commits] [libcxx] 1c656e9 - [libc++] [docs] Update and move NOTES.txt to docs/Contributing.rst.

2020-12-01 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-02T08:54:11+01:00
New Revision: 1c656e9b64413535bb55259e03f2bc458c69e0de

URL: 
https://github.com/llvm/llvm-project/commit/1c656e9b64413535bb55259e03f2bc458c69e0de
DIFF: 
https://github.com/llvm/llvm-project/commit/1c656e9b64413535bb55259e03f2bc458c69e0de.diff

LOG: [libc++] [docs] Update and move NOTES.txt to docs/Contributing.rst.

Also, add notes about exporting ABI symbols.
Later, we can add notes about using git-clang-format before sending a patch for 
review.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D92300

Added: 
libcxx/docs/Contributing.rst

Modified: 
libcxx/docs/index.rst

Removed: 
libcxx/NOTES.TXT



diff  --git a/libcxx/NOTES.TXT b/libcxx/NOTES.TXT
deleted file mode 100644
index 16366a580f18..
--- a/libcxx/NOTES.TXT
+++ /dev/null
@@ -1,28 +0,0 @@
-//===-===//
-// Notes relating to various libc++ tasks
-//===-===//
-
-This file contains notes about various libc++ tasks and processes.
-
-//===-===//
-// Post-Release TODO
-//===-===//
-
-These notes contain a list of things that must be done after branching for
-an LLVM release.
-
-1. Update _LIBCPP_VERSION in `__config`
-2. Update the __libcpp_version file.
-3. Update the version number in `docs/conf.py`
-
-//===-===//
-// Adding a new header TODO
-//===-===//
-
-These notes contain a list of things that must be done upon adding a new header
-to libc++.
-
-1. Add a test under `test/libcxx` that the header defines `_LIBCPP_VERSION`.
-2. Update `test/libcxx/double_include.sh.cpp` to include the new header.
-3. Create a submodule in `include/module.modulemap` for the new header.
-4. Update the include/CMakeLists.txt file to include the new header.

diff  --git a/libcxx/docs/Contributing.rst b/libcxx/docs/Contributing.rst
new file mode 100644
index ..abbf91fdd702
--- /dev/null
+++ b/libcxx/docs/Contributing.rst
@@ -0,0 +1,46 @@
+.. _ContributingToLibcxx:
+
+==
+Contributing to libc++
+==
+
+.. contents::
+  :local:
+
+Please read `this document `__ on 
general rules to contribute to LLVM projects.
+
+Tasks and processes
+===
+
+This file contains notes about various tasks and processes specific to libc++.
+
+Post-Release TODO
+=
+
+After branching for an LLVM release:
+
+1. Update ``_LIBCPP_VERSION`` in ``include/__config``
+2. Update the ``include/__libcpp_version`` file
+3. Update the version number in ``docs/conf.py``
+
+Adding a new header TODO
+
+
+When adding a new header to libc++:
+
+1. Add a test under ``test/libcxx`` that the new header defines 
``_LIBCPP_VERSION``. See ``test/libcxx/algorithms/version.pass.cpp`` for an 
example.
+2. Update the following test files to include the new header:
+
+  * ``test/libcxx/double_include.sh.cpp``
+  * ``test/libcxx/min_max_macros.compile.pass.cpp``
+  * ``test/libcxx/no_assert_include.compile.pass.cpp``
+
+3. Create a submodule in ``include/module.modulemap`` for the new header.
+4. Update the ``include/CMakeLists.txt`` file to include the new header.
+
+Exporting new symbols from the library
+==
+
+When exporting new symbols from libc++, one must update the ABI lists located 
in ``lib/abi``.
+To test whether the lists are up-to-date, please run the target 
``check-cxx-abilist``.
+To regenerate the lists, use the target ``generate-cxx-abilist``.

diff  --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst
index 926cd102d71f..6b6c7735bf77 100644
--- a/libcxx/docs/index.rst
+++ b/libcxx/docs/index.rst
@@ -38,6 +38,7 @@ Getting Started with libc++
UsingLibcxx
BuildingLibcxx
TestingLibcxx
+   Contributing
Cxx1yStatus
Cxx1zStatus
Cxx2aStatus



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


[llvm-branch-commits] [libcxx] d82fb60 - [libc++] [docs] Mark P1424 as superseded by P1902.

2020-12-02 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-02T11:19:37+01:00
New Revision: d82fb6022bd8406a406722e01658273fdd209e5f

URL: 
https://github.com/llvm/llvm-project/commit/d82fb6022bd8406a406722e01658273fdd209e5f
DIFF: 
https://github.com/llvm/llvm-project/commit/d82fb6022bd8406a406722e01658273fdd209e5f.diff

LOG: [libc++] [docs] Mark P1424 as superseded by P1902.

Added: 


Modified: 
libcxx/docs/Cxx2aStatusPaperStatus.csv

Removed: 




diff  --git a/libcxx/docs/Cxx2aStatusPaperStatus.csv 
b/libcxx/docs/Cxx2aStatusPaperStatus.csv
index 793fc92be5f2..88d5641403f5 100644
--- a/libcxx/docs/Cxx2aStatusPaperStatus.csv
+++ b/libcxx/docs/Cxx2aStatusPaperStatus.csv
@@ -116,7 +116,7 @@
 "`P1355 `__","LWG","Exposing a narrow contract for 
ceil2","Cologne","|Complete|","9.0"
 "`P1361 `__","LWG","Integration of chrono with text 
formatting","Cologne","",""
 "`P1423 `__","LWG","char8_t backward compatibility 
remediation","Cologne","",""
-"`P1424 `__","LWG","'constexpr' feature macro 
concerns","Cologne","",""
+"`P1424 `__","LWG","'constexpr' feature macro 
concerns","Cologne","Superseded by `P1902 `__",""
 "`P1466 `__","LWG","Miscellaneous minor fixes for 
chrono","Cologne","",""
 "`P1474 `__","LWG","Helpful pointers for 
ContiguousIterator","Cologne","",""
 "`P1502 `__","LWG","Standard library header units for 
C++20","Cologne","",""



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


[llvm-branch-commits] [libcxx] 28797e9 - [libc++] [docs] Mark LWG2296 as complete not only on clang.

2020-12-02 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-02T11:39:43+01:00
New Revision: 28797e99522b6c3a520c876ad463acd578bf5f33

URL: 
https://github.com/llvm/llvm-project/commit/28797e99522b6c3a520c876ad463acd578bf5f33
DIFF: 
https://github.com/llvm/llvm-project/commit/28797e99522b6c3a520c876ad463acd578bf5f33.diff

LOG: [libc++] [docs] Mark LWG2296 as complete not only on clang.

std::addressof was made constexpr in gcc 7.
libc++ fixed it in ac473034fc771e5f1b4ef0ac405df70ed27412a1 (Provide a 
constexpr addressof with GCC 7.)

Added: 


Modified: 
libcxx/docs/Cxx1zStatusIssuesStatus.csv

Removed: 




diff  --git a/libcxx/docs/Cxx1zStatusIssuesStatus.csv 
b/libcxx/docs/Cxx1zStatusIssuesStatus.csv
index d5c43103b4bd..218782b0071b 100644
--- a/libcxx/docs/Cxx1zStatusIssuesStatus.csv
+++ b/libcxx/docs/Cxx1zStatusIssuesStatus.csv
@@ -103,7 +103,7 @@
 "","","",""
 "`2192 `__","Validity and return type of 
``std::abs(0u)``\  is unclear","Jacksonville","|Complete|"
 "`2276 `__","Missing requirement on 
``std::promise::set_exception``\ ","Jacksonville","|Complete|"
-"`2296 `__","``std::addressof``\  should be 
``constexpr``\ ","Jacksonville","Complete (Clang Only)"
+"`2296 `__","``std::addressof``\  should be 
``constexpr``\ ","Jacksonville","|Complete|"
 "`2450 
`__","``(greater|less|greater_equal|less_equal)``\
  do not yield a total order for pointers","Jacksonville","|Complete|"
 "`2520 `__","N4089 broke initializing 
``unique_ptr``\  from a ``nullptr``\ ","Jacksonville","|Complete|"
 "`2522 `__","[fund.ts.v2] Contradiction in 
``set_default_resource``\  specification","Jacksonville","|Complete|"



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


[llvm-branch-commits] [libcxx] 590bbfe - [libc++] [docs] Add C++2b (to be C++23) status page.

2020-12-03 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-03T09:22:06+01:00
New Revision: 590bbfe0d804bc79a4d60297a7014a852a385ba9

URL: 
https://github.com/llvm/llvm-project/commit/590bbfe0d804bc79a4d60297a7014a852a385ba9
DIFF: 
https://github.com/llvm/llvm-project/commit/590bbfe0d804bc79a4d60297a7014a852a385ba9.diff

LOG: [libc++] [docs] Add C++2b (to be C++23) status page.

Also:
* Fix header line in all status tables.
* Use C++20 instead of C++2a.

Reviewed By: ldionne, #libc, miscco

Differential Revision: https://reviews.llvm.org/D92306

Added: 
libcxx/docs/Cxx2bStatus.rst
libcxx/docs/Cxx2bStatusPaperStatus.csv

Modified: 
libcxx/docs/Cxx1yStatus.rst
libcxx/docs/Cxx1zStatus.rst
libcxx/docs/Cxx2aStatus.rst
libcxx/docs/index.rst

Removed: 




diff  --git a/libcxx/docs/Cxx1yStatus.rst b/libcxx/docs/Cxx1yStatus.rst
index 91744a7eee0c..87322cc52ac7 100644
--- a/libcxx/docs/Cxx1yStatus.rst
+++ b/libcxx/docs/Cxx1yStatus.rst
@@ -35,6 +35,7 @@ Paper Status
 
 .. csv-table::
:file: Cxx1yStatusPaperStatus.csv
+   :header-rows: 1
:widths: auto
 
 
@@ -45,6 +46,7 @@ Library Working Group Issues Status
 
 .. csv-table::
:file: Cxx1yStatusIssuesStatus.csv
+   :header-rows: 1
:widths: auto
 
 Last Updated: 25-Mar-2014

diff  --git a/libcxx/docs/Cxx1zStatus.rst b/libcxx/docs/Cxx1zStatus.rst
index 54a1629209a9..44284e676fc8 100644
--- a/libcxx/docs/Cxx1zStatus.rst
+++ b/libcxx/docs/Cxx1zStatus.rst
@@ -35,6 +35,7 @@ Paper Status
 
 .. csv-table::
:file: Cxx1zStatusPaperStatus.csv
+   :header-rows: 1
:widths: auto
 
 .. note::
@@ -50,6 +51,7 @@ Library Working Group Issues Status
 
 .. csv-table::
:file: Cxx1zStatusIssuesStatus.csv
+   :header-rows: 1
:widths: auto
 
 Last Updated: 17-Nov-2020

diff  --git a/libcxx/docs/Cxx2aStatus.rst b/libcxx/docs/Cxx2aStatus.rst
index fc5b779aecc9..af65a1fda16b 100644
--- a/libcxx/docs/Cxx2aStatus.rst
+++ b/libcxx/docs/Cxx2aStatus.rst
@@ -1,7 +1,7 @@
 .. _cxx2a-status:
 
 
-libc++ C++2a Status
+libc++ C++20 Status
 
 
 .. include:: Helpers/Styles.rst
@@ -13,7 +13,8 @@ libc++ C++2a Status
 Overview
 
 
-In July 2017, the C++ standard committee created a draft for the next version 
of the C++ standard, known here as "C++2a" (probably to be C++20).
+In July 2017, the C++ standard committee created a draft for the next version 
of the C++ standard, initially known as "C++2a".
+In September 2020, the C++ standard committee approved this draft, and sent it 
to ISO for approval as C++20.
 
 This page shows the status of libc++; the status of clang's support of the 
language features is `here `__.
 
@@ -34,6 +35,7 @@ Paper Status
 
 .. csv-table::
:file: Cxx2aStatusPaperStatus.csv
+   :header-rows: 1
:widths: auto
 
 .. note::
@@ -52,6 +54,7 @@ Library Working Group Issues Status
 
 .. csv-table::
:file: Cxx2aStatusIssuesStatus.csv
+   :header-rows: 1
:widths: auto
 
 Last Updated: 24-Nov-2020

diff  --git a/libcxx/docs/Cxx2bStatus.rst b/libcxx/docs/Cxx2bStatus.rst
new file mode 100644
index ..67f7de20ceb8
--- /dev/null
+++ b/libcxx/docs/Cxx2bStatus.rst
@@ -0,0 +1,50 @@
+.. _cxx2b-status:
+
+
+libc++ C++2b Status
+
+
+.. include:: Helpers/Styles.rst
+
+.. contents::
+   :local:
+
+
+Overview
+
+
+In November 2020, the C++ standard committee adopted the first changes to the 
next version of the C++ standard, known here as "C++2b" (probably to be C++23).
+
+.. This page shows the status of libc++; the status of clang's support of the 
language features is `here `__.
+
+.. attention:: Features in unreleased drafts of the standard are subject to 
change.
+
+The groups that have contributed papers:
+
+-  CWG - Core Language Working group
+-  LWG - Library working group
+-  SG1 - Study group #1 (Concurrency working group)
+
+.. note:: "Nothing to do" means that no library changes were needed to 
implement this change.
+
+.. _paper-status-cxx2b:
+
+Paper Status
+
+
+.. csv-table::
+   :file: Cxx2bStatusPaperStatus.csv
+   :header-rows: 1
+   :widths: auto
+
+.. _issues-status-cxx2b:
+
+.. Library Working Group Issues Status
+.. 
+
+.. .. csv-table::
+..:file: Cxx2bStatusIssuesStatus.csv
+..:header-rows: 1
+..:widths: auto
+
+Last Updated: 30-Nov-2020

diff  --git a/libcxx/docs/Cxx2bStatusPaperStatus.csv 
b/libcxx/docs/Cxx2bStatusPaperStatus.csv
new file mode 100644
index ..c79509528add
--- /dev/null
+++ b/libcxx/docs/Cxx2bStatusPaperStatus.csv
@@ -0,0 +1,6 @@
+"Paper #","Group","Paper Name","Meeting","Status","First released version"
+"`P0881R7 `__","LWG"

[llvm-branch-commits] [clang] 6627a3c - [c++2b] Add option -std=c++2b to enable support for potential C++2b features.

2020-12-03 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-03T10:27:47+01:00
New Revision: 6627a3c2873fdf7ccba1a1573371079be48b36e8

URL: 
https://github.com/llvm/llvm-project/commit/6627a3c2873fdf7ccba1a1573371079be48b36e8
DIFF: 
https://github.com/llvm/llvm-project/commit/6627a3c2873fdf7ccba1a1573371079be48b36e8.diff

LOG: [c++2b] Add option -std=c++2b to enable support for potential C++2b 
features.

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D92547

Added: 


Modified: 
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Basic/LangStandard.h
clang/include/clang/Basic/LangStandards.def
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Frontend/InitPreprocessor.cpp
clang/test/Driver/std.cpp
clang/test/Driver/unknown-std.cpp
clang/test/Preprocessor/init.c

Removed: 




diff  --git a/clang/include/clang/Basic/LangOptions.def 
b/clang/include/clang/Basic/LangOptions.def
index 071cc314b7d1..19fb4ae82b89 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -92,6 +92,7 @@ LANGOPT(CPlusPlus11   , 1, 0, "C++11")
 LANGOPT(CPlusPlus14   , 1, 0, "C++14")
 LANGOPT(CPlusPlus17   , 1, 0, "C++17")
 LANGOPT(CPlusPlus20   , 1, 0, "C++20")
+LANGOPT(CPlusPlus2b   , 1, 0, "C++2b")
 LANGOPT(ObjC  , 1, 0, "Objective-C")
 BENIGN_LANGOPT(ObjCDefaultSynthProperties , 1, 0,
"Objective-C auto-synthesized properties")

diff  --git a/clang/include/clang/Basic/LangStandard.h 
b/clang/include/clang/Basic/LangStandard.h
index ad7f7510b234..f82ce05a6369 100644
--- a/clang/include/clang/Basic/LangStandard.h
+++ b/clang/include/clang/Basic/LangStandard.h
@@ -49,11 +49,12 @@ enum LangFeatures {
   CPlusPlus14 = (1 << 7),
   CPlusPlus17 = (1 << 8),
   CPlusPlus20 = (1 << 9),
-  Digraphs = (1 << 10),
-  GNUMode = (1 << 11),
-  HexFloat = (1 << 12),
-  ImplicitInt = (1 << 13),
-  OpenCL = (1 << 14)
+  CPlusPlus2b = (1 << 10),
+  Digraphs = (1 << 11),
+  GNUMode = (1 << 12),
+  HexFloat = (1 << 13),
+  ImplicitInt = (1 << 14),
+  OpenCL = (1 << 15)
 };
 
 /// LangStandard - Information about the properties of a particular language
@@ -111,6 +112,9 @@ struct LangStandard {
   /// isCPlusPlus20 - Language is a C++20 variant (or later).
   bool isCPlusPlus20() const { return Flags & CPlusPlus20; }
 
+  /// isCPlusPlus2b - Language is a post-C++20 variant (or later).
+  bool isCPlusPlus2b() const { return Flags & CPlusPlus2b; }
+
   /// hasDigraphs - Language supports digraphs.
   bool hasDigraphs() const { return Flags & Digraphs; }
 

diff  --git a/clang/include/clang/Basic/LangStandards.def 
b/clang/include/clang/Basic/LangStandards.def
index 7b915c312746..f086d8a43ccb 100644
--- a/clang/include/clang/Basic/LangStandards.def
+++ b/clang/include/clang/Basic/LangStandards.def
@@ -152,6 +152,16 @@ LANGSTANDARD(gnucxx20, "gnu++20",
  CPlusPlus20 | Digraphs | HexFloat | GNUMode)
 LANGSTANDARD_ALIAS_DEPR(gnucxx20, "gnu++2a")
 
+LANGSTANDARD(cxx2b, "c++2b",
+ CXX, "Working draft for ISO C++ 2023 DIS",
+ LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 
|
+ CPlusPlus20 | CPlusPlus2b | Digraphs | HexFloat)
+
+LANGSTANDARD(gnucxx2b, "gnu++2b",
+ CXX, "Working draft for ISO C++ 2023 DIS with GNU extensions",
+ LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus17 
|
+ CPlusPlus20 | CPlusPlus2b | Digraphs | HexFloat | GNUMode)
+
 // OpenCL
 LANGSTANDARD(opencl10, "cl1.0",
  OpenCL, "OpenCL 1.0",

diff  --git a/clang/lib/Frontend/CompilerInvocation.cpp 
b/clang/lib/Frontend/CompilerInvocation.cpp
index 1c63ce612be0..e31f6aa34b36 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2388,6 +2388,7 @@ void CompilerInvocation::setLangDefaults(LangOptions 
&Opts, InputKind IK,
   Opts.CPlusPlus14 = Std.isCPlusPlus14();
   Opts.CPlusPlus17 = Std.isCPlusPlus17();
   Opts.CPlusPlus20 = Std.isCPlusPlus20();
+  Opts.CPlusPlus2b = Std.isCPlusPlus2b();
   Opts.Digraphs = Std.hasDigraphs();
   Opts.GNUMode = Std.isGNUMode();
   Opts.GNUInline = !Opts.C99 && !Opts.CPlusPlus;

diff  --git a/clang/lib/Frontend/InitPreprocessor.cpp 
b/clang/lib/Frontend/InitPreprocessor.cpp
index 86d5e61b7112..42eed9f6c7b5 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -376,8 +376,11 @@ static void InitializeStandardPredefinedMacros(const 
TargetInfo &TI,
   Builder.defineMacro("__STDC_VERSION__", "199409L");
   } else {
 //   -- __cplusplus
+// FIXME: Use correct value for C++23.
+if (LangOpts.CPlusPlus2b)
+  Builder.defineMacro("__cplusplus", "202101L");
 //  [C++20] The integer literal 202002L.
-if (LangOpts.CPlusPlus20)
+else if (LangOpts.CPlusPlus20)
   Builder.defineMacro("__cplusplu

[llvm-branch-commits] [clang] fe21c86 - [clang-format] De-duplicate includes with leading or trailing whitespace.

2020-12-03 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-03T10:59:46+01:00
New Revision: fe21c86ee75f93bb0372660c004ac2325ac12cdc

URL: 
https://github.com/llvm/llvm-project/commit/fe21c86ee75f93bb0372660c004ac2325ac12cdc
DIFF: 
https://github.com/llvm/llvm-project/commit/fe21c86ee75f93bb0372660c004ac2325ac12cdc.diff

LOG: [clang-format] De-duplicate includes with leading or trailing whitespace.

This fixes PR46555 (https://bugs.llvm.org/show_bug.cgi?id=46555).

Reviewed By: MyDeveloperDay

Differential Revision: https://reviews.llvm.org/D88296

Added: 


Modified: 
clang/lib/Format/Format.cpp
clang/unittests/Format/SortIncludesTest.cpp

Removed: 




diff  --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 235621c4f9aa..6f96395f608d 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -2179,7 +2179,8 @@ static void sortCppIncludes(const FormatStyle &Style,
   // Deduplicate #includes.
   Indices.erase(std::unique(Indices.begin(), Indices.end(),
 [&](unsigned LHSI, unsigned RHSI) {
-  return Includes[LHSI].Text == 
Includes[RHSI].Text;
+  return Includes[LHSI].Text.trim() ==
+ Includes[RHSI].Text.trim();
 }),
 Indices.end());
 

diff  --git a/clang/unittests/Format/SortIncludesTest.cpp 
b/clang/unittests/Format/SortIncludesTest.cpp
index 279c4ee15a10..cb2d2bd782fc 100644
--- a/clang/unittests/Format/SortIncludesTest.cpp
+++ b/clang/unittests/Format/SortIncludesTest.cpp
@@ -289,6 +289,19 @@ TEST_F(SortIncludesTest, LeadingWhitespace) {
 sort("# include \"a.h\"\n"
  "#  include \"c.h\"\n"
  "#   include \"b.h\"\n"));
+  EXPECT_EQ("#include \"a.h\"\n", sort("#include \"a.h\"\n"
+   " #include \"a.h\"\n"));
+}
+
+TEST_F(SortIncludesTest, TrailingWhitespace) {
+  EXPECT_EQ("#include \"a.h\"\n"
+"#include \"b.h\"\n"
+"#include \"c.h\"\n",
+sort("#include \"a.h\" \n"
+ "#include \"c.h\"  \n"
+ "#include \"b.h\"   \n"));
+  EXPECT_EQ("#include \"a.h\"\n", sort("#include \"a.h\"\n"
+   "#include \"a.h\" \n"));
 }
 
 TEST_F(SortIncludesTest, GreaterInComment) {



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


[llvm-branch-commits] [libcxx] b04a5e7 - [libc++] [test] Mark path.charconv.pass.cpp as requiring localization enabled.

2020-12-04 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-04T19:58:48+01:00
New Revision: b04a5e752f53d0ab5bda957a9a188221ed72a6ad

URL: 
https://github.com/llvm/llvm-project/commit/b04a5e752f53d0ab5bda957a9a188221ed72a6ad
DIFF: 
https://github.com/llvm/llvm-project/commit/b04a5e752f53d0ab5bda957a9a188221ed72a6ad.diff

LOG: [libc++] [test] Mark path.charconv.pass.cpp as requiring localization 
enabled.

It was added in commit 0b71bf793924301d53cf01eeb0a27e96fea17791, "[libcxx] 
[test] Add a test for conversions between wchar_t, utf8, char16_t, char32_t and 
windows native narrow code pages"

Added: 


Modified: 

libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp

Removed: 




diff  --git 
a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
 
b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
index f36b6e2dc87e..4f9dc265d0d3 100644
--- 
a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
+++ 
b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.charconv.pass.cpp
@@ -6,6 +6,7 @@
 //
 
//===--===//
 
+// UNSUPPORTED: libcpp-has-no-localization
 // UNSUPPORTED: c++03
 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
 



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


[llvm-branch-commits] [libcxx] 5ad6ed5 - [libc++] [test] Disable parts of path.factory.pass.cpp as requiring localization enabled.

2020-12-04 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-04T20:04:35+01:00
New Revision: 5ad6ed529859e5408f170166ef5c380e0bb62b27

URL: 
https://github.com/llvm/llvm-project/commit/5ad6ed529859e5408f170166ef5c380e0bb62b27
DIFF: 
https://github.com/llvm/llvm-project/commit/5ad6ed529859e5408f170166ef5c380e0bb62b27.diff

LOG: [libc++] [test] Disable parts of path.factory.pass.cpp as requiring 
localization enabled.

It was added in commit 6be11e35d5397ae1c117eb840a969585fdd7d08d, "[libcxx] 
Implement c++2a char8_t input/output of std::filesystem::path".

Added: 


Modified: 

libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp

Removed: 




diff  --git 
a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp
 
b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp
index 9df81f4c6ae0..6885c4e49064 100644
--- 
a/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp
+++ 
b/libcxx/test/std/input.output/filesystems/class.path/path.nonmember/path.factory.pass.cpp
@@ -49,7 +49,8 @@ int main(int, char**)
 path p = fs::u8path(In3, In3End);
 assert(p == In1);
   }
-#if TEST_STD_VER > 17 && defined(__cpp_char8_t) && defined(_LIBCPP_VERSION)
+#if TEST_STD_VER > 17 && defined(__cpp_char8_t) && defined(_LIBCPP_VERSION) && 
\
+!defined(_LIBCPP_HAS_NO_LOCALIZATION)
   const char8_t* u8In1 = u8"abcd/efg";
   const std::u8string u8In2(u8In1);
   const auto u8In3 = u8In2.begin();



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


[llvm-branch-commits] [libcxx] f632673 - [libc++] [LWG3374] Mark `to_address(const Ptr& p)` overload `constexpr`.

2020-12-06 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-06T15:26:26+01:00
New Revision: f6326736ba166f0a9bfa4e9be019f84fc3143651

URL: 
https://github.com/llvm/llvm-project/commit/f6326736ba166f0a9bfa4e9be019f84fc3143651
DIFF: 
https://github.com/llvm/llvm-project/commit/f6326736ba166f0a9bfa4e9be019f84fc3143651.diff

LOG: [libc++] [LWG3374] Mark `to_address(const Ptr& p)` overload `constexpr`.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D92659

Added: 


Modified: 
libcxx/docs/Cxx2aStatusIssuesStatus.csv
libcxx/include/memory
libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp

Removed: 




diff  --git a/libcxx/docs/Cxx2aStatusIssuesStatus.csv 
b/libcxx/docs/Cxx2aStatusIssuesStatus.csv
index 4c78b1655631..4ef24005a3c0 100644
--- a/libcxx/docs/Cxx2aStatusIssuesStatus.csv
+++ b/libcxx/docs/Cxx2aStatusIssuesStatus.csv
@@ -278,7 +278,7 @@
 "`3371 `__","``visit_format_arg``\  and 
``make_format_args``\  are not hidden friends","Prague","",""
 "`3372 `__","``vformat_to``\  should not try to 
deduce ``Out``\  twice","Prague","",""
 "`3373 `__","``{to,from}_chars_result``\  and 
``format_to_n_result``\  need the  ""we really mean what we say"" 
wording","Prague","",""
-"`3374 `__","P0653 + P1006 should have made the 
other ``std::to_address``\  overload ``constexpr``\ ","Prague","",""
+"`3374 `__","P0653 + P1006 should have made the 
other ``std::to_address``\  overload ``constexpr``\ 
","Prague","|Complete|","12.0"
 "`3375 `__","``decay``\  in ``viewable_range``\  
should be ``remove_cvref``\ ","Prague","",""
 "`3377 `__","``elements_view::iterator``\  
befriends a specialization of itself","Prague","",""
 "`3379 `__","""``safe``\ "" in several library 
names is misleading","Prague","",""

diff  --git a/libcxx/include/memory b/libcxx/include/memory
index 402a735419c8..77d7b67112e3 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -46,7 +46,7 @@ struct pointer_traits
 };
 
 template  constexpr T* to_address(T* p) noexcept; // C++20
-template  auto to_address(const Ptr& p) noexcept; // C++20
+template  constexpr auto to_address(const Ptr& p) noexcept; // C++20
 
 template 
 struct allocator_traits
@@ -1077,7 +1077,7 @@ to_address(_Tp* __p) _NOEXCEPT
 }
 
 template 
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY constexpr
 auto
 to_address(const _Pointer& __p) _NOEXCEPT
 {

diff  --git 
a/libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp 
b/libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp
index 2b9928f4df7e..26eba0e06cff 100644
--- a/libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp
+++ b/libcxx/test/std/utilities/memory/pointer.conversion/to_address.pass.cpp
@@ -11,7 +11,7 @@
 // UNSUPPORTED: c++03, c++11, c++14, c++17
 
 // template  constexpr T* to_address(T* p) noexcept;
-// template  auto to_address(const Ptr& p) noexcept;
+// template  constexpr auto to_address(const Ptr& p) noexcept;
 
 #include 
 #include 
@@ -22,10 +22,10 @@ class P1
 public:
 using element_type = int;
 
-explicit P1(int* p)
+constexpr explicit P1(int* p)
 : p_(p) { }
 
-int* operator->() const noexcept
+constexpr int* operator->() const noexcept
 { return p_; }
 
 private:
@@ -37,10 +37,10 @@ class P2
 public:
 using element_type = int;
 
-explicit P2(int* p)
+constexpr explicit P2(int* p)
 : p_(p) { }
 
-P1 operator->() const noexcept
+constexpr P1 operator->() const noexcept
 { return p_; }
 
 private:
@@ -50,10 +50,10 @@ class P2
 class P3
 {
 public:
-explicit P3(int* p)
+constexpr explicit P3(int* p)
 : p_(p) { }
 
-int* get() const noexcept
+constexpr int* get() const noexcept
 { return p_; }
 
 private:
@@ -65,7 +65,7 @@ namespace std
 template<>
 struct pointer_traits<::P3>
 {
-static int* to_address(const ::P3& p) noexcept
+static constexpr int* to_address(const ::P3& p) noexcept
 { return p.get(); }
 };
 }
@@ -73,13 +73,13 @@ struct pointer_traits<::P3>
 class P4
 {
 public:
-explicit P4(int* p)
+constexpr explicit P4(int* p)
 : p_(p) { }
 
-int* operator->() const noexcept
+constexpr int* operator->() const noexcept
 { return nullptr; }
 
-int* get() const noexcept
+constexpr int* get() const noexcept
 { return p_; }
 
 private:
@@ -91,7 +91,7 @@ namespace std
 template<>
 struct pointer_traits<::P4>
 {
-static int* to_address(const ::P4& p) noexcept
+constexpr static int* to_address(const ::P4& p) noexcept
 { return p.get(); }
 };
 }
@@ -99,23 +99,28 @@ struct pointer_traits<::P4>
 int n = 0;
 static_assert(std::to_address(&n) == &n);
 
-int ma

[llvm-branch-commits] [libcxx] e2279c2 - [libc++] [docs] Mark P1865 as complete since 11.0 as it was implemented together with P1135. Fix synopses in and .

2020-12-06 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-06T15:36:52+01:00
New Revision: e2279c2350b83650a858a541ff566eccd69d38ef

URL: 
https://github.com/llvm/llvm-project/commit/e2279c2350b83650a858a541ff566eccd69d38ef
DIFF: 
https://github.com/llvm/llvm-project/commit/e2279c2350b83650a858a541ff566eccd69d38ef.diff

LOG: [libc++] [docs] Mark P1865 as complete since 11.0 as it was implemented 
together with P1135. Fix synopses in  and .

It was implemented in commit 54fa9ecd3088508b05b0c5b5cb52da8a3c188655 ([libc++] 
Implementation of C++20's P1135R6 for libcxx).

Added: 


Modified: 
libcxx/docs/Cxx2aStatusPaperStatus.csv
libcxx/include/barrier
libcxx/include/latch

Removed: 




diff  --git a/libcxx/docs/Cxx2aStatusPaperStatus.csv 
b/libcxx/docs/Cxx2aStatusPaperStatus.csv
index 3e027327b6ae..4efad23981cf 100644
--- a/libcxx/docs/Cxx2aStatusPaperStatus.csv
+++ b/libcxx/docs/Cxx2aStatusPaperStatus.csv
@@ -110,7 +110,7 @@
 "`P1004 `__","LWG","Making std::vector 
constexpr","Cologne","",""
 "`P1035 `__","LWG","Input Range 
Adaptors","Cologne","",""
 "`P1065 `__","LWG","Constexpr INVOKE","Cologne","",""
-"`P1135 `__","LWG","The C++20 Synchronization 
Library","Cologne","|Complete|",""
+"`P1135 `__","LWG","The C++20 Synchronization 
Library","Cologne","|Complete|","11.0"
 "`P1207 `__","LWG","Movability of Single-pass 
Iterators","Cologne","",""
 "`P1208 `__","LWG","Adopt source_location for 
C++20","Cologne","",""
 "`P1355 `__","LWG","Exposing a narrow contract for 
ceil2","Cologne","|Complete|","9.0"
@@ -151,7 +151,7 @@
 "`P1723 `__","LWG","Mandating the Standard Library: 
Clause 31 - Atomics library","Belfast","* *",""
 "`P1855 `__","LWG","Make \  
freestanding","Belfast","* *",""
 "`P1862 `__","LWG","Ranges adaptors for non-copyable 
iterators","Belfast","* *",""
-"`P1865 `__","LWG","Add max() to latch and 
barrier","Belfast","* *",""
+"`P1865 `__","LWG","Add max() to latch and 
barrier","Belfast","|Complete|","11.0"
 "`P1869 `__","LWG","Rename 'condition_variable_any' 
interruptible wait methods","Belfast","* *",""
 "`P1870 `__","LWG","forwarding-range is too 
subtle","Belfast","* *",""
 "`P1871 `__","LWG","Should concepts be enabled or 
disabled?","Belfast","* *",""

diff  --git a/libcxx/include/barrier b/libcxx/include/barrier
index ba9e8ea9bb84..be213a6895ef 100644
--- a/libcxx/include/barrier
+++ b/libcxx/include/barrier
@@ -22,6 +22,8 @@ namespace std
   public:
 using arrival_token = see below;
 
+static constexpr ptr
diff _t max() noexcept;
+
 constexpr explicit barrier(ptr
diff _t phase_count,
CompletionFunction f = CompletionFunction());
 ~barrier();

diff  --git a/libcxx/include/latch b/libcxx/include/latch
index b338f091316c..a894f8cafd1c 100644
--- a/libcxx/include/latch
+++ b/libcxx/include/latch
@@ -19,6 +19,8 @@ namespace std
   class latch
   {
   public:
+static constexpr ptr
diff _t max() noexcept;
+
 constexpr explicit latch(ptr
diff _t __expected);
 ~latch();
 



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


[llvm-branch-commits] [libcxx] bf8683a - [libc++] [docs] Mark LWG3055 as complete. Use string_view instead of string in path::operator+=(ECharT).

2020-12-07 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-07T20:18:09+01:00
New Revision: bf8683adfa39d53c223cf8b98fa036e835c9570e

URL: 
https://github.com/llvm/llvm-project/commit/bf8683adfa39d53c223cf8b98fa036e835c9570e
DIFF: 
https://github.com/llvm/llvm-project/commit/bf8683adfa39d53c223cf8b98fa036e835c9570e.diff

LOG: [libc++] [docs] Mark LWG3055 as complete. Use string_view instead of 
string in path::operator+=(ECharT).

The issue didn't change the behaviour which is tested in 
libcxx/test/std/input.output/filesystems/class.path/path.member/path.concat.pass.cpp.

The change to use string_view instead of string is not strictly necessary.

 was added in commit 998a5c88312066fcc2b2de1358edc76587611354 
(Implement ).

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D92731

Added: 


Modified: 
libcxx/docs/Cxx2aStatusIssuesStatus.csv
libcxx/include/filesystem

Removed: 




diff  --git a/libcxx/docs/Cxx2aStatusIssuesStatus.csv 
b/libcxx/docs/Cxx2aStatusIssuesStatus.csv
index 4ef24005a3c0..2d0af44a259e 100644
--- a/libcxx/docs/Cxx2aStatusIssuesStatus.csv
+++ b/libcxx/docs/Cxx2aStatusIssuesStatus.csv
@@ -143,7 +143,7 @@
 "`3182 `__","Specification of ``Same``\  could be 
clearer","Kona","",""
 "","","","",""
 "`2899 `__","``is_(nothrow_)move_constructible``\  
and ``tuple``\ , ``optional``\  and ``unique_ptr``\ ","Cologne","",""
-"`3055 
`__","``path::operator+=(*single-character*)``\  
misspecified","Cologne","",""
+"`3055 
`__","``path::operator+=(*single-character*)``\  
misspecified","Cologne","|Complete|","7.0"
 "`3158 `__","``tuple(allocator_arg_t, const 
Alloc&)``\  should be conditionally explicit","Cologne","",""
 "`3169 `__","``ranges``\  permutation generators 
discard useful information","Cologne","",""
 "`3183 `__","Normative permission to specialize 
Ranges variable templates","Cologne","",""

diff  --git a/libcxx/include/filesystem b/libcxx/include/filesystem
index d24751b716e3..1a44d9f360e3 100644
--- a/libcxx/include/filesystem
+++ b/libcxx/include/filesystem
@@ -940,9 +940,8 @@ public:
   template 
   typename enable_if<__can_convert_char<_ECharT>::value, path&>::type
   operator+=(_ECharT __x) {
-basic_string<_ECharT> __tmp;
-__tmp += __x;
-_PathCVT<_ECharT>::__append_source(__pn_, __tmp);
+_PathCVT<_ECharT>::__append_source(__pn_,
+   basic_string_view<_ECharT>(&__x, 1));
 return *this;
   }
 



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


[llvm-branch-commits] [libcxx] ba3adfa - [libc++] Mark LWG3200 as Nothing To Do. NFC.

2020-12-08 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-08T09:00:45+01:00
New Revision: ba3adfad6e00cf53dd12a021182ab6c179457574

URL: 
https://github.com/llvm/llvm-project/commit/ba3adfad6e00cf53dd12a021182ab6c179457574
DIFF: 
https://github.com/llvm/llvm-project/commit/ba3adfad6e00cf53dd12a021182ab6c179457574.diff

LOG: [libc++] Mark LWG3200 as Nothing To Do. NFC.

This is only a wording change, because it is currently impossible to constrain 
the overload set on whether the type is complete or not.

Added: 


Modified: 
libcxx/docs/Cxx2aStatusIssuesStatus.csv

Removed: 




diff  --git a/libcxx/docs/Cxx2aStatusIssuesStatus.csv 
b/libcxx/docs/Cxx2aStatusIssuesStatus.csv
index 2d0af44a259e..3f371812eda7 100644
--- a/libcxx/docs/Cxx2aStatusIssuesStatus.csv
+++ b/libcxx/docs/Cxx2aStatusIssuesStatus.csv
@@ -196,7 +196,7 @@
 "`3150 `__","``UniformRandomBitGenerator``\  should 
validate ``min``\  and ``max``\ ","Prague","",""
 "`3175 `__","The ``CommonReference``\  requirement 
of concept ``SwappableWith``\  is not satisfied in the example","Prague","",""
 "`3194 `__","``ConvertibleTo``\  prose does not 
match code","Prague","",""
-"`3200 `__","``midpoint``\  should not constrain 
``T``\  is complete","Prague","",""
+"`3200 `__","``midpoint``\  should not constrain 
``T``\  is complete","Prague","|Nothing To Do|",""
 "`3201 `__","``lerp``\  should be marked as 
``noexcept``\ ","Prague","|Complete|",""
 "`3226 `__","``zoned_time``\  constructor from 
``string_view``\  should accept ``zoned_time``\ 
","Prague","",""
 "`3233 `__","Broken requirements for 
``shared_ptr``\  converting constructors","Prague","",""



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


[llvm-branch-commits] [libcxx] 877170f - [libc++] [LWG3221] Add tests for wrapping operator+(year_month, months).

2020-12-08 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-08T18:08:04+01:00
New Revision: 877170f3eb2a7f288eca1e226e5a07d607f96474

URL: 
https://github.com/llvm/llvm-project/commit/877170f3eb2a7f288eca1e226e5a07d607f96474
DIFF: 
https://github.com/llvm/llvm-project/commit/877170f3eb2a7f288eca1e226e5a07d607f96474.diff

LOG: [libc++] [LWG3221] Add tests for wrapping operator+(year_month, months).

The behaviour didn't change since commit 
5b08c1742a536f54bd5e270b00ff851cbc7314ef (Recommit  changes with a 
couple xtra tests marked to fail on apple's clang.)

* http://wg21.link/lwg3221

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D92730

Added: 


Modified: 
libcxx/docs/Cxx2aStatusIssuesStatus.csv

libcxx/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/plus.pass.cpp

Removed: 




diff  --git a/libcxx/docs/Cxx2aStatusIssuesStatus.csv 
b/libcxx/docs/Cxx2aStatusIssuesStatus.csv
index 3f371812eda7..aa5d93a55f6b 100644
--- a/libcxx/docs/Cxx2aStatusIssuesStatus.csv
+++ b/libcxx/docs/Cxx2aStatusIssuesStatus.csv
@@ -168,7 +168,7 @@
 "`3230 `__","Format specifier ``%y/%Y``\  is 
missing locale alternative versions","Belfast","",""
 "`3232 `__","Inconsistency in ``zoned_time``\  
deduction guides","Belfast","",""
 "`3222 `__","P0574R1 introduced preconditions on 
non-existent parameters","Belfast","",""
-"`3221 `__","Result of ``year_month``\  arithmetic 
with ``months``\  is ambiguous","Belfast","",""
+"`3221 `__","Result of ``year_month``\  arithmetic 
with ``months``\  is ambiguous","Belfast","|Complete|","8.0"
 "`3235 `__","``parse``\  manipulator without 
abbreviation is not callable","Belfast","",""
 "`3246 `__","What are the constraints on the 
template parameter of ``basic_format_arg``\ ?","Belfast","",""
 "`3253 `__","``basic_syncbuf::basic_syncbuf()``\  
should not be explicit","Belfast","",""

diff  --git 
a/libcxx/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/plus.pass.cpp
 
b/libcxx/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/plus.pass.cpp
index afd18cb0a3c6..315d74b75bbc 100644
--- 
a/libcxx/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/plus.pass.cpp
+++ 
b/libcxx/test/std/utilities/time/time.cal/time.cal.ym/time.cal.ym.nonmembers/plus.pass.cpp
@@ -17,91 +17,91 @@
 // Returns: ym + dy.
 //
 // constexpr year_month operator+(const year_month& ym, const months& dm) 
noexcept;
-// Returns: A year_month value z such that z - ym == dm.
+// Returns: A year_month value z such that z.ok() && z - ym == dm is true.
 // Complexity: O(1) with respect to the value of dm.
 //
 // constexpr year_month operator+(const months& dm, const year_month& ym) 
noexcept;
 // Returns: ym + dm.
 
-
-
 #include 
 #include 
 #include 
 
 #include "test_macros.h"
 
-constexpr bool testConstexprYears(std::chrono::year_month ym)
-{
-std::chrono::years offset{23};
-if (static_cast((ym ).year()) !=  1) return false;
-if (static_cast((ym + offset).year()) != 24) return false;
-if (static_cast((offset + ym).year()) != 24) return false;
-return true;
+using year = std::chrono::year;
+using years = std::chrono::years;
+using month = std::chrono::month;
+using months = std::chrono::months;
+using year_month = std::chrono::year_month;
+
+// year_month + years
+constexpr bool test_ym_plus_y() {
+  ASSERT_NOEXCEPT(std::declval() + std::declval());
+  ASSERT_NOEXCEPT(std::declval() + std::declval());
+
+  ASSERT_SAME_TYPE(
+  year_month, decltype(std::declval() + 
std::declval()));
+  ASSERT_SAME_TYPE(
+  year_month, decltype(std::declval() + 
std::declval()));
+
+  year_month ym{year{1234}, std::chrono::January};
+  for (int i = 0; i <= 10; ++i) {
+year_month ym1 = ym + years{i};
+year_month ym2 = years{i} + ym;
+assert(static_cast(ym1.year()) == i + 1234);
+assert(static_cast(ym2.year()) == i + 1234);
+assert(ym1.month() == std::chrono::January);
+assert(ym2.month() == std::chrono::January);
+assert(ym1 == ym2);
+  }
+
+  return true;
 }
 
-
-constexpr bool testConstexprMonths(std::chrono::year_month ym)
-{
-std::chrono::months offset{6};
-if (static_cast((ym ).month()) !=  1) return false;
-if (static_cast((ym + offset).month()) !=  7) return false;
-if (static_cast((offset + ym).month()) !=  7) return false;
-return true;
+// year_month + months
+constexpr bool test_ym_plus_m() {
+  ASSERT_NOEXCEPT(std::declval() + std::declval());
+  ASSERT_NOEXCEPT(std::declval() + std::declval());
+
+  ASSERT_SAME_TYPE(year_month, decltype(std::declval() +
+std::declval()));
+  ASSERT_SAME_TYPE(year_month, decltype(std::dec

[llvm-branch-commits] [libcxx] 6fd5a94 - [libc++] Add a script to automatize updating test for a new header.

2020-12-09 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-10T08:37:50+01:00
New Revision: 6fd5a94eeb9acca783549df26b2e6319df8ab0a8

URL: 
https://github.com/llvm/llvm-project/commit/6fd5a94eeb9acca783549df26b2e6319df8ab0a8
DIFF: 
https://github.com/llvm/llvm-project/commit/6fd5a94eeb9acca783549df26b2e6319df8ab0a8.diff

LOG: [libc++] Add a script to automatize updating test for a new header.

Idea from D92525.
This script globs include/ directory and updates the tests in test/libcxx.
This patch does not generate module.modulemap nor CMakeLists.txt.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D92656

Added: 
libcxx/utils/generate_header_tests.py

Modified: 
libcxx/docs/Contributing.rst
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

Removed: 




diff  --git a/libcxx/docs/Contributing.rst b/libcxx/docs/Contributing.rst
index abbf91fdd702..f397f4ce8831 100644
--- a/libcxx/docs/Contributing.rst
+++ b/libcxx/docs/Contributing.rst
@@ -23,18 +23,19 @@ After branching for an LLVM release:
 2. Update the ``include/__libcpp_version`` file
 3. Update the version number in ``docs/conf.py``
 
+Modifying feature test macros
+=
+
+When adding or updating feature test macros, you should update the 
corresponding tests.
+To do that, modify ``feature_test_macros`` table in the script 
``utils/generate_feature_test_macro_components.py``, run it, and commit updated 
files.
+
 Adding a new header TODO
 
 
 When adding a new header to libc++:
 
 1. Add a test under ``test/libcxx`` that the new header defines 
``_LIBCPP_VERSION``. See ``test/libcxx/algorithms/version.pass.cpp`` for an 
example.
-2. Update the following test files to include the new header:
-
-  * ``test/libcxx/double_include.sh.cpp``
-  * ``test/libcxx/min_max_macros.compile.pass.cpp``
-  * ``test/libcxx/no_assert_include.compile.pass.cpp``
-
+2. Run ``python utils/generate_header_tests.py``, verify and commit the 
modifications.
 3. Create a submodule in ``include/module.modulemap`` for the new header.
 4. Update the ``include/CMakeLists.txt`` file to include the new header.
 

diff  --git a/libcxx/test/libcxx/double_include.sh.cpp 
b/libcxx/test/libcxx/double_include.sh.cpp
index 39851cc379d4..072b78899b36 100644
--- a/libcxx/test/libcxx/double_include.sh.cpp
+++ b/libcxx/test/libcxx/double_include.sh.cpp
@@ -1,195 +1,235 @@
-// -*- C++ -*-
-//===--===//
-//
-// 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 that we can include each header in two TU's and link them together.
-
-// RUN: %{cxx} -c %s -o %t.first.o %{flags} %{compile_flags}
-// RUN: %{cxx} -c %s -o %t.second.o -DWITH_MAIN %{flags} %{compile_flags}
-// RUN: %{cxx} -o %t.exe %t.first.o %t.second.o %{flags} %{link_flags}
-// RUN: %{run}
-
-// GCC 5 pretends it supports C++17 features, but some features like 
static_assert
-// without a message are not actually supported. This causes some headers to 
fail
-// when included.
-// UNSUPPORTED: gcc-5 && c++17
-
-// Prevent  from generating deprecated warnings for this test.
-#if defined(__DEPRECATED)
-#undef __DEPRECATED
-#endif
-
-// Top level headers
-#include 
-#include 
-#include 
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include 
-#endif
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include 
-#endif
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include 
-#endif
-#include 
-#include 
-#include 
-#include 
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include 
-#endif
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include 
-#endif
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include 
-#endif
-#include 
-#include 
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include 
-#endif
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include 
-#endif
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 

[llvm-branch-commits] [libcxx] e4ed349 - [libc++] [P1164] [C++20] Make fs::create_directory() error if there is already a non-directory.

2020-12-09 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-10T08:40:27+01:00
New Revision: e4ed349c765827a824cb38ec6ef3447263b768cf

URL: 
https://github.com/llvm/llvm-project/commit/e4ed349c765827a824cb38ec6ef3447263b768cf
DIFF: 
https://github.com/llvm/llvm-project/commit/e4ed349c765827a824cb38ec6ef3447263b768cf.diff

LOG: [libc++] [P1164] [C++20] Make fs::create_directory() error if there is 
already a non-directory.

Also mark LWG2935 and LWG3079 as complete.

Applied retroactively to previous standards too, as it's a DR.

* https://wg21.link/P1164
* https://wg21.link/lwg2935
* https://wg21.link/lwg3079

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D92769

Added: 


Modified: 
libcxx/docs/Cxx2aStatusIssuesStatus.csv
libcxx/docs/Cxx2aStatusPaperStatus.csv
libcxx/src/filesystem/operations.cpp

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory.pass.cpp

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directory/create_directory_with_attributes.pass.cpp

Removed: 




diff  --git a/libcxx/docs/Cxx2aStatusIssuesStatus.csv 
b/libcxx/docs/Cxx2aStatusIssuesStatus.csv
index aa5d93a55f6b..55a9d9b4818c 100644
--- a/libcxx/docs/Cxx2aStatusIssuesStatus.csv
+++ b/libcxx/docs/Cxx2aStatusIssuesStatus.csv
@@ -15,7 +15,7 @@
 "","","","",""
 "`2779 `__","[networking.ts] Relax requirements on 
buffer sequence iterators","Albuquerque","",""
 "`2870 `__","Default value of parameter theta of 
polar should be dependent","Albuquerque","|Complete|",""
-"`2935 `__","What should create_directories do when 
p already exists but is not a directory?","Albuquerque","",""
+"`2935 `__","What should create_directories do when 
p already exists but is not a directory?","Albuquerque","|Nothing To Do|",""
 "`2941 `__","[thread.req.timing] wording should 
apply to both member and namespace-level functions","Albuquerque","|Nothing To 
Do|",""
 "`2944 `__","LWG 2905 accidentally removed 
requirement that construction of the deleter doesn't throw an 
exception","Albuquerque","|Nothing To Do|",""
 "`2945 `__","Order of template parameters in 
optional comparisons","Albuquerque","|Complete|",""
@@ -83,7 +83,7 @@
 "`3071 `__","[networking.ts] read_until still 
refers to ""input sequence""","Rapperswil","|Nothing To Do|",""
 "`3074 `__","Non-member functions for valarray 
should only deduce from the valarray","Rapperswil","",""
 "`3076 `__","basic_string CTAD 
ambiguity","Rapperswil","|Complete|",""
-"`3079 `__","LWG 2935 forgot to fix the existing_p 
overloads of create_directory","Rapperswil","",""
+"`3079 `__","LWG 2935 forgot to fix the existing_p 
overloads of create_directory","Rapperswil","|Nothing To Do|",""
 "`3080 `__","Floating point from_chars pattern 
specification breaks round-tripping","Rapperswil","",""
 "`3083 `__","What should ios::iword(-1) 
do?","Rapperswil","|Nothing To Do|",""
 "`3094 `__","[time.duration.io]p4 makes surprising 
claims about encoding","Rapperswil","",""

diff  --git a/libcxx/docs/Cxx2aStatusPaperStatus.csv 
b/libcxx/docs/Cxx2aStatusPaperStatus.csv
index 4efad23981cf..c495e0210cf7 100644
--- a/libcxx/docs/Cxx2aStatusPaperStatus.csv
+++ b/libcxx/docs/Cxx2aStatusPaperStatus.csv
@@ -87,7 +87,7 @@
 "`P0920R2 `__","LWG","Precalculated hash values in 
lookup","Kona","Reverted by `P1661 `__",""
 "`P1001R2 `__","LWG","Target Vectorization Policies 
from Parallelism V2 TS to C++20","Kona","",""
 "`P1024R3 `__","LWG","Usability Enhancements for 
std::span","Kona","|Complete|","9.0"
-"`P1164R1 `__","LWG","Make create_directory() 
Intuitive","Kona","",""
+"`P1164R1 `__","LWG","Make create_directory() 
Intuitive","Kona","|Complete|","12.0"
 "`P1227R2 `__","LWG","Signed ssize() functions, 
unsigned size() functions","Kona","|Complete|","9.0"
 "`P1252R2 `__","LWG","Ranges Design 
Cleanup","Kona","",""
 "`P1286R2 `__","CWG","Contra CWG 
DR1778","Kona","",""

diff  --git a/libcxx/src/filesystem/operations.cpp 
b/libcxx/src/filesystem/operations.cpp
index 6a259792477c..fb27d54cf653 100644
--- a/libcxx/src/filesystem/operations.cpp
+++ b/libcxx/src/filesystem/operations.cpp
@@ -849,8 +849,17 @@ bool __create_directory(const path& p, error_code* ec) {
 
   if (::mkdir(p.c_str(), static_cast(perms::all)) == 0)
 return t

[llvm-branch-commits] [libcxx] da97d12 - [libc++] Remove invalid use of `#if _LIBCPP_STD_VER >= 11`, as `_LIBCPP_STD_VER` can never be less than 11.

2020-12-10 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-11T08:31:59+01:00
New Revision: da97d12cc05a2474cd893b996c0d789f766d97b8

URL: 
https://github.com/llvm/llvm-project/commit/da97d12cc05a2474cd893b996c0d789f766d97b8
DIFF: 
https://github.com/llvm/llvm-project/commit/da97d12cc05a2474cd893b996c0d789f766d97b8.diff

LOG: [libc++] Remove invalid use of `#if _LIBCPP_STD_VER >= 11`, as 
`_LIBCPP_STD_VER` can never be less than 11.

The relevant part of `__config` is:
```
#ifndef _LIBCPP_STD_VER
#  if  __cplusplus <= 201103L
#define _LIBCPP_STD_VER 11
```

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D93025

Added: 


Modified: 
libcxx/include/atomic

Removed: 




diff  --git a/libcxx/include/atomic b/libcxx/include/atomic
index 5994b0c5..0fc799a24319 100644
--- a/libcxx/include/atomic
+++ b/libcxx/include/atomic
@@ -1503,8 +1503,6 @@ struct __cxx_atomic_impl : public _Base {
 using __cxx_contention_t = int64_t;
 #endif //__linux__
 
-#if _LIBCPP_STD_VER >= 11
-
 using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;
 
 #ifndef _LIBCPP_HAS_NO_PLATFORM_WAIT
@@ -1582,8 +1580,6 @@ _LIBCPP_INLINE_VISIBILITY bool __cxx_atomic_wait(_Atp* 
__a, _Tp const __val, mem
 return __cxx_atomic_wait(__a, __test_fn);
 }
 
-#endif //_LIBCPP_STD_VER >= 11
-
 // general atomic
 
 template ::value && !is_same<_Tp, 
bool>::value>



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


[llvm-branch-commits] [libcxx] 59c72a7 - [libc++] [P1164] Add tests for create_directories. NFC.

2020-12-14 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-12-14T17:27:18+01:00
New Revision: 59c72a70121567f7aee347e96b4ac8f3cfe9f4b2

URL: 
https://github.com/llvm/llvm-project/commit/59c72a70121567f7aee347e96b4ac8f3cfe9f4b2
DIFF: 
https://github.com/llvm/llvm-project/commit/59c72a70121567f7aee347e96b4ac8f3cfe9f4b2.diff

LOG: [libc++] [P1164] Add tests for create_directories. NFC.

That's a follow-up patch after D92769.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D93026

Added: 


Modified: 

libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp

Removed: 




diff  --git 
a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp
 
b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp
index 3098f33342b0..9ce450a0e48d 100644
--- 
a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp
+++ 
b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp
@@ -8,6 +8,9 @@
 
 // UNSUPPORTED: c++03
 
+// This test requires the dylib support introduced in D92769.
+// XFAIL: with_system_cxx_lib=macosx10.15
+
 // 
 
 // bool create_directories(const path& p);
@@ -75,12 +78,12 @@ TEST_CASE(create_directory_symlinks) {
 std::error_code ec = GetTestEC();
 TEST_CHECK(create_directories(target, ec) == false);
 TEST_CHECK(ec);
+TEST_CHECK(ErrorIs(ec, std::errc::file_exists));
 TEST_CHECK(!exists(sym_dest_dead));
 TEST_CHECK(!exists(dead_sym));
   }
 }
 
-
 TEST_CASE(create_directory_through_symlinks) {
   scoped_test_env env;
   const path root = env.create_dir("dir");
@@ -97,4 +100,42 @@ TEST_CASE(create_directory_through_symlinks) {
   }
 }
 
+TEST_CASE(dest_is_file)
+{
+scoped_test_env env;
+const path file = env.create_file("file", 42);
+std::error_code ec = GetTestEC();
+TEST_CHECK(fs::create_directories(file, ec) == false);
+TEST_CHECK(ec);
+TEST_CHECK(ErrorIs(ec, std::errc::file_exists));
+TEST_CHECK(is_regular_file(file));
+}
+
+TEST_CASE(dest_part_is_file)
+{
+scoped_test_env env;
+const path file = env.create_file("file");
+const path dir = env.make_env_path("file/dir1");
+std::error_code ec = GetTestEC();
+TEST_CHECK(fs::create_directories(dir, ec) == false);
+TEST_CHECK(ec);
+TEST_CHECK(ErrorIs(ec, std::errc::not_a_directory));
+TEST_CHECK(is_regular_file(file));
+TEST_CHECK(!exists(dir));
+}
+
+TEST_CASE(dest_final_part_is_file)
+{
+scoped_test_env env;
+env.create_dir("dir");
+const path file = env.create_file("dir/file");
+const path dir = env.make_env_path("dir/file/dir1");
+std::error_code ec = GetTestEC();
+TEST_CHECK(fs::create_directories(dir, ec) == false);
+TEST_CHECK(ec);
+TEST_CHECK(ErrorIs(ec, std::errc::not_a_directory));
+TEST_CHECK(is_regular_file(file));
+TEST_CHECK(!exists(dir));
+}
+
 TEST_SUITE_END()



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


[llvm-branch-commits] [libcxx] 0c14843 - Reland [libc++] [LWG3321] Mark "year_month_day_last::day() specification does not cover !ok() values" issue as "Nothing to do", but add assertion.

2020-05-21 Thread Marek Kurdej via llvm-branch-commits

Author: Marek Kurdej
Date: 2020-05-21T21:55:38+02:00
New Revision: 0c148430cf612762ca243aafe23b3fb9670d2797

URL: 
https://github.com/llvm/llvm-project/commit/0c148430cf612762ca243aafe23b3fb9670d2797
DIFF: 
https://github.com/llvm/llvm-project/commit/0c148430cf612762ca243aafe23b3fb9670d2797.diff

LOG: Reland [libc++] [LWG3321] Mark "year_month_day_last::day() specification 
does not cover !ok() values" issue as "Nothing to do", but add assertion.

Summary:
This LWG issue states that the result of `year_month_day_last::day()` is 
implementation defined if `ok()` is `false`.
However, from user perspective, calling `day()` in this situation will lead to 
a (possibly difficult to find) crash.
Hence, I have added an assertion to warn user at least when assertions are 
enabled.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D70346

Added: 


Modified: 
libcxx/include/chrono
libcxx/test/libcxx/algorithms/debug_less.pass.cpp
libcxx/www/cxx2a_status.html

Removed: 




diff  --git a/libcxx/include/chrono b/libcxx/include/chrono
index 6e5de398b72f..9913dc1d06c9 100644
--- a/libcxx/include/chrono
+++ b/libcxx/include/chrono
@@ -824,6 +824,7 @@ constexpr chrono::year  
operator ""y(unsigned lo
 */
 
 #include <__config>
+#include <__debug>
 #include 
 #include 
 #include 
@@ -2454,6 +2455,7 @@ chrono::day year_month_day_last::day() const noexcept
 chrono::day(31), chrono::day(31), chrono::day(30),
 chrono::day(31), chrono::day(30), chrono::day(31)
 };
+_LIBCPP_ASSERT(ok(), "year_month_day_last::day(): year_month_day_last is 
invalid");
 return month() != February || !__y.is_leap() ?
 __d[static_cast(month()) - 1] : chrono::day{29};
 }

diff  --git a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp 
b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
index 6dd56955001d..8a38a8053d42 100644
--- a/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
+++ b/libcxx/test/libcxx/algorithms/debug_less.pass.cpp
@@ -14,8 +14,13 @@
 
 // __debug_less checks that a comparator actually provides a strict-weak 
ordering.
 
+#include  // Include before defining _LIBCPP_ASSERT: cannot throw in a 
function marked noexcept.
+
 struct DebugException {};
 
+#ifdef _LIBCPP_ASSERT
+#undef _LIBCPP_ASSERT
+#endif
 #define _LIBCPP_DEBUG 0
 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : throw ::DebugException())
 

diff  --git a/libcxx/www/cxx2a_status.html b/libcxx/www/cxx2a_status.html
index 05914fc6832d..2a93d35feb50 100644
--- a/libcxx/www/cxx2a_status.html
+++ b/libcxx/www/cxx2a_status.html
@@ -439,7 +439,7 @@ Library Working group Issues Status
https://wg21.link/LWG3209";>3209Expression 
in year::ok() returns clause is 
ill-formedCologneComplete
 

-   https://wg21.link/LWG3231";>3231year_month_day_last::day
 specification does not cover !ok() 
valuesBelfast
+   https://wg21.link/LWG3231";>3231year_month_day_last::day
 specification does not cover !ok() 
valuesBelfastNothing to do
https://wg21.link/LWG3225";>3225zoned_time 
converting constructor shall not be 
noexceptBelfast
https://wg21.link/LWG3190";>3190std::allocator::allocate
 sometimes returns too little storageBelfast
https://wg21.link/LWG3218";>3218Modifier 
for %d parse flag does not match POSIX and format 
specificationBelfast



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