[PATCH] D134468: [Driver] Ignore -fmsc-version= -fms-compatibility-version= values smaller than 19

2022-09-22 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

A couple of notes/reminders that may help you make a decision here (I have no 
particular opinion as this doesn't impact how VS and microsoft/STL use Clang):

1. VS 2013's support lifecycle, documented at 
https://learn.microsoft.com/en-us/lifecycle/products/visual-studio-2013 , is 
ending soon: Apr 9, 2024.

2. VS 2013 was the last release before the current "v19" binary-compatible era 
(VS 2015/2017/2019/2022). Code compiled with VS 2013 can't link with any other 
version (the CRT became the UCRT and the STL changed) - I believe this makes it 
less likely that users are stuck on this version.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134468

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


[PATCH] D115685: [NFC] Fix typos in release notes

2021-12-14 Thread Stephan T. Lavavej via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8bd106a89172: [NFC] Fix typos in release notes. (authored by 
STL_MSFT).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115685

Files:
  clang-tools-extra/docs/ReleaseNotes.rst
  clang/docs/ReleaseNotes.rst
  libcxx/docs/ReleaseNotes.rst
  lld/docs/ReleaseNotes.rst
  polly/docs/ReleaseNotes.rst


Index: polly/docs/ReleaseNotes.rst
===
--- polly/docs/ReleaseNotes.rst
+++ polly/docs/ReleaseNotes.rst
@@ -19,7 +19,7 @@
 -polly-isl-arg=--no-schedule-serialize-sccs
 
 - The command line option -polly-loopfusion-greedy has been added.
-  This will agressively try to fuse any loop regardless of
+  This will aggressively try to fuse any loop regardless of
   profitability. The is what users might have expected what
   -polly-opt-fusion=max would do.
 
Index: lld/docs/ReleaseNotes.rst
===
--- lld/docs/ReleaseNotes.rst
+++ lld/docs/ReleaseNotes.rst
@@ -31,7 +31,7 @@
 * ``e_entry`` no longer falls back to the address of ``.text`` if the entry 
symbol does not exist.
   Instead, a value of 0 will be written.
   (`D110014 `_)
-* If ``-Map`` is specified, ``--cref`` will be printted to the specified file.
+* If ``-Map`` is specified, ``--cref`` will be printed to the specified file.
   (`D114663 `_)
 
 Architecture specific changes:
Index: libcxx/docs/ReleaseNotes.rst
===
--- libcxx/docs/ReleaseNotes.rst
+++ libcxx/docs/ReleaseNotes.rst
@@ -56,7 +56,7 @@
   randomization of both sides of partition for ``std::nth_element``)
 
 - Floating-point support for ``std::to_chars`` support has been added.
-  Thanks to Stephan T. Lavavej and Microsoft for providing their implemention
+  Thanks to Stephan T. Lavavej and Microsoft for providing their implementation
   to libc++.
 
 API Changes
@@ -65,11 +65,11 @@
 - The functions ``std::atomic::fetch_(add|sub)`` and
   ``std::atomic_fetch_(add|sub)`` no longer accept a function pointer. While
   this is technically an API break, the invalid syntax isn't supported by
-  libstc++ and MSVC STL.  See https://godbolt.org/z/49fvzz98d.
+  libstdc++ and MSVC STL.  See https://godbolt.org/z/49fvzz98d.
 
 - The call of the functions ``std::atomic_(add|sub)(std::atomic*, ...)``
   with the explicit template argument ``T`` are now ill-formed. While this is
-  technically an API break, the invalid syntax isn't supported by libstc++ and
+  technically an API break, the invalid syntax isn't supported by libstdc++ and
   MSVC STL. See https://godbolt.org/z/v9959re3v.
 
   Due to this change it's now possible to call these functions with the
@@ -125,7 +125,7 @@
   culminated in over 5 different ways to build the runtimes, which made it 
impossible to
   maintain with a good level of support. Starting with this release, the 
runtimes support
   exactly two ways of being built, which should cater to all use-cases. 
Furthermore,
-  these builds are as lightweight as possible and will work consistently even 
when targetting
+  these builds are as lightweight as possible and will work consistently even 
when targeting
   embedded platforms, which used not to be the case. Please see the 
documentation on building
   libc++ to see those two ways of building and migrate over to the appropriate 
build instructions
   as soon as possible.
Index: clang/docs/ReleaseNotes.rst
===
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -237,7 +237,7 @@
   rather than -ffp-contract=fast, and the documentation of these features has
   been clarified. Previously, the documentation claimed that -ffp-model=precise
   was the default, but this was incorrect because the precise model implied
-  -ffp-contract=fast, wheras the (now corrected) default behavior is
+  -ffp-contract=fast, whereas the (now corrected) default behavior is
   -ffp-contract=on.
   -ffp-model=precise is now exactly the default mode of the compiler.
 
@@ -276,7 +276,7 @@
 - Option ``AllowShortEnumsOnASingleLine: false`` has been improved, it now
   correctly places the opening brace according to ``BraceWrapping.AfterEnum``.
 
-- Option ``QualifierAligment`` has been added in order to auto-arrange the
+- Option ``QualifierAlignment`` has been added in order to auto-arrange the
   positioning of specifiers/qualifiers
   `const` `volatile` `static` `inline` `constexpr` `restrict`
   in variable and parameter declarations to be either ``Right`` aligned
Index: clang-tools-extra/docs/ReleaseNotes.rst
===
--- 

[PATCH] D115685: [NFC] Fix typos in release notes

2021-12-13 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: ldionne, Mordante, EricWF, mclow.lists.
Herald added a reviewer: bollu.
Herald added a reviewer: MaskRay.
STL_MSFT requested review of this revision.
Herald added projects: clang, libc++, clang-tools-extra.
Herald added subscribers: cfe-commits, libcxx-commits.
Herald added a reviewer: libc++.

This fixes a few typos in release notes throughout the monorepo.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115685

Files:
  clang-tools-extra/docs/ReleaseNotes.rst
  clang/docs/ReleaseNotes.rst
  libcxx/docs/ReleaseNotes.rst
  lld/docs/ReleaseNotes.rst
  polly/docs/ReleaseNotes.rst


Index: polly/docs/ReleaseNotes.rst
===
--- polly/docs/ReleaseNotes.rst
+++ polly/docs/ReleaseNotes.rst
@@ -19,7 +19,7 @@
 -polly-isl-arg=--no-schedule-serialize-sccs
 
 - The command line option -polly-loopfusion-greedy has been added.
-  This will agressively try to fuse any loop regardless of
+  This will aggressively try to fuse any loop regardless of
   profitability. The is what users might have expected what
   -polly-opt-fusion=max would do.
 
Index: lld/docs/ReleaseNotes.rst
===
--- lld/docs/ReleaseNotes.rst
+++ lld/docs/ReleaseNotes.rst
@@ -31,7 +31,7 @@
 * ``e_entry`` no longer falls back to the address of ``.text`` if the entry 
symbol does not exist.
   Instead, a value of 0 will be written.
   (`D110014 `_)
-* If ``-Map`` is specified, ``--cref`` will be printted to the specified file.
+* If ``-Map`` is specified, ``--cref`` will be printed to the specified file.
   (`D114663 `_)
 
 Architecture specific changes:
Index: libcxx/docs/ReleaseNotes.rst
===
--- libcxx/docs/ReleaseNotes.rst
+++ libcxx/docs/ReleaseNotes.rst
@@ -56,7 +56,7 @@
   randomization of both sides of partition for ``std::nth_element``)
 
 - Floating-point support for ``std::to_chars`` support has been added.
-  Thanks to Stephan T. Lavavej and Microsoft for providing their implemention
+  Thanks to Stephan T. Lavavej and Microsoft for providing their implementation
   to libc++.
 
 API Changes
@@ -65,11 +65,11 @@
 - The functions ``std::atomic::fetch_(add|sub)`` and
   ``std::atomic_fetch_(add|sub)`` no longer accept a function pointer. While
   this is technically an API break, the invalid syntax isn't supported by
-  libstc++ and MSVC STL.  See https://godbolt.org/z/49fvzz98d.
+  libstdc++ and MSVC STL.  See https://godbolt.org/z/49fvzz98d.
 
 - The call of the functions ``std::atomic_(add|sub)(std::atomic*, ...)``
   with the explicit template argument ``T`` are now ill-formed. While this is
-  technically an API break, the invalid syntax isn't supported by libstc++ and
+  technically an API break, the invalid syntax isn't supported by libstdc++ and
   MSVC STL. See https://godbolt.org/z/v9959re3v.
 
   Due to this change it's now possible to call these functions with the
@@ -125,7 +125,7 @@
   culminated in over 5 different ways to build the runtimes, which made it 
impossible to
   maintain with a good level of support. Starting with this release, the 
runtimes support
   exactly two ways of being built, which should cater to all use-cases. 
Furthermore,
-  these builds are as lightweight as possible and will work consistently even 
when targetting
+  these builds are as lightweight as possible and will work consistently even 
when targeting
   embedded platforms, which used not to be the case. Please see the 
documentation on building
   libc++ to see those two ways of building and migrate over to the appropriate 
build instructions
   as soon as possible.
Index: clang/docs/ReleaseNotes.rst
===
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -237,7 +237,7 @@
   rather than -ffp-contract=fast, and the documentation of these features has
   been clarified. Previously, the documentation claimed that -ffp-model=precise
   was the default, but this was incorrect because the precise model implied
-  -ffp-contract=fast, wheras the (now corrected) default behavior is
+  -ffp-contract=fast, whereas the (now corrected) default behavior is
   -ffp-contract=on.
   -ffp-model=precise is now exactly the default mode of the compiler.
 
@@ -273,7 +273,7 @@
 - Option ``AllowShortEnumsOnASingleLine: false`` has been improved, it now
   correctly places the opening brace according to ``BraceWrapping.AfterEnum``.
 
-- Option ``QualifierAligment`` has been added in order to auto-arrange the
+- Option ``QualifierAlignment`` has been added in order to auto-arrange the
   positioning of specifiers/qualifiers
   `const` `volatile` `static` `inline` `constexpr` `restrict`
   in variable and parameter declarations to be either ``Right`` aligned
Index: 

[PATCH] D105951: [clang] P2266 implicit moves STL workaround

2021-07-21 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

FYI, we merged https://github.com/microsoft/STL/pull/2025 fixing the 2 affected 
`return _Istr;` occurrences in `` and `` for VS 2022 17.0 
Preview 4. If you find any other affected return statements, please let us know 
ASAP (as the VS release process locks down the release branch far in advance).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105951

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


[PATCH] D70791: Workaround for MSVC 16.3.* pre-c++17 type trait linkage

2019-12-04 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

> I would like to revive D66394  to get it 
> disabled by default soon.

As I recently informed @thakis via email, our compiler documentation was 
incorrect (I've informed the doc team and they're going to publish a fixed 
article soon). MSVC's behavior defaults to Microsoft one-phase (delayed 
template lookup) as it always has, changes to Standard two-phase under 
`/permissive-`, and can be escape-hatched back to Microsoft one-phase with 
`/permissive- /Zc:twoPhase-`.


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

https://reviews.llvm.org/D70791



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


[PATCH] D19031: [clang-format] Flexible line endings

2019-11-14 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

MSVC's STL currently uses CRLF (DOS) line endings, not LF (Unix). I wrote a 
validator, 
https://github.com/microsoft/STL/blob/58bb49d63d92e7a0346a05af29816aeea6b4cf0f/tools/validate/validate.cpp
 , to detect LF files, mixed line endings (LF and CRLF in the same file), 
damaged endings (CR only), and enforcing one newline at the end of every file, 
because clang-format doesn't currently handle those whitespace issues.


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

https://reviews.llvm.org/D19031



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


[PATCH] D69981: [www] More HTTPS and outdated link fixes.

2019-11-08 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT accepted this revision.
STL_MSFT added a comment.
This revision is now accepted and ready to land.

Committed: 
https://github.com/llvm/llvm-project/commit/3a7a22445e806c08f80cf6d83d1760f7ff732ed0


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69981



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


[PATCH] D69981: [www] More HTTPS and outdated link fixes.

2019-11-07 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: ldionne, zoecarver.
Herald added a reviewer: bollu.
Herald added subscribers: llvm-commits, arphaman, dexonsmith.
Herald added projects: clang, LLVM.

[www] More HTTPS and outdated link fixes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69981

Files:
  clang/www/UniversalDriver.html
  clang/www/analyzer/available_checks.html
  llvm/docs/_templates/layout.html
  polly/www/contributors.html
  polly/www/index.html
  polly/www/performance.html
  polly/www/publications.html

Index: polly/www/publications.html
===
--- polly/www/publications.html
+++ polly/www/publications.html
@@ -32,7 +32,7 @@
   representation 
 Tobias Grosser, Armin Groesslinger, Christian Lengauer
 Parallel Processing Letters 2012 22:04
-  http://www.grosser.es#pub-Polly;>Paper
+  https://www.grosser.es#pub-Polly;>Paper
 
 
Publications involving Polly 
@@ -53,7 +53,7 @@
   Felix-Antoine Quellet
   Master Thesis, Universite de Sherbrooke
   http://savoirs.usherbrooke.ca/bitstream/handle/11143/8171/Ouellet_Felix_Antoine_MSc_2016.pdf?sequence=4;>Thesis
+  href="https://savoirs.usherbrooke.ca/bitstream/handle/11143/8171/Ouellet_Felix_Antoine_MSc_2016.pdf?sequence=4;>Thesis
   
   
2015 
@@ -62,7 +62,7 @@
   Tobias Grosser, Sven Verdoolaege, Albert Cohen
ACM Transations on Programming Languages and Systems (TOPLAS), 37(4), July
2015
-  http://www.grosser.es#pub-polyhedral-AST-generation;>Paper
+  https://www.grosser.es#pub-polyhedral-AST-generation;>Paper
   
   On recovering multi-dimensional arrays in Polly
   Tobias Grosser, Sebastian Pop, J. Ramanujam, P. Sadayappan 
@@ -81,7 +81,7 @@
   Lattice QCD Optimization and Polytopic Representations of Distributed Memory 
   Michael Kruse
   Doctoral Thesis,  Ecole doctorale Informatique de Paris-Sud
-  http://www.theses.fr/2014PA112198;>Thesis
+  https://www.theses.fr/2014PA112198;>Thesis
   
   
2012 
Index: polly/www/performance.html
===
--- polly/www/performance.html
+++ polly/www/performance.html
@@ -17,7 +17,7 @@
 https://web.cse.ohio-state.edu/~pouchet.2/software/polybench/;>Polybench
 2.0 benchmark suite.  Each benchmark was run with double precision floating
 point values on an Intel Core Xeon X5670 CPU @ 2.93GHz (12 cores, 24 thread)
-system. We used http://pocc.sf.net;>PoCC and the included https://sourceforge.net/projects/pocc/files/;>PoCC and the included http://pluto-compiler.sf.net;>Pluto transformations to optimize the
 code. The source code of Polly and LLVM/clang was checked out on
 25/03/2011.
Index: polly/www/index.html
===
--- polly/www/index.html
+++ polly/www/index.html
@@ -115,7 +115,7 @@
   program optimization.
 
 
-   http://www.grosser.es#pub-polyhedral-AST-generation;>
+   https://www.grosser.es#pub-polyhedral-AST-generation;>
Polyhedral AST generation is more than scanning polyhedra
 Tobias Grosser, Sven Verdoolaege, Albert Cohen
 ACM Transations on Programming Languages and Systems (TOPLAS), 37(4),
@@ -335,9 +335,9 @@
   
   June
   
-  http://www.grosser.es;>Tobias is founded for
+  https://www.grosser.es;>Tobias is founded for
   three years by a http://research.google.com/university/relations/fellowship_recipients.html;>
+  href="https://ai.google/research/outreach/phd-fellowship/recipients/?category=2011;>
   Google Europe Fellowship in Efficient Computing.
   
   
@@ -345,7 +345,7 @@
 
   
   May 
-  http://www.grosser.es;>Tobias' diploma thesis and
+  https://www.grosser.es;>Tobias' diploma thesis and
   Raghesh's master thesis. See our list of publications.
   
Index: polly/www/contributors.html
===
--- polly/www/contributors.html
+++ polly/www/contributors.html
@@ -37,7 +37,7 @@
 http://research.google.com/university/relations/fellowship_recipients.html;>
 Google Europe Fellowship in Efficient Computing).
 
-Website: http://www.grosser.es;>www.grosser.es
+Website: https://www.grosser.es;>www.grosser.es
 
 
 Andreas Simbrger
@@ -45,8 +45,8 @@
 Andreas works on the profiling infrastructure during his PhD at University of
 Passau.
 
-Website: http://www.infosun.fim.uni-passau.de/cl/staff/simbuerger/;>
-http://www.infosun.fim.uni-passau.de/cl/staff/simbuerger/
+Website: https://www.infosun.fim.uni-passau.de/cl/staff/simbuerger/;>
+https://www.infosun.fim.uni-passau.de/cl/staff/simbuerger/
 Hongbin Zheng
 Hongbin Zheng is one of the two Co-founders of Polly. He was funded as a
 Google Summer of Code Student 2010 and implemented parts of the Polly frontends
Index: llvm/docs/_templates/layout.html
===
--- llvm/docs/_templates/layout.html
+++ llvm/docs/_templates/layout.html
@@ -8,6 +8,6 @@
 {% endblock %}
 
 {% block rootrellink 

[PATCH] D69363: [www] Change URLs to HTTPS.

2019-10-24 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT closed this revision.
STL_MSFT added a comment.

Committed: 
https://github.com/llvm/llvm-project/commit/2e4f1e112dfee1d16c138d42f2bc7ee639f9ae05


Repository:
  rC Clang

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

https://reviews.llvm.org/D69363



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


[PATCH] D69363: [www] Change URLs to HTTPS.

2019-10-23 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT marked an inline comment as done.
STL_MSFT added inline comments.



Comment at: clang/www/cxx_status.html:78
   Rvalue references
-  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html;>N2118
+  https://wg21.link/n2118;>N2118
   Clang 2.9

zoecarver wrote:
> These will all now redirect. Maybe that's OK/better because they are now more 
> uniform, though. 
Yep, that's intentional for consistency with the newer papers that were already 
using the official redirector. (It's my hope that open-std will eventually 
support https so the destination is secure; if and when that happens, these 
will automatically be enhanced.)


Repository:
  rC Clang

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

https://reviews.llvm.org/D69363



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


[PATCH] D69363: [www] Change URLs to HTTPS.

2019-10-23 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, ldionne, mclow.lists, zoecarver.
Herald added a reviewer: bollu.
Herald added subscribers: llvm-commits, arphaman, dexonsmith, christof.
Herald added a reviewer: jdoerfert.
Herald added projects: clang, LLVM.

This changes most URLs in llvm's html files to HTTPS. Most changes were 
search-and-replace with manual verification; some changes were manual. For a 
few URLs, the websites were performing redirects or had changed their anchors; 
I fixed those up manually. There are a very small number of dead links for 
which I don't know any replacements (they are equally dead as HTTP or HTTPS).

I have this structured as a series of git commits with mechanical and manual 
replacements separated, but I don't know how to present that through 
Differential (as GitHub PRs aren't available yet).


Repository:
  rC Clang

https://reviews.llvm.org/D69363

Files:
  clang/www/OpenProjects.html
  clang/www/UniversalDriver.html
  clang/www/analyzer/alpha_checks.html
  clang/www/analyzer/annotations.html
  clang/www/analyzer/available_checks.html
  clang/www/analyzer/checker_dev_manual.html
  clang/www/analyzer/faq.html
  clang/www/analyzer/filing_bugs.html
  clang/www/analyzer/implicit_checks.html
  clang/www/analyzer/index.html
  clang/www/analyzer/installation.html
  clang/www/analyzer/open_projects.html
  clang/www/analyzer/potential_checkers.html
  clang/www/analyzer/release_notes.html
  clang/www/analyzer/scan-build.html
  clang/www/analyzer/xcode.html
  clang/www/comparison.html
  clang/www/compatibility.html
  clang/www/cxx_compatibility.html
  clang/www/cxx_dr_status.html
  clang/www/cxx_status.html
  clang/www/demo/DemoInfo.html
  clang/www/features.html
  clang/www/get_involved.html
  clang/www/get_started.html
  clang/www/hacking.html
  clang/www/index.html
  clang/www/related.html
  compiler-rt/www/index.html
  libclc/www/index.html
  libcxx/www/index.html
  libcxxabi/www/index.html
  libcxxabi/www/spec.html
  openmp/www/index.html
  polly/www/changelog.html
  polly/www/documentation.html
  polly/www/get_started.html
  polly/www/index.html
  polly/www/performance.html
  polly/www/phonecall.html
  polly/www/projects.html
  polly/www/publications.html
  polly/www/todo.html



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


[PATCH] D66770: Move EH spec mismatches under -fms-compatibility

2019-08-26 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

This will definitely help us clean up our code, since we run the MSVC STL test 
suite with `-fno-ms-compatibility -fno-delayed-template-parsing`.

Other possible occurrences of ms-extensions that should be considered 
ms-compatibility:

- ParseDeclCXX.cpp says "MSVC permits pure specifier on inline functions 
defined at class scope." which sounds like a rule relaxation.
- Parser.cpp says "MS compatibility: MSVC permits using known types with 
typename. e.g. "typedef typename T* pointer_type"" while downgrading an error 
to a warning. Seems like this should be ms-compatibility.
- SemaCast.cpp says "C++ 5.2.10p4: A pointer can be explicitly converted to any 
integral type large enough to hold it; except in Microsoft mode, where the 
integral type size doesn't matter (except we don't allow bool)." This 
definitely seems like ms-compatibility.
- ParseExprCXX.cpp says "We have something like t::getAs, where getAs is a 
member of an unknown specialization. However, this will only parse correctly as 
a template, so suggest the keyword 'template' before 'getAs' and treat this as 
a dependent template name." while downgrading an error to a warning.

I might regret asking about some of these, if Clang begins erroring on WinSDK 
etc. code that can't be rapidly updated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66770



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


[PATCH] D17444: [MSVC] Recognize "static_assert" keyword in C mode

2019-02-13 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

@rnk I've forwarded this to the compiler front-end and Universal CRT teams.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D17444



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


[PATCH] D53912: [Headers] [MS] Add intrin0.h

2018-11-02 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Yes, the "real builtin" approach seems to be best. For a recent example, 
https://reviews.llvm.org/D49606 added `__shiftright128` as an inline function 
in intrin.h, but that didn't work with MSVC's STL when I moved our declaration 
of `__shiftright128` from intrin.h to intrin0.h. This was fixed by 
https://reviews.llvm.org/D50907 making `__shiftright128` a real builtin.

For the record, MSVC's intrin.h declares ~880 intrinsics (plus many many more 
from immintrin.h etc.) and it includes intrin0.h to get the declarations of 
~130 intrinsics. There is no duplication - each intrinsic is declared in either 
the small intrin0.h or the large intrin.h. MSVC's STL then includes intrin0.h 
in its headers for increased throughput. We occasionally move intrinsics from 
intrin.h to intrin0.h as we discover that they're needed in the STL (as we've 
recently done for `__shiftright128`, `_umul128`, `_BitScanForward[64]`, and 
`_BitScanReverse[64]`).


Repository:
  rC Clang

https://reviews.llvm.org/D53912



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


[PATCH] D52843: Update Clang Windows getting started docs

2018-10-03 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added inline comments.



Comment at: clang/www/get_started.html:160
 http://www.cmake.org/cmake/resources/software.html;>
 http://www.cmake.org/cmake/resources/software.html
+Visual Studio 2015 or later

This URL redirects to `https://cmake.org/download/`. (Clang's docs should use 
HTTPS everywhere possible, especially for self-links.)



Comment at: clang/www/get_started.html:164
 http://www.python.org/download/;>
 http://www.python.org/download/
 GnuWin32 tools

Redirected to `https://www.python.org/downloads/`.



Comment at: clang/www/get_started.html:179
   
 svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
   

Can these be HTTPS? (I had to figure out HTTPS incantations for `git clone` and 
`git svn init`, but I haven't used SVN directly.)



Comment at: clang/www/get_started.html:246
+"C:\Program Files (x86)\Microsoft Visual
+  Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64
+  

This assumes the Professional SKU; perhaps the instructions should be for 
Community?


https://reviews.llvm.org/D52843



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


[PATCH] D51868: [libcxx] Build and test fixes for Windows

2018-09-18 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added inline comments.



Comment at: test/support/test_macros.h:147
-#  elif defined(_WIN32)
-#if defined(_MSC_VER) && !defined(__MINGW32__)
-#  define TEST_HAS_C11_FEATURES // Using Microsoft's C Runtime library

compnerd wrote:
> I think that the condition here is inverted, and should be enabled for 
> MinGW32.
What error prompted this? It hasn't caused problems when running libc++'s tests 
against MSVC's STL (with both C1XX and Clang).


Repository:
  rCXX libc++

https://reviews.llvm.org/D51868



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


[PATCH] D49338: Implement - P0122R7

2018-07-16 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added inline comments.



Comment at: test/std/containers/views/span.comparison/op.eq.pass.cpp:23
+#include 
+#include 
+

The comparison tests appear to be unnecessarily including ``.



Comment at: test/std/containers/views/span.cons/assign.pass.cpp:25
+{
+static_assert(noexcept(std::declval() = rhs), "");
+lhs = rhs;

Technically need `` for declval.



Comment at: test/std/containers/views/span.cons/assign.pass.cpp:73
+
+//  No for loops in constexpr land :-(
+static_assert(doAssign(spans[0], spans[0]), "");

span is C++20, so you can use C++14 extended constexpr's for-loops. Just write 
a helper function.



Comment at: test/std/containers/views/span.cons/container.fail.cpp:44
+
+constexpr T const *getV() const {return _;} // for checking
+T v_;

This file is inconsistent about left vs right const (see line immediately 
above).



Comment at: test/std/containers/views/span.cons/deduct.pass.cpp:45
+using S = decltype(s);
+static_assert(std::is_same_v>, "");
+assert((std::equal(std::begin(arr), std::end(arr), s.begin(), s.end(;

Technically need `` for is_same_v.



Comment at: test/std/containers/views/span.cons/default.pass.cpp:61
+std::span s2;
+return
+assert(s1.data() == nullptr && s1.size() == 0);

This return appears to be spurious.



Comment at: test/std/containers/views/span.cons/span.pass.cpp:96
+std::spans2(s1); // static -> dynamic
+return
+assert(s1.data() == nullptr && s1.size() == 0);

Spurious return occurs in multiple files.



Comment at: test/std/containers/views/span.iterators/begin.pass.cpp:31
+{
+ret &= ( b ==  s.end());
+ret &= (cb == s.cend());

Using bitwise &= on a bool isn't very cromulent.



Comment at: test/std/containers/views/span.iterators/rbegin.pass.cpp:115
+std::string s;
+testRuntimeSpan(std::span(, (std::ptrdiff_t) 0));
+testRuntimeSpan(std::span(, 1));

static_cast would be nicer than C cast.



Comment at: test/std/containers/views/span.objectrep/as_bytes.pass.cpp:31
+{
+static_assert(noexcept(std::as_bytes(sp)));
+

This is a C++17 terse static assert unlike your others. Should you consistently 
use this form, or the other one?



Comment at: 
test/std/containers/views/span.objectrep/as_writeable_bytes.pass.cpp:42
+
+assert((void *) spBytes.data() == (void *) sp.data());
+assert(spBytes.size() == sp.size_bytes());

static_cast?



Comment at: test/std/containers/views/span.sub/last.pass.cpp:44
+ && s1.size() == s2.size()
+ && std::equal(s1.begin(), s1.end(), sp.end() - Count);
+}

Need ``.



Comment at: test/std/containers/views/span.sub/subspan.pass.cpp:45
+ && s1.size() == s2.size()
+ && std::equal(s1.begin(), s1.end(), sp.begin() + Offset);
+}

Also need ``, presumably occurs in more files.



Comment at: test/std/containers/views/types.pass.cpp:41
+{
+typedef std::iterator_traits ItT;
+

Need ``.


https://reviews.llvm.org/D49338



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


[PATCH] D48616: Implement LWG 2946, 3075 and 3076

2018-06-26 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added inline comments.



Comment at: 
test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp:26
+//  The deduction guide shall not participate in overload resolution if 
Allocator is
+//  is a type that does not qualify as an allocator.
+

Repeated "is", occurs repeatedly in other files.



Comment at: 
test/std/strings/basic.string/string.cons/string_view_deduction.fail.cpp:37
+{
+std::string_view sv = "12345678901234";
+std::basic_string s1{sv, 23}; // 23 is not an allocator!

You need to include ``, occurs in other files.



Comment at: 
test/std/strings/basic.string/string.cons/string_view_deduction.pass.cpp:32
+#include 
+#include 
+

You technically need `` for std::allocator, `` for 
std::is_same_v.



Comment at: 
test/std/strings/basic.string/string.nonmembers/string.special/swap_noexcept.pass.cpp:38
 some_alloc(const some_alloc&);
+   T *allocate(size_t);
 void deallocate(void*, unsigned) {}

Weird indentation here - is there a tab instead of spaces? Occurs below.


https://reviews.llvm.org/D48616



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


[PATCH] D45595: [libcxx] [test] Fix nodiscard warnings.

2018-04-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT closed this revision.
STL_MSFT added a comment.

Committed with a follow-up to use the requested macro.


https://reviews.llvm.org/D45595



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


[PATCH] D45016: [libcxx] [test] Avoid MSVC truncation warnings.

2018-04-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT accepted this revision.
STL_MSFT added a comment.
This revision is now accepted and ready to land.

Approved by Eric.


https://reviews.llvm.org/D45016



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


[PATCH] D45594: [libcxx] [test] Silence MSVC warning C4146.

2018-04-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT closed this revision.
STL_MSFT added a comment.

Committed, with a follow-up to use the C1XX macro.


https://reviews.llvm.org/D45594



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


[PATCH] D45596: [libcxx] [test] Avoid unary_function.

2018-04-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.

[libcxx] [test] Avoid unary_function.

Replace unary_function inheritance (which was never required,
even in C++98) with argument_type and result_type typedefs.
This increases portability, as unary_function was removed in C++17
and MSVC has implemented that removal.


https://reviews.llvm.org/D45596

Files:
  test/support/Counter.h


Index: test/support/Counter.h
===
--- test/support/Counter.h
+++ test/support/Counter.h
@@ -45,8 +45,10 @@
 
 template 
 struct hash
-: public std::unary_function
 {
+typedef Counter argument_type;
+typedef std::size_t result_type;
+
 std::size_t operator()(const Counter& x) const {return 
std::hash(x.get());}
 };
 }


Index: test/support/Counter.h
===
--- test/support/Counter.h
+++ test/support/Counter.h
@@ -45,8 +45,10 @@
 
 template 
 struct hash
-: public std::unary_function
 {
+typedef Counter argument_type;
+typedef std::size_t result_type;
+
 std::size_t operator()(const Counter& x) const {return std::hash(x.get());}
 };
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D45595: [libcxx] [test] Fix nodiscard warnings.

2018-04-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.

[libcxx] [test] Fix nodiscard warnings.

MSVC's STL has marked to_bytes/from_bytes as nodiscard.


https://reviews.llvm.org/D45595

Files:
  
test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp


Index: 
test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
===
--- 
test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
+++ 
test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
@@ -33,15 +33,15 @@
 Myconv myconv;
 try
 {
-myconv.to_bytes(L"\xDA83");
+(void)myconv.to_bytes(L"\xDA83");
 assert(false);
 }
 catch (const std::range_error&)
 {
 }
 try
 {
-myconv.from_bytes('\xA5');
+(void)myconv.from_bytes('\xA5');
 assert(false);
 }
 catch (const std::range_error&)
@@ -56,7 +56,7 @@
 #ifndef TEST_HAS_NO_EXCEPTIONS
 try
 {
-myconv.from_bytes('\xA5');
+(void)myconv.from_bytes('\xA5');
 assert(false);
 }
 catch (const std::range_error&)


Index: test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
===
--- test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
+++ test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_err_string.pass.cpp
@@ -33,15 +33,15 @@
 Myconv myconv;
 try
 {
-myconv.to_bytes(L"\xDA83");
+(void)myconv.to_bytes(L"\xDA83");
 assert(false);
 }
 catch (const std::range_error&)
 {
 }
 try
 {
-myconv.from_bytes('\xA5');
+(void)myconv.from_bytes('\xA5');
 assert(false);
 }
 catch (const std::range_error&)
@@ -56,7 +56,7 @@
 #ifndef TEST_HAS_NO_EXCEPTIONS
 try
 {
-myconv.from_bytes('\xA5');
+(void)myconv.from_bytes('\xA5');
 assert(false);
 }
 catch (const std::range_error&)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D45594: [libcxx] [test] Silence MSVC warning C4146.

2018-04-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.

[libcxx] [test] Silence MSVC warning C4146.

This test code triggers the MSVC warning:

"unary minus operator applied to unsigned type, result still unsigned"

Although it would be possible to change the test code to avoid
this warning, I have chosen to simply silence it.


https://reviews.llvm.org/D45594

Files:
  
test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp


Index: 
test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
===
--- 
test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
+++ 
test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
@@ -22,6 +22,10 @@
 #include 
 #include "test_iterators.h"
 
+#ifdef _MSC_VER
+#pragma warning(disable: 4146) // unary minus operator applied to unsigned 
type, result still unsigned
+#endif
+
 typedef std::num_get F;
 
 class my_facet


Index: test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
===
--- test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
+++ test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
@@ -22,6 +22,10 @@
 #include 
 #include "test_iterators.h"
 
+#ifdef _MSC_VER
+#pragma warning(disable: 4146) // unary minus operator applied to unsigned type, result still unsigned
+#endif
+
 typedef std::num_get F;
 
 class my_facet
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D45016: [libcxx] [test] Avoid MSVC truncation warnings.

2018-04-09 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Ping?


https://reviews.llvm.org/D45016



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


[PATCH] D45016: [libcxx] [test] Avoid MSVC truncation warnings.

2018-03-28 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.

[libcxx] [test] Avoid MSVC truncation warnings.

MSVC emits "warning C4244: 'initializing': conversion from 'int'
to 'short', possible loss of data" when it sees pair
constructed from (whatever, 4), because int is being truncated to
short within pair's constructor. (The compiler doesn't take into
account the fact that 4 is a literal at the callsite; it generates
this warning when the constructor is instantiated, because it might
be called with a runtime-valued int that would actually truncate.)

Instead of static_cast, we can simply change short to int
in these tests, without affecting the pair operations that they're
trying to test: move assignment, convert copy construction, and
convert move construction.


https://reviews.llvm.org/D45016

Files:
  test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
  test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
  test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp


Index: test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
===
--- test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
+++ test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
@@ -67,7 +67,7 @@
 int main()
 {
 {
-typedef std::pair P1;
+typedef std::pair P1;
 typedef std::pair P2;
 P1 p1(std::unique_ptr(), 4);
 P2 p2 = std::move(p1);
Index: test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
===
--- test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
+++ test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
@@ -57,7 +57,7 @@
 int main()
 {
 {
-typedef std::pair P1;
+typedef std::pair P1;
 typedef std::pair P2;
 const P1 p1(3, 4);
 const P2 p2 = p1;
@@ -154,7 +154,7 @@
 }
 #if TEST_STD_VER > 11
 {
-typedef std::pair P1;
+typedef std::pair P1;
 typedef std::pair P2;
 constexpr P1 p1(3, 4);
 constexpr P2 p2 = p1;
Index: test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
===
--- test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
+++ test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
@@ -49,7 +49,7 @@
 int main()
 {
 {
-typedef std::pair P;
+typedef std::pair P;
 P p1(std::unique_ptr(new int(3)), 4);
 P p2;
 p2 = std::move(p1);


Index: test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
===
--- test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
+++ test/std/utilities/utility/pairs/pairs.pair/rv_pair_U_V.pass.cpp
@@ -67,7 +67,7 @@
 int main()
 {
 {
-typedef std::pair P1;
+typedef std::pair P1;
 typedef std::pair P2;
 P1 p1(std::unique_ptr(), 4);
 P2 p2 = std::move(p1);
Index: test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
===
--- test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
+++ test/std/utilities/utility/pairs/pairs.pair/const_pair_U_V.pass.cpp
@@ -57,7 +57,7 @@
 int main()
 {
 {
-typedef std::pair P1;
+typedef std::pair P1;
 typedef std::pair P2;
 const P1 p1(3, 4);
 const P2 p2 = p1;
@@ -154,7 +154,7 @@
 }
 #if TEST_STD_VER > 11
 {
-typedef std::pair P1;
+typedef std::pair P1;
 typedef std::pair P2;
 constexpr P1 p1(3, 4);
 constexpr P2 p2 = p1;
Index: test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
===
--- test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
+++ test/std/utilities/utility/pairs/pairs.pair/assign_rv_pair.pass.cpp
@@ -49,7 +49,7 @@
 int main()
 {
 {
-typedef std::pair P;
+typedef std::pair P;
 P p1(std::unique_ptr(new int(3)), 4);
 P p2;
 p2 = std::move(p1);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D43273: [libcxx] [test] Fix MSVC warnings and errors.

2018-02-21 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT updated this revision to Diff 135352.
STL_MSFT added a comment.

Update based on code review feedback.


https://reviews.llvm.org/D43273

Files:
  test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
  test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
  test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
  test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
  test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
  
test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
  
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
  
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
  
test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
  
test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp

Index: test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
===
--- test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
+++ test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
@@ -16,6 +16,7 @@
 
 #include 
 #include 
+#include 
 #include "test_macros.h"
 
 #if TEST_HAS_BUILTIN_IDENTIFIER(__reference_binds_to_temporary)
Index: test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
===
--- test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
+++ test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
@@ -52,7 +52,7 @@
 {
 // https://bugs.llvm.org/show_bug.cgi?id=31454
 std::basic_string s;
-veryLarge vl;
+veryLarge vl = {};
 s.push_back(vl);
 s.push_back(vl);
 s.push_back(vl);
Index: test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
===
--- test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
+++ test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
@@ -87,50 +87,50 @@
 }
 }
 
-int triangle(int n) { return n*(n+1)/2; }
+size_t triangle(size_t n) { return n*(n+1)/2; }
 
 //  Basic sanity
 void basic_tests()
 {
 {
-std::vector v(10);
+std::vector v(10);
 std::fill(v.begin(), v.end(), 3);
-std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, 50);
+std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{50});
 for (size_t i = 0; i < v.size(); ++i)
-assert(v[i] == 50 + (int) (i + 1) * 4);
+assert(v[i] == 50 + (i + 1) * 4);
 }
 
 {
-std::vector v(10);
+std::vector v(10);
 std::iota(v.begin(), v.end(), 0);
-std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, 30);
+std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{30});
 for (size_t i = 0; i < v.size(); ++i)
-assert(v[i] == 30 + triangle(i) + (int) (i + 1));
+assert(v[i] == 30 + triangle(i) + i + 1);
 }
 
 {
-std::vector v(10);
+std::vector v(10);
 std::iota(v.begin(), v.end(), 1);
-std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, 40);
+std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{40});
 for (size_t i = 0; i < v.size(); ++i)
-assert(v[i] == 40 + triangle(i + 1) + (int) (i + 1));
+assert(v[i] == 40 + triangle(i + 1) + i + 1);
 }
 
 {
-std::vector v, res;
-std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), add_one{}, 1);
+std::vector v, res;
+std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::plus<>(), add_one{}, size_t{1});
 assert(res.empty());
 }
 
 //  Make sure that the calculations are done using the init typedef
 {
 std::vector v(10);
 std::iota(v.begin(), v.end(), static_cast(1));
-std::vector res;
-std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), add_one{}, 1);
+std::vector res;
+std::transform_inclusive_scan(v.begin(), v.end(), std::back_inserter(res), std::multiplies<>(), add_one{}, size_t{1});
 
 assert(res.size() == 10);
-int j = 2;
+size_t j = 2;
 assert(res[0] == 2);
 for (size_t i = 1; i < res.size(); ++i)
 {
Index: test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp

[PATCH] D43273: [libcxx] [test] Fix MSVC warnings and errors.

2018-02-15 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Would pragmas guarded by `_MSC_VER` be acceptable for the truncation warnings?


https://reviews.llvm.org/D43273



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


[PATCH] D43273: [libcxx] [test] Fix MSVC warnings and errors.

2018-02-13 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.

[libcxx] [test] Fix MSVC warnings and errors.

test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
Fix MSVC x64 truncation warnings.
warning C4267: conversion from 'size_t' to 'int', possible loss of data

test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
Fix MSVC uninitialized memory warning.
warning C6001: Using uninitialized memory 'vl'.

test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
Include  for the assert() macro.


https://reviews.llvm.org/D43273

Files:
  test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan.pass.cpp
  test/std/numerics/numeric.ops/exclusive.scan/exclusive_scan_init_op.pass.cpp
  test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan.pass.cpp
  test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op.pass.cpp
  test/std/numerics/numeric.ops/inclusive.scan/inclusive_scan_op_init.pass.cpp
  
test/std/numerics/numeric.ops/transform.exclusive.scan/transform_exclusive_scan_init_bop_uop.pass.cpp
  
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
  
test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
  
test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
  
test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp

Index: test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
===
--- test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
+++ test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
@@ -16,6 +16,7 @@
 
 #include 
 #include 
+#include 
 #include "test_macros.h"
 
 #if TEST_HAS_BUILTIN_IDENTIFIER(__reference_binds_to_temporary)
Index: test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
===
--- test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
+++ test/std/strings/basic.string/string.modifiers/string_append/push_back.pass.cpp
@@ -52,7 +52,7 @@
 {
 // https://bugs.llvm.org/show_bug.cgi?id=31454
 std::basic_string s;
-veryLarge vl;
+veryLarge vl = {};
 s.push_back(vl);
 s.push_back(vl);
 s.push_back(vl);
Index: test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
===
--- test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
+++ test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop_init.pass.cpp
@@ -105,15 +105,15 @@
 std::iota(v.begin(), v.end(), 0);
 std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, 30);
 for (size_t i = 0; i < v.size(); ++i)
-assert(v[i] == 30 + triangle(i) + (int) (i + 1));
+assert(v[i] == 30 + triangle(static_cast(i)) + static_cast(i + 1));
 }
 
 {
 std::vector v(10);
 std::iota(v.begin(), v.end(), 1);
 std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, 40);
 for (size_t i = 0; i < v.size(); ++i)
-assert(v[i] == 40 + triangle(i + 1) + (int) (i + 1));
+assert(v[i] == 40 + triangle(static_cast(i + 1)) + static_cast(i + 1));
 }
 
 {
@@ -134,7 +134,7 @@
 assert(res[0] == 2);
 for (size_t i = 1; i < res.size(); ++i)
 {
-j *= i + 2;
+j = static_cast(j * (i + 2));
 assert(res[i] == j);
 }
 }
Index: test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
===
--- test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
+++ test/std/numerics/numeric.ops/transform.inclusive.scan/transform_inclusive_scan_bop_uop.pass.cpp
@@ -96,15 +96,15 @@
 std::iota(v.begin(), v.end(), 0);
 std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
 for 

[PATCH] D42354: Fix libcxx MSVC C++17 redefinition of 'align_val_t'

2018-01-22 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Seems reasonable to me.


Repository:
  rCXX libc++

https://reviews.llvm.org/D42354



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


[PATCH] D41213: [libcxx] [test] Improve MSVC portability.

2018-01-09 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT closed this revision.
STL_MSFT added a comment.

Thanks, I've checked this in as-is. I would support an LWG issue to change the 
Standardese here.


https://reviews.llvm.org/D41213



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


[PATCH] D41213: [libcxx] [test] Improve MSVC portability.

2018-01-09 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Ping? (And happy Patch Tuesday!)


https://reviews.llvm.org/D41213



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


[PATCH] D41213: [libcxx] [test] Improve MSVC portability.

2018-01-02 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Ping? (And happy new year!)


https://reviews.llvm.org/D41213



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


[PATCH] D41213: [libcxx] [test] Improve MSVC portability.

2017-12-13 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
Herald added a subscriber: jfb.

[libcxx] [test] Improve MSVC portability.

test/support/msvc_stdlib_force_include.hpp
When testing MSVC's STL with C1XX, simulate a couple more compiler feature-test 
macros.

When testing MSVC's STL, simulate a few library feature-test macros.

test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
The vector_size attribute is a non-Standard extension that's supported by Clang 
and GCC,
but not C1XX. Therefore, guard this with `__has_attribute(vector_size)`.

Additionally, while these tests pass when MSVC's STL is compiled with Clang,
I don't consider this to be a supported scenario for our library,
so also guard this with defined(_LIBCPP_VERSION).

test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
N4713 23.14.10 [func.not_fn]/1 depicts only `call_wrapper(call_wrapper&&) = 
default;`
and `call_wrapper(const call_wrapper&) = default;`. According to
15.8.2 [class.copy.assign]/2 and /4, this makes call_wrapper non-assignable.
Therefore, guard the assignability tests as libc++ specific.

Add a (void) cast to tolerate not_fn() being marked as nodiscard.


https://reviews.llvm.org/D41213

Files:
  test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
  test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
  test/support/msvc_stdlib_force_include.hpp

Index: test/support/msvc_stdlib_force_include.hpp
===
--- test/support/msvc_stdlib_force_include.hpp
+++ test/support/msvc_stdlib_force_include.hpp
@@ -52,6 +52,13 @@
 #define _MSVC_HAS_FEATURE_memory_sanitizer  0
 #define _MSVC_HAS_FEATURE_thread_sanitizer  0
 
+#define __has_attribute(X) _MSVC_HAS_ATTRIBUTE_ ## X
+#define _MSVC_HAS_ATTRIBUTE_vector_size 0
+
+#ifdef _NOEXCEPT_TYPES_SUPPORTED
+#define __cpp_noexcept_function_type201510
+#endif // _NOEXCEPT_TYPES_SUPPORTED
+
 // Silence compiler warnings.
 #pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
 #pragma warning(disable: 4324) // structure was padded due to alignment specifier
@@ -85,4 +92,12 @@
 #define TEST_STD_VER 14
 #endif // _HAS_CXX17
 
+// Simulate library feature-test macros.
+#define __cpp_lib_invoke 201411
+#define __cpp_lib_void_t 201411
+
+#if _HAS_CXX17
+#define __cpp_lib_atomic_is_always_lock_free 201603
+#endif // _HAS_CXX17
+
 #endif // SUPPORT_MSVC_STDLIB_FORCE_INCLUDE_HPP
Index: test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
===
--- test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
+++ test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
@@ -305,31 +305,35 @@
 using RetT = decltype(std::not_fn(value));
 static_assert(std::is_move_constructible::value, "");
 static_assert(std::is_copy_constructible::value, "");
-static_assert(std::is_move_assignable::value, "");
-static_assert(std::is_copy_assignable::value, "");
+LIBCPP_STATIC_ASSERT(std::is_move_assignable::value, "");
+LIBCPP_STATIC_ASSERT(std::is_copy_assignable::value, "");
 auto ret = std::not_fn(value);
 assert(ret() == false);
 auto ret2 = std::not_fn(value2);
 assert(ret2() == true);
+#if defined(_LIBCPP_VERSION)
 ret = ret2;
 assert(ret() == true);
 assert(ret2() == true);
+#endif // _LIBCPP_VERSION
 }
 {
 using T = MoveAssignableWrapper;
 T value(true);
 T value2(false);
 using RetT = decltype(std::not_fn(std::move(value)));
 static_assert(std::is_move_constructible::value, "");
 static_assert(!std::is_copy_constructible::value, "");
-static_assert(std::is_move_assignable::value, "");
+LIBCPP_STATIC_ASSERT(std::is_move_assignable::value, "");
 static_assert(!std::is_copy_assignable::value, "");
 auto ret = std::not_fn(std::move(value));
 assert(ret() == false);
 auto ret2 = std::not_fn(std::move(value2));
 assert(ret2() == true);
+#if defined(_LIBCPP_VERSION)
 ret = std::move(ret2);
 assert(ret() == true);
+#endif // _LIBCPP_VERSION
 }
 }
 
@@ -426,7 +430,7 @@
 {
 ThrowsOnCopy cp;
 try {
-std::not_fn(cp);
+(void)std::not_fn(cp);
 assert(false);
 } catch (int const& value) {
 assert(value == 42);
Index: test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
===
--- test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
+++ test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
@@ -89,6 +89,7 @@
 CHECK_ALWAYS_LOCK_FREE(float);
 CHECK_ALWAYS_LOCK_FREE(double);
 

[PATCH] D40991: [libcxx] [test] Fix line endings, avoid unnecessary non-ASCII.

2017-12-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT accepted this revision.
STL_MSFT added a comment.
This revision is now accepted and ready to land.

Thanks, I've checked this in without the changes to TODO.TXT. Please let me 
know if you still want them, otherwise I consider this to be complete.


https://reviews.llvm.org/D40991



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


[PATCH] D40991: [libcxx] [test] Fix line endings, avoid unnecessary non-ASCII.

2017-12-11 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Would you like me to drop the changes to TODO.TXT?


https://reviews.llvm.org/D40991



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


[PATCH] D41030: [libcxx] [test] Fix MSVC warnings, null pointer deref.

2017-12-08 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix MSVC warnings, null pointer deref.

test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
Silence MSVC warning C4244. This is expected when passing
floating-point values for size.

test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
Avoid MSVC "warning C4293: '<<': shift count negative or too big,
undefined behavior". MSVC sees (1ULL << N) and warns - being guarded
by const bool canFit is insufficient. A small change to the code
avoids the warning without the need for a pragma.

Remove a spurious printf() declaration from to_ullong.pass.cpp.

Change ULL to UL in to_ulong.pass.cpp. The ULL suffix was
probably copy-pasted.

test/std/utilities/tuple/tuple.general/ignore.pass.cpp
Use LIBCPP_STATIC_ASSERT for consistency with other files.

test/support/container_test_types.h
Fix a null pointer dereference, found by MSVC /analyze
warning C6011 "Dereferencing NULL pointer 'm_expected_args'."


https://reviews.llvm.org/D41030

Files:
  test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
  test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
  test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
  test/std/utilities/tuple/tuple.general/ignore.pass.cpp
  test/support/container_test_types.h


Index: test/support/container_test_types.h
===
--- test/support/container_test_types.h
+++ test/support/container_test_types.h
@@ -167,8 +167,10 @@
   // Return true if the construction was expected and false otherwise.
   // This should only be called by 'Allocator.construct'.
   bool check(detail::TypeID const& tid) {
-if (!m_expected_args)
+if (!m_expected_args) {
   assert(m_allow_unchecked);
+  return m_allow_unchecked;
+}
 bool res = *m_expected_args == tid;
 if (m_expected_count == -1 || --m_expected_count == -1)
   m_expected_args = nullptr;
Index: test/std/utilities/tuple/tuple.general/ignore.pass.cpp
===
--- test/std/utilities/tuple/tuple.general/ignore.pass.cpp
+++ test/std/utilities/tuple/tuple.general/ignore.pass.cpp
@@ -48,9 +48,7 @@
 {
 static_assert(test_ignore_constexpr(), "");
 }
-#if defined(_LIBCPP_VERSION)
 {
-static_assert(std::is_trivial::value, "");
+LIBCPP_STATIC_ASSERT(std::is_trivial::value, 
"");
 }
-#endif
 }
Index: test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
@@ -39,9 +39,9 @@
 }
 
 { // test values bigger than can fit into the bitset
-const unsigned long val = 0x5AA5ULL;
+const unsigned long val = 0x5AA5UL;
 const bool canFit = N < sizeof(unsigned long) * CHAR_BIT;
-const unsigned long mask = canFit ? (1ULL << N) - 1 : (unsigned long)(-1);
+const unsigned long mask = canFit ? (1UL << (canFit ? N : 0)) - 1 : 
(unsigned long)(-1); // avoid compiler warnings
 std::bitset v(val);
 assert(v.to_ulong() == (val & mask)); // we shouldn't return bit patterns 
from outside the limits of the bitset.
 }
Index: test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
@@ -8,7 +8,6 @@
 
//===--===//
 
 // test unsigned long long to_ullong() const;
-extern "C" int printf(const char *, ...);
 
 #include 
 #include 
@@ -40,7 +39,7 @@
 { // test values bigger than can fit into the bitset
 const unsigned long long val = 0x5555ULL;
 const bool canFit = N < sizeof(unsigned long long) * CHAR_BIT;
-const unsigned long long mask = canFit ? (1ULL << N) - 1 : (unsigned long 
long)(-1);
+const unsigned long long mask = canFit ? (1ULL << (canFit ? N : 0)) - 1 : 
(unsigned long long)(-1); // avoid compiler warnings
 std::bitset v(val);
 assert(v.to_ullong() == (val & mask)); // we shouldn't return bit patterns 
from outside the limits of the bitset.
 }
Index: 
test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
===
--- 
test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
+++ 
test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
@@ -15,6 +15,10 @@
 //   void
 //   generate_n(Iter first, Size n, Generator gen);
 
+#ifdef 

[PATCH] D40991: [libcxx] [test] Fix line endings, avoid unnecessary non-ASCII.

2017-12-07 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix line endings, avoid unnecessary non-ASCII.

I recently wrote a tool to audit MSVC's codebase for inconsistent line endings 
and unnecessary non-ASCII characters, and I ran it over libcxx's codebase too. 
I don't need any of these changes to be committed, so feel free to reject them 
- I just thought you might be interested.

There's a significant non-ASCII string in 
test/std/re/re.alg/re.alg.search/grep.pass.cpp which I haven't attempted to 
convert into escapes.

TODO.TXT
Avoid non-ASCII characters.

benchmarks/util_smartptr.bench.cpp
Change CRLF to LF.

test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
Consistently comment "\u20ac" as EURO SIGN, its Unicode name, instead of the 
actual Unicode character.

test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
Avoid non-ASCII dash.


https://reviews.llvm.org/D40991

Files:
  TODO.TXT
  benchmarks/util_smartptr.bench.cpp
  
test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
  
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp

Index: test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
===
--- test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
+++ test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
@@ -26,7 +26,7 @@
 #include "uses_alloc_types.hpp"
 #include "controlled_allocators.hpp"
 
-// — If uses_allocator_v is false and
+// - If uses_allocator_v is false and
 //   is_constructible_v is true, calls
 //   OUTERMOST_ALLOC_TRAITS(*this)::construct(
 //  OUTERMOST (*this), p, std::forward(args)...).
Index: test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
===
--- test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
+++ test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_fr_FR.pass.cpp
@@ -117,7 +117,7 @@
 assert(ex == -123456789);
 }
 {   // zero, showbase
-std::string v = "0,00 \u20ac";  // €
+std::string v = "0,00 \u20ac";  // EURO SIGN
 showbase(ios);
 typedef input_iterator I;
 long double ex;
@@ -129,7 +129,7 @@
 assert(ex == 0);
 }
 {   // zero, showbase
-std::string v = "0,00 \u20ac";  // €
+std::string v = "0,00 \u20ac";  // EURO SIGN
 showbase(ios);
 typedef input_iterator I;
 long double ex;
@@ -141,7 +141,7 @@
 assert(ex == 0);
 }
 {   // negative one, showbase
-std::string v = "-0,01 \u20ac";
+std::string v = "-0,01 \u20ac";  // EURO SIGN
 typedef input_iterator I;
 long double ex;
 std::ios_base::iostate err = std::ios_base::goodbit;
@@ -152,7 +152,7 @@
 assert(ex == -1);
 }
 {   // negative one, showbase
-std::string v = "-0,01 \u20ac";
+std::string v = "-0,01 \u20ac";  // EURO SIGN
 showbase(ios);
 typedef input_iterator I;
 long double ex;
@@ -164,7 +164,7 @@
 assert(ex == -1);
 }
 {   // positive, showbase
-std::string v = "1 234 567,89 \u20ac";
+std::string v = "1 234 567,89 \u20ac";  // EURO SIGN
 typedef input_iterator I;
 long double ex;
 std::ios_base::iostate err = std::ios_base::goodbit;
@@ -175,7 +175,7 @@
 assert(ex == 123456789);
 }
 {   // positive, showbase
-std::string v = "1 234 567,89 \u20ac";
+std::string v = "1 234 567,89 \u20ac";  // EURO SIGN
 showbase(ios);
 typedef input_iterator I;
 long double ex;
@@ -188,7 +188,7 @@
 noshowbase(ios);
 }
 {   // negative, showbase
-std::string v = "-1 234 567,89 \u20ac";
+std::string v = "-1 234 567,89 \u20ac";  // EURO SIGN
 showbase(ios);
 typedef input_iterator I;
 long double ex;
@@ -450,7 +450,7 @@
 assert(ex == -123456789);
 }
 {   // zero, showbase
-std::wstring v = L"0,00 \u20ac";
+std::wstring v = L"0,00 \u20ac";  // EURO SIGN
 showbase(ios);
 typedef input_iterator I;
 long double ex;
@@ 

[PATCH] D39064: implement __has_unique_object_representations

2017-10-18 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Looks good to me modulo comments.




Comment at: lib/Parse/ParseExpr.cpp:719
 ///   '__is_union'
+///   '__has_unique_object_representations'   [MS]
 ///

Should this be marked as MS if it's cross-vendor?



Comment at: test/SemaCXX/type-traits.cpp:2403
+static_assert(has_unique_object_representations::value, "yes, all 
integral types");
+static_assert(has_unique_object_representations::value, "and pointer to 
members");
+static_assert(has_unique_object_representations::value, "and 
pointer to members");

char is a pointer to member! What a world. (ditto below)



Comment at: test/SemaCXX/type-traits.cpp:2420
+static_assert(!has_unique_object_representations::value, 
"or nullptr_t");
+static_assert(!has_unique_object_representations::value, "definitely 
not FP");
+static_assert(!has_unique_object_representations::value, "definitely 
not FP");

The use of "FP" to mean "floating point" is a little confusing given the FP 
typedef for Function Pointer above.


https://reviews.llvm.org/D39064



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


[PATCH] D38646: [MS] Raise the default value of _MSC_VER to 1910, which is in VS 2017

2017-10-09 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

FYI: 1910 was the value for VS 2017 RTM. 1911 is the value for VS 2017 15.3, 
the first toolset update. 1912 will be the value for VS 2017 15.5, the second 
toolset update.


Repository:
  rL LLVM

https://reviews.llvm.org/D38646



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


[PATCH] D38209: [Sema] Correct nothrow inherited by noexcept

2017-09-25 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

> do you think `__declspec(nothrow)` calling the terminate handler in Clang is 
> a bug?

It's certainly a behavior difference with potential performance impact, 
although I don't think it can be viewed as a bug, strictly speaking. MSVC 
treats `__declspec(nothrow)` as an optimization request, with undefined 
behavior if it's violated. Termination is definitely one of the possible 
results of undefined behavior.

We've recently had to slightly rethink our EH strategy in light of C++17's 
addition of noexcept into the type system, and the removal of dynamic exception 
specifications (and the change in semantics to throw()). MSVC's /EHsc makes 
this extra fun. If you're interested, I can put you in contact with the 
compiler dev who recently made those changes.


https://reviews.llvm.org/D38209



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


[PATCH] D38209: [Sema] Correct nothrow inherited by noexcept

2017-09-25 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

This sounds right to me and the test looks good. (I'll let an actual compiler 
dev sign off)


https://reviews.llvm.org/D38209



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


[PATCH] D36503: [libcxx] [test] Update for C++17 feature removals.

2017-08-24 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT accepted this revision.
STL_MSFT added a comment.
This revision is now accepted and ready to land.

Looks good to myself.


https://reviews.llvm.org/D36503



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


[PATCH] D37024: [libcxx] [test] Cleanup nullopt_t tests

2017-08-22 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Otherwise, looks cromulent to me.




Comment at: test/std/utilities/optional/optional.nullopt/nullopt_t.pass.cpp:38
 
-static_assert(test(nullopt) == 3, "");
+static_assert(std::is_same_v);
+static_assert(test());

You're saying `std::nullopt` but you already dragged it in.


https://reviews.llvm.org/D37024



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


[PATCH] D36503: [libcxx] [test] Update for C++17 feature removals.

2017-08-22 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

It's been two weeks - if there are no objections, I'd like to commit this soon. 
Thanks!


https://reviews.llvm.org/D36503



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


[PATCH] D36860: [Driver] Recognize DevDiv internal builds of MSVC, with a different directory structure

2017-08-18 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

In https://reviews.llvm.org/D36860#846232, @thakis wrote:

> Many driver tests check in a basic representative directory structure (e.g. 
> test/Driver/Inputs/basic_freebsd_tree/ and its many siblings).
>
> But if you're happy with others breaking this code, I suppose having no tests 
> is ok; I imagine most people won't use this code :-)


I can't check in copies of `cl.exe` and `link.exe` (the former's version is 
inspected, so it can't just be a dummy file). I'm happy without upstream tests 
for this logic. In the long run, I hope that we can eliminate this internal 
directory structure and make it identical to the released directory structure.


https://reviews.llvm.org/D36860



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


[PATCH] D36860: [Driver] Recognize DevDiv internal builds of MSVC, with a different directory structure

2017-08-18 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT marked an inline comment as done.
STL_MSFT added a comment.

In https://reviews.llvm.org/D36860#845469, @thakis wrote:

> This approach looks good to me.


Thanks!

> Is there any chance we could have a test for this?

Unfortunately, testing this involves having a VS toolset with the 
DevDiv-internal directory structure. Preparing that is a laborious manual 
process, and requires installation of the Windows SDK (I sent repro 
instructions to cfe-dev). Even given a real installation of VS, I don't think I 
could write automated test code to extract a copy with the necessary directory 
structure (doing so would almost involve replicating the codepaths being 
touched here). But now that I know that this code exists and that Clang 
occasionally changes it, especially in response to new VS directory structures, 
I'll watch for new betas/RCs and verify them against our internal builds.


https://reviews.llvm.org/D36860



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


[PATCH] D36860: [Driver] Recognize DevDiv internal builds of MSVC, with a different directory structure

2017-08-18 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT updated this revision to Diff 111776.
STL_MSFT edited the summary of this revision.
STL_MSFT added a comment.

This addresses Don Hinton's feedback. It also unifies `IsVS2017OrNewer` and 
`IsDevDivInternal` into a 3-state `enum class ToolsetLayout`.


https://reviews.llvm.org/D36860

Files:
  lib/Driver/ToolChains/MSVC.cpp
  lib/Driver/ToolChains/MSVC.h

Index: lib/Driver/ToolChains/MSVC.h
===
--- lib/Driver/ToolChains/MSVC.h
+++ lib/Driver/ToolChains/MSVC.h
@@ -92,7 +92,12 @@
 return getSubDirectoryPath(Type, getArch());
   }
 
-  bool getIsVS2017OrNewer() const { return IsVS2017OrNewer; }
+  enum class ToolsetLayout {
+OlderVS,
+VS2017OrNewer,
+DevDivInternal,
+  };
+  bool getIsVS2017OrNewer() const { return VSLayout == ToolsetLayout::VS2017OrNewer; }
 
   void
   AddClangSystemIncludeArgs(const llvm::opt::ArgList ,
@@ -130,7 +135,7 @@
   Tool *buildAssembler() const override;
 private:
   std::string VCToolChainPath;
-  bool IsVS2017OrNewer = false;
+  ToolsetLayout VSLayout = ToolsetLayout::OlderVS;
   CudaInstallationDetector CudaInstallation;
 };
 
Index: lib/Driver/ToolChains/MSVC.cpp
===
--- lib/Driver/ToolChains/MSVC.cpp
+++ lib/Driver/ToolChains/MSVC.cpp
@@ -76,15 +76,15 @@
 
 // Check various environment variables to try and find a toolchain.
 static bool findVCToolChainViaEnvironment(std::string ,
-  bool ) {
+  MSVCToolChain::ToolsetLayout ) {
   // These variables are typically set by vcvarsall.bat
   // when launching a developer command prompt.
   if (llvm::Optional VCToolsInstallDir =
   llvm::sys::Process::GetEnv("VCToolsInstallDir")) {
 // This is only set by newer Visual Studios, and it leads straight to
 // the toolchain directory.
 Path = std::move(*VCToolsInstallDir);
-IsVS2017OrNewer = true;
+VSLayout = MSVCToolChain::ToolsetLayout::VS2017OrNewer;
 return true;
   }
   if (llvm::Optional VCInstallDir =
@@ -94,7 +94,7 @@
 // so this check has to appear second.
 // In older Visual Studios, the VC directory is the toolchain.
 Path = std::move(*VCInstallDir);
-IsVS2017OrNewer = false;
+VSLayout = MSVCToolChain::ToolsetLayout::OlderVS;
 return true;
   }
 
@@ -134,9 +134,16 @@
   }
   if (IsBin) {
 llvm::StringRef ParentPath = llvm::sys::path::parent_path(TestPath);
-if (llvm::sys::path::filename(ParentPath) == "VC") {
+llvm::StringRef ParentFilename = llvm::sys::path::filename(ParentPath);
+if (ParentFilename == "VC") {
   Path = ParentPath;
-  IsVS2017OrNewer = false;
+  VSLayout = MSVCToolChain::ToolsetLayout::OlderVS;
+  return true;
+}
+if (ParentFilename == "x86ret" || ParentFilename == "x86chk"
+  || ParentFilename == "amd64ret" || ParentFilename == "amd64chk") {
+  Path = ParentPath;
+  VSLayout = MSVCToolChain::ToolsetLayout::DevDivInternal;
   return true;
 }
 
@@ -165,7 +172,7 @@
   ToolChainPath = llvm::sys::path::parent_path(ToolChainPath);
 
 Path = ToolChainPath;
-IsVS2017OrNewer = true;
+VSLayout = MSVCToolChain::ToolsetLayout::VS2017OrNewer;
 return true;
   }
 
@@ -181,7 +188,7 @@
 // This is the preferred way to discover new Visual Studios, as they're no
 // longer listed in the registry.
 static bool findVCToolChainViaSetupConfig(std::string ,
-  bool ) {
+  MSVCToolChain::ToolsetLayout ) {
 #if !defined(USE_MSVC_SETUP_API)
   return false;
 #else
@@ -263,16 +270,16 @@
 return false;
 
   Path = ToolchainPath.str();
-  IsVS2017OrNewer = true;
+  VSLayout = MSVCToolChain::ToolsetLayout::VS2017OrNewer;
   return true;
 #endif
 }
 
 // Look in the registry for Visual Studio installs, and use that to get
 // a toolchain path. VS2017 and newer don't get added to the registry.
 // So if we find something here, we know that it's an older version.
 static bool findVCToolChainViaRegistry(std::string ,
-   bool ) {
+   MSVCToolChain::ToolsetLayout ) {
   std::string VSInstallPath;
   if (getSystemRegistryString(R"(SOFTWARE\Microsoft\VisualStudio\$VERSION)",
   "InstallDir", VSInstallPath, nullptr) ||
@@ -284,7 +291,7 @@
   llvm::sys::path::append(VCPath, "VC");
 
   Path = VCPath.str();
-  IsVS2017OrNewer = false;
+  VSLayout = MSVCToolChain::ToolsetLayout::OlderVS;
   return true;
 }
   }
@@ -475,6 +482,7 @@
 // native target bin directory.
 // e.g. when compiling for x86 on an x64 host, PATH should start with:
 // /bin/HostX64/x86;/bin/HostX64/x64
+// This doesn't attempt to handle 

[PATCH] D36503: [libcxx] [test] Update for C++17 feature removals.

2017-08-18 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Ping?


https://reviews.llvm.org/D36503



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


[PATCH] D36860: [Driver] Recognize DevDiv internal builds of MSVC, with a different directory structure

2017-08-17 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

This is a minimally intrusive change, which I've verified works for both x86 
and x64.

The idea is to add another bool data member, `IsDevDivInternal`. (This could be 
unified with `IsVS2017OrNewer`, since it's a 3-way setting. Either a build is 
DevDiv-internal, released VS 2017 or newer, or released VS 2015 or older. I can 
easily make such a change if desired.) When looking at the directory structure, 
if instead of `"VC"` we see `"x86ret"`, `"x86chk"`, `"amd64ret"`, or 
`"amd64chk"`, we recognize this as a DevDiv-internal build.

After we get past the directory structure validation, we use this knowledge to 
regenerate paths appropriately. `llvmArchToDevDivInternalArch()` knows how we 
use `"i386"` subdirectories, and `MSVCToolChain::getSubDirectoryPath()` uses 
that. It also knows that DevDiv-internal builds have an `"inc"` subdirectory 
instead of `"include"`.

This may still not be the "right" fix in any sense, but I believe that it's 
non-intrusive in the sense that if the special directory names aren't found, 
`IsDevDivInternal` remains `false` and no codepaths are affected. I searched 
for all references to `IsVS2017OrNewer`, which are places where Clang cares 
about VS's directory structure, and the only one that isn't being patched is 
some logic to deal with cross-compilation. I'm fine with that not working for 
DevDiv-internal builds for the moment (we typically test the native compilers).

Is there still time to get a patch like this into 5.0.0, or is it too late?


https://reviews.llvm.org/D36860

Files:
  lib/Driver/ToolChains/MSVC.cpp
  lib/Driver/ToolChains/MSVC.h

Index: lib/Driver/ToolChains/MSVC.h
===
--- lib/Driver/ToolChains/MSVC.h
+++ lib/Driver/ToolChains/MSVC.h
@@ -131,6 +131,7 @@
 private:
   std::string VCToolChainPath;
   bool IsVS2017OrNewer = false;
+  bool IsDevDivInternal = false;
   CudaInstallationDetector CudaInstallation;
 };
 
Index: lib/Driver/ToolChains/MSVC.cpp
===
--- lib/Driver/ToolChains/MSVC.cpp
+++ lib/Driver/ToolChains/MSVC.cpp
@@ -76,7 +76,8 @@
 
 // Check various environment variables to try and find a toolchain.
 static bool findVCToolChainViaEnvironment(std::string ,
-  bool ) {
+  bool ,
+  bool ) {
   // These variables are typically set by vcvarsall.bat
   // when launching a developer command prompt.
   if (llvm::Optional VCToolsInstallDir =
@@ -138,6 +139,13 @@
   Path = ParentPath;
   IsVS2017OrNewer = false;
   return true;
+} else if (llvm::sys::path::filename(ParentPath) == "x86ret"
+|| llvm::sys::path::filename(ParentPath) == "x86chk"
+|| llvm::sys::path::filename(ParentPath) == "amd64ret"
+|| llvm::sys::path::filename(ParentPath) == "amd64chk") {
+  Path = ParentPath;
+  IsDevDivInternal = true;
+  return true;
 }
 
   } else {
@@ -677,7 +685,7 @@
   // what they want to use.
   // Failing that, just try to find the newest Visual Studio version we can
   // and use its default VC toolchain.
-  findVCToolChainViaEnvironment(VCToolChainPath, IsVS2017OrNewer) ||
+  findVCToolChainViaEnvironment(VCToolChainPath, IsVS2017OrNewer, IsDevDivInternal) ||
   findVCToolChainViaSetupConfig(VCToolChainPath, IsVS2017OrNewer) ||
   findVCToolChainViaRegistry(VCToolChainPath, IsVS2017OrNewer);
 }
@@ -766,6 +774,21 @@
   }
 }
 
+// Similar to the above function, but for DevDiv internal builds.
+static const char *llvmArchToDevDivInternalArch(llvm::Triple::ArchType Arch) {
+  using ArchType = llvm::Triple::ArchType;
+  switch (Arch) {
+  case ArchType::x86:
+return "i386";
+  case ArchType::x86_64:
+return "amd64";
+  case ArchType::arm:
+return "arm";
+  default:
+return "";
+  }
+}
+
 // Get the path to a specific subdirectory in the current toolchain for
 // a given target architecture.
 // VS2017 changed the VC toolchain layout, so this should be used instead
@@ -776,7 +799,9 @@
   llvm::SmallString<256> Path(VCToolChainPath);
   switch (Type) {
   case SubDirectoryType::Bin:
-if (IsVS2017OrNewer) {
+if (IsDevDivInternal) {
+  llvm::sys::path::append(Path, "bin", llvmArchToDevDivInternalArch(TargetArch));
+} else if (IsVS2017OrNewer) {
   bool HostIsX64 =
   llvm::Triple(llvm::sys::getProcessTriple()).isArch64Bit();
   llvm::sys::path::append(Path, "bin", (HostIsX64 ? "HostX64" : "HostX86"),
@@ -787,12 +812,20 @@
 }
 break;
   case SubDirectoryType::Include:
-llvm::sys::path::append(Path, "include");
+if (IsDevDivInternal) {
+  llvm::sys::path::append(Path, "inc");
+} else {
+  llvm::sys::path::append(Path, "include");
+}
 break;
   case SubDirectoryType::Lib:
-

[PATCH] D36503: [libcxx] [test] Update for C++17 feature removals.

2017-08-08 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Update for C++17 feature removals.

test/std/containers/Emplaceable.h
test/std/containers/NotConstructible.h
test/support/counting_predicates.hpp
Replace unary_function/binary_function inheritance with typedefs.

test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp
test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp
test/std/utilities/function.objects/func.require/binary_function.pass.cpp
test/std/utilities/function.objects/func.require/unary_function.pass.cpp
Mark these tests as requiring 98/03/11/14 because 17 removed 
unary_function/binary_function.

test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp
test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp
Mark these tests as requiring 11/14 because 17 removed packaged_task allocator 
support.

test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
This test doesn't need to be skipped in C++17 mode. Only the construction of
std::function from an allocator needs to be skipped in C++17 mode.

test/std/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp
When testing these reference_wrapper features, unary_function inheritance is 
totally irrelevant.

test/std/utilities/function.objects/refwrap/weak_result.pass.cpp
Define and use my_unary_function/my_binary_function to test the weak result 
type machinery
(which is still present in C++17, although deprecated).

test/support/msvc_stdlib_force_include.hpp
Now we can test C++17 strictly, without enabling removed features.


https://reviews.llvm.org/D36503

Files:
  test/std/containers/Emplaceable.h
  test/std/containers/NotConstructible.h
  test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp
  test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp
  
test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp
  
test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp
  test/std/utilities/function.objects/func.require/binary_function.pass.cpp
  test/std/utilities/function.objects/func.require/unary_function.pass.cpp
  
test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
  test/std/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp
  
test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp
  test/std/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp
  test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp
  test/std/utilities/function.objects/refwrap/weak_result.pass.cpp
  test/support/counting_predicates.hpp
  test/support/msvc_stdlib_force_include.hpp

Index: test/support/msvc_stdlib_force_include.hpp
===
--- test/support/msvc_stdlib_force_include.hpp
+++ test/support/msvc_stdlib_force_include.hpp
@@ -69,12 +69,6 @@
 // atomic_is_lock_free.pass.cpp needs this VS 2015 Update 2 fix.
 #define _ENABLE_ATOMIC_ALIGNMENT_FIX
 
-// Enable features that /std:c++latest removes by default.
-#define _HAS_AUTO_PTR_ETC   1
-#define _HAS_FUNCTION_ALLOCATOR_SUPPORT 1
-#define _HAS_OLD_IOSTREAMS_MEMBERS  1
-#define _HAS_UNEXPECTED 1
-
 // Silence warnings about raw pointers and other unchecked iterators.
 #define _SCL_SECURE_NO_WARNINGS
 
Index: test/support/counting_predicates.hpp
===
--- test/support/counting_predicates.hpp
+++ test/support/counting_predicates.hpp
@@ -12,8 +12,11 @@
 
 
 template 
-struct unary_counting_predicate : public std::unary_function  {
+struct unary_counting_predicate {
 public:
+typedef Arg argument_type;
+typedef bool result_type;
+
 unary_counting_predicate(Predicate p) : p_(p), count_(0) {}
 ~unary_counting_predicate() {}
 
@@ -28,8 +31,11 @@
 
 
 template 
-struct binary_counting_predicate : public std::binary_function {
+struct binary_counting_predicate {
 public:
+typedef Arg1 first_argument_type;
+typedef Arg2 second_argument_type;
+typedef bool result_type;
 
 binary_counting_predicate ( Predicate p ) : p_(p), count_(0) {}
 ~binary_counting_predicate() {}
Index: test/std/utilities/function.objects/refwrap/weak_result.pass.cpp
===
--- test/std/utilities/function.objects/refwrap/weak_result.pass.cpp
+++ test/std/utilities/function.objects/refwrap/weak_result.pass.cpp
@@ -16,27 +16,42 @@
 #include 
 #include 
 
+template 
+struct my_unary_function
+{ // 

[PATCH] D34534: [libcxx] [test] Fix MSVC warning C4242 "conversion from 'int' to 'const char', possible loss of data".

2017-07-10 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

As I've made this exact change in other tests before, I'll commit this soon-ish 
if there are no comments or objections.


https://reviews.llvm.org/D34534



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


[PATCH] D34535: [libcxx] [test] Fix MSVC warning C4067 "unexpected tokens following preprocessor directive - expected a newline".

2017-07-05 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Ping for this one - there's no functional change here, but since I don't have 
any glibc coverage, I wanted to get a review.


https://reviews.llvm.org/D34535



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


[PATCH] D34536: [libcxx] [test] Fix Clang -Wunused-local-typedef warnings.

2017-07-05 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Yeah, I just wanted to check that you didn't mean to actually use these 
typedefs for something. Thanks!


https://reviews.llvm.org/D34536



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


[PATCH] D34536: [libcxx] [test] Fix Clang -Wunused-local-typedef warnings.

2017-07-05 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Ping?


https://reviews.llvm.org/D34536



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


[PATCH] D34536: [libcxx] [test] Fix Clang -Wunused-local-typedef warnings.

2017-06-22 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix Clang -Wunused-local-typedef warnings.


https://reviews.llvm.org/D34536

Files:
  test/std/numerics/complex.number/complex.transcendentals/acos.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/acosh.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/asin.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/asinh.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/atanh.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/cos.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/cosh.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/sin.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/sinh.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/tanh.pass.cpp
  
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.lognormal/eval.pass.cpp
  test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.t/eval.pass.cpp
  
test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp
  
test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp
  
test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
  test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp

Index: test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp
===
--- test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp
+++ test/std/thread/thread.threads/thread.thread.this/sleep_until.pass.cpp
@@ -22,7 +22,6 @@
 {
 typedef std::chrono::system_clock Clock;
 typedef Clock::time_point time_point;
-typedef Clock::duration duration;
 std::chrono::milliseconds ms(500);
 time_point t0 = Clock::now();
 std::this_thread::sleep_until(t0 + ms);
Index: test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
===
--- test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
+++ test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/eval.pass.cpp
@@ -44,7 +44,6 @@
 test1()
 {
 typedef std::piecewise_linear_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937_64 G;
 G g;
 double b[] = {10, 14, 16, 17};
@@ -97,7 +96,6 @@
 test2()
 {
 typedef std::piecewise_linear_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937_64 G;
 G g;
 double b[] = {10, 14, 16, 17};
@@ -150,7 +148,6 @@
 test3()
 {
 typedef std::piecewise_linear_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937_64 G;
 G g;
 double b[] = {10, 14, 16, 17};
@@ -203,7 +200,6 @@
 test4()
 {
 typedef std::piecewise_linear_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937_64 G;
 G g;
 double b[] = {10, 14, 16};
@@ -257,7 +253,6 @@
 test5()
 {
 typedef std::piecewise_linear_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937_64 G;
 G g;
 double b[] = {10, 14};
@@ -312,7 +307,6 @@
 test6()
 {
 typedef std::piecewise_linear_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937_64 G;
 G g;
 double b[] = {10, 14, 16, 17};
Index: test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp
===
--- test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp
+++ test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.gamma/eval.pass.cpp
@@ -33,7 +33,6 @@
 {
 {
 typedef std::gamma_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937 G;
 G g;
 D d(0.5, 2);
@@ -73,7 +72,6 @@
 }
 {
 typedef std::gamma_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937 G;
 G g;
 D d(1, .5);
@@ -113,7 +111,6 @@
 }
 {
 typedef std::gamma_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937 G;
 G g;
 D d(2, 3);
Index: test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp
===
--- test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp
+++ test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.extreme/eval.pass.cpp
@@ -33,7 +33,6 @@
 test1()
 {
 typedef std::extreme_value_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937 G;
 G g;
 D d(0.5, 2);
@@ -75,7 +74,6 @@
 test2()
 {
 typedef std::extreme_value_distribution<> D;
-typedef D::param_type P;
 typedef std::mt19937 G;
 G g;
 D d(1, 2);
@@ -117,7 +115,6 @@
 test3()
 {
 typedef 

[PATCH] D34535: [libcxx] [test] Fix MSVC warning C4067 "unexpected tokens following preprocessor directive - expected a newline".

2017-06-22 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix MSVC warning C4067 "unexpected tokens following 
preprocessor directive - expected a newline".

Also fixes Clang/LLVM 4.0 (for Windows) error "function-like macro 
'TEST_GLIBC_PREREQ' is not defined".


https://reviews.llvm.org/D34535

Files:
  
test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp


Index: 
test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
===
--- 
test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
+++ 
test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
@@ -117,7 +117,13 @@
 // GLIBC <= 2.23 uses currency_symbol=""
 // GLIBC >= 2.24 uses currency_symbol=""
 // See also: 
http://www.fileformat.info/info/unicode/char/20bd/index.htm
-#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24)
+#if defined(TEST_GLIBC_PREREQ)
+#if TEST_GLIBC_PREREQ(2, 24)
+#define TEST_GLIBC_2_24_CURRENCY_SYMBOL
+#endif
+#endif
+
+#if defined(TEST_GLIBC_2_24_CURRENCY_SYMBOL)
 assert(f.curr_symbol() == " \u20BD");
 #else
 assert(f.curr_symbol() == " \xD1\x80\xD1\x83\xD0\xB1");
@@ -129,7 +135,7 @@
 }
 {
 Fwf f(LOCALE_ru_RU_UTF_8, 1);
-#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24)
+#if defined(TEST_GLIBC_2_24_CURRENCY_SYMBOL)
 assert(f.curr_symbol() == L" \u20BD");
 #else
 assert(f.curr_symbol() == L" \x440\x443\x431");


Index: test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
===
--- test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
+++ test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp
@@ -117,7 +117,13 @@
 // GLIBC <= 2.23 uses currency_symbol=""
 // GLIBC >= 2.24 uses currency_symbol=""
 // See also: http://www.fileformat.info/info/unicode/char/20bd/index.htm
-#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24)
+#if defined(TEST_GLIBC_PREREQ)
+#if TEST_GLIBC_PREREQ(2, 24)
+#define TEST_GLIBC_2_24_CURRENCY_SYMBOL
+#endif
+#endif
+
+#if defined(TEST_GLIBC_2_24_CURRENCY_SYMBOL)
 assert(f.curr_symbol() == " \u20BD");
 #else
 assert(f.curr_symbol() == " \xD1\x80\xD1\x83\xD0\xB1");
@@ -129,7 +135,7 @@
 }
 {
 Fwf f(LOCALE_ru_RU_UTF_8, 1);
-#if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 24)
+#if defined(TEST_GLIBC_2_24_CURRENCY_SYMBOL)
 assert(f.curr_symbol() == L" \u20BD");
 #else
 assert(f.curr_symbol() == L" \x440\x443\x431");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D34534: [libcxx] [test] Fix MSVC warning C4242 "conversion from 'int' to 'const char', possible loss of data".

2017-06-22 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix MSVC warning C4242 "conversion from 'int' to 'const char', 
possible loss of data".


https://reviews.llvm.org/D34534

Files:
  test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
  
test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp


Index: 
test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
===
--- 
test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
+++ 
test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
@@ -46,7 +46,7 @@
 if (__c != base::traits_type::eof())
 {
 int n = str_.size();
-str_.push_back(__c);
+str_.push_back(static_cast(__c));
 str_.resize(str_.capacity());
 base::setp(const_cast(str_.data()),
const_cast(str_.data() + str_.size()));
Index: test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
===
--- test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
+++ test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
@@ -40,7 +40,7 @@
 if (__c != base::traits_type::eof())
 {
 int n = str_.size();
-str_.push_back(__c);
+str_.push_back(static_cast(__c));
 str_.resize(str_.capacity());
 base::setp(const_cast(str_.data()),
const_cast(str_.data() + str_.size()));


Index: test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
===
--- test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
+++ test/std/input.output/iostream.format/input.streams/istream.formatted/istream_extractors/streambuf.pass.cpp
@@ -46,7 +46,7 @@
 if (__c != base::traits_type::eof())
 {
 int n = str_.size();
-str_.push_back(__c);
+str_.push_back(static_cast(__c));
 str_.resize(str_.capacity());
 base::setp(const_cast(str_.data()),
const_cast(str_.data() + str_.size()));
Index: test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
===
--- test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
+++ test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
@@ -40,7 +40,7 @@
 if (__c != base::traits_type::eof())
 {
 int n = str_.size();
-str_.push_back(__c);
+str_.push_back(static_cast(__c));
 str_.resize(str_.capacity());
 base::setp(const_cast(str_.data()),
const_cast(str_.data() + str_.size()));
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D33953: [libcxx] [test] Add more tests to tuple_size_structured_bindings.pass.cpp and make it friendlier to C1XX.

2017-06-20 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Ping?


https://reviews.llvm.org/D33953



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


[PATCH] D33955: [libcxx] [test] Remove a Clang/C2 workaround.

2017-06-06 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Remove a Clang/C2 workaround.

Clang/LLVM doesn't need this workaround.


https://reviews.llvm.org/D33955

Files:
  test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp


Index: 
test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
===
--- 
test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
+++ 
test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
@@ -48,14 +48,12 @@
 assert(X::dtor_called == false);
 assert(static_cast(opt) == false);
 }
-assert(X::dtor_called == false); // TRANSITION, Clang/C2 VSO#239997
 {
 optional opt(X{});
 X::dtor_called = false;
 opt.reset();
 assert(X::dtor_called == true);
 assert(static_cast(opt) == false);
 X::dtor_called = false;
 }
-assert(X::dtor_called == false); // TRANSITION, Clang/C2 VSO#239997
 }


Index: test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
===
--- test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
+++ test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
@@ -48,14 +48,12 @@
 assert(X::dtor_called == false);
 assert(static_cast(opt) == false);
 }
-assert(X::dtor_called == false); // TRANSITION, Clang/C2 VSO#239997
 {
 optional opt(X{});
 X::dtor_called = false;
 opt.reset();
 assert(X::dtor_called == true);
 assert(static_cast(opt) == false);
 X::dtor_called = false;
 }
-assert(X::dtor_called == false); // TRANSITION, Clang/C2 VSO#239997
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D33953: [libcxx] [test] Add more tests to tuple_size_structured_bindings.pass.cpp and make it friendlier to C1XX.

2017-06-06 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Add more tests to tuple_size_structured_bindings.pass.cpp and 
make it friendlier to C1XX.

Style/paranoia: 42.1 doesn't have an exact binary representation. Although this 
doesn't cause failures, it makes me uncomfortable, so I'm changing it to 42.5.

C1XX rightly warns about unreferenced variables. Adding tests for their values 
makes C1XX happy and improves test coverage.

C1XX (somewhat obnoxiously) warns about seeing a struct specialized as a class. 
Although the Standard doesn't care, saying struct consistently is better. (The 
Standard itself is still inconsistent about whether to depict tuple_element and 
tuple_size as structs or classes.)


https://reviews.llvm.org/D33953

Files:
  
test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp


Index: 
test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
===
--- 
test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
+++ 
test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
@@ -64,18 +64,22 @@
 void test_decomp_pair() {
   typedef std::pair T;
   {
-T s{99, 42.1};
+T s{99, 42.5};
 auto [m1, m2] = s;
 auto& [r1, r2] = s;
 assert(m1 == 99);
+assert(m2 == 42.5);
 assert( == ::get<0>(s));
+assert( == ::get<1>(s));
   }
   {
-T const s{99, 42.1};
+T const s{99, 42.5};
 auto [m1, m2] = s;
 auto& [r1, r2] = s;
 assert(m1 == 99);
+assert(m2 == 42.5);
 assert( == ::get<0>(s));
+assert( == ::get<1>(s));
   }
 }
 
@@ -86,14 +90,22 @@
 auto [m1, m2, m3] = s;
 auto& [r1, r2, r3] = s;
 assert(m1 == 99);
+assert(m2 == 42);
+assert(m3 == -1);
 assert( == ::get<0>(s));
+assert( == ::get<1>(s));
+assert( == ::get<2>(s));
   }
   {
 T const s{{99, 42, -1}};
 auto [m1, m2, m3] = s;
 auto& [r1, r2, r3] = s;
 assert(m1 == 99);
+assert(m2 == 42);
+assert(m3 == -1);
 assert( == ::get<0>(s));
+assert( == ::get<1>(s));
+assert( == ::get<2>(s));
   }
 }
 
@@ -105,8 +117,7 @@
 int get(Test const&) { static_assert(N == 0, ""); return -1; }
 
 template <>
-class std::tuple_element<0, Test> {
-public:
+struct std::tuple_element<0, Test> {
   typedef int type;
 };
 
@@ -117,8 +128,7 @@
 }
 
 template <>
-class std::tuple_size {
-public:
+struct std::tuple_size {
   static const size_t value = 1;
 };
 


Index: test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
===
--- test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
+++ test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
@@ -64,18 +64,22 @@
 void test_decomp_pair() {
   typedef std::pair T;
   {
-T s{99, 42.1};
+T s{99, 42.5};
 auto [m1, m2] = s;
 auto& [r1, r2] = s;
 assert(m1 == 99);
+assert(m2 == 42.5);
 assert( == ::get<0>(s));
+assert( == ::get<1>(s));
   }
   {
-T const s{99, 42.1};
+T const s{99, 42.5};
 auto [m1, m2] = s;
 auto& [r1, r2] = s;
 assert(m1 == 99);
+assert(m2 == 42.5);
 assert( == ::get<0>(s));
+assert( == ::get<1>(s));
   }
 }
 
@@ -86,14 +90,22 @@
 auto [m1, m2, m3] = s;
 auto& [r1, r2, r3] = s;
 assert(m1 == 99);
+assert(m2 == 42);
+assert(m3 == -1);
 assert( == ::get<0>(s));
+assert( == ::get<1>(s));
+assert( == ::get<2>(s));
   }
   {
 T const s{{99, 42, -1}};
 auto [m1, m2, m3] = s;
 auto& [r1, r2, r3] = s;
 assert(m1 == 99);
+assert(m2 == 42);
+assert(m3 == -1);
 assert( == ::get<0>(s));
+assert( == ::get<1>(s));
+assert( == ::get<2>(s));
   }
 }
 
@@ -105,8 +117,7 @@
 int get(Test const&) { static_assert(N == 0, ""); return -1; }
 
 template <>
-class std::tuple_element<0, Test> {
-public:
+struct std::tuple_element<0, Test> {
   typedef int type;
 };
 
@@ -117,8 +128,7 @@
 }
 
 template <>
-class std::tuple_size {
-public:
+struct std::tuple_size {
   static const size_t value = 1;
 };
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D33741: [libc++] Undef min/max in test_macros.h

2017-05-31 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

I haven't seen min/max test failures, probably because our CRT/STL headers 
never drag in Windows.h.

I have no objection to undeffing min/max although I wouldn't do this myself (it 
creates order dependencies which I think are totally evil).


https://reviews.llvm.org/D33741



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


[PATCH] D33290: [libcxx] [test] Remove workaround for C1XX conversion-to-nullptr bug

2017-05-17 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added inline comments.



Comment at: test/support/test_workarounds.h:21
 #if defined(TEST_COMPILER_C1XX)
-# define TEST_WORKAROUND_C1XX_BROKEN_NULLPTR_CONVERSION_OPERATOR
-# define TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE

Do you need to go update the tests that were using this?


https://reviews.llvm.org/D33290



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


[PATCH] D32927: [libc++] Implement exception_ptr on Windows

2017-05-05 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT resigned from this revision.
STL_MSFT added inline comments.



Comment at: include/exception:192
+#endif
+void* __ptr1_;
+void* __ptr2_;

BillyONeal wrote:
> I hope you realize you are doing "evil" unsupported things :). (We won't go 
> out of our way to break this, but if it does break we won't feel bad :P )
More specifically, while this will work with MSVC 2015/2017's msvcp140.dll, 
we've changed exception_ptr's separately compiled component in the next major 
binary-incompatible version of our STL.


https://reviews.llvm.org/D32927



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


[PATCH] D32926: [libcxx] [test] Suppress MSVC's /analyze warning C6294 in a more fine-grained manner.

2017-05-05 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Suppress MSVC's /analyze warning C6294 in a more fine-grained 
manner.


https://reviews.llvm.org/D32926

Files:
  test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
  test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
  test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
  test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
  test/std/utilities/template.bitset/bitset.members/count.pass.cpp
  test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
  test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
  test/std/utilities/template.bitset/bitset.members/index.pass.cpp
  test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
  test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
  test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
  test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
  test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
  test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
  test/std/utilities/template.bitset/bitset.members/test.pass.cpp
  test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
  test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
  test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
  test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
  test/support/msvc_stdlib_force_include.hpp

Index: test/support/msvc_stdlib_force_include.hpp
===
--- test/support/msvc_stdlib_force_include.hpp
+++ test/support/msvc_stdlib_force_include.hpp
@@ -57,7 +57,6 @@
 #pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
 #pragma warning(disable: 4521) // multiple copy constructors specified
 #pragma warning(disable: 4702) // unreachable code
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #pragma warning(disable: 28251) // Inconsistent annotation for 'new': this instance has no annotations.
 #endif // !defined(__clang__)
 
Index: test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
+++ test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
@@ -13,8 +13,12 @@
 #include 
 #include 
 
-#if defined(__clang__)
+#include "test_macros.h"
+
+#if defined(TEST_COMPILER_CLANG)
 #pragma clang diagnostic ignored "-Wtautological-compare"
+#elif defined(TEST_COMPILER_C1XX)
+#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template 
Index: test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
+++ test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
@@ -13,8 +13,12 @@
 #include 
 #include 
 
-#if defined(__clang__)
+#include "test_macros.h"
+
+#if defined(TEST_COMPILER_CLANG)
 #pragma clang diagnostic ignored "-Wtautological-compare"
+#elif defined(TEST_COMPILER_C1XX)
+#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template 
Index: test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
+++ test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
@@ -13,8 +13,12 @@
 #include 
 #include 
 
-#if defined(__clang__)
+#include "test_macros.h"
+
+#if defined(TEST_COMPILER_CLANG)
 #pragma clang diagnostic ignored "-Wtautological-compare"
+#elif defined(TEST_COMPILER_C1XX)
+#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template 
Index: test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
@@ -26,8 +26,12 @@
 #include 
 #include 
 
-#if 

[PATCH] D32727: [libcxx] [test] Be compatible with LWG 2438 "std::iterator inheritance shouldn't be mandated".

2017-05-05 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT closed this revision.
STL_MSFT added a comment.

Committed with requested changes.


https://reviews.llvm.org/D32727



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


[PATCH] D32924: [libcxx] [test] Fix MSVC "warning C6326: Potential comparison of a constant with another constant".

2017-05-05 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix MSVC "warning C6326: Potential comparison of a constant 
with another constant".

The expressions `1 == 1` and `true` have the same type, value category, and 
value.


https://reviews.llvm.org/D32924

Files:
  test/std/containers/sequences/vector.bool/emplace_back.pass.cpp


Index: test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
===
--- test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
+++ test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
@@ -48,7 +48,7 @@
 assert(c.front() == false);
 assert(c.back() == true);
 #endif
-c.emplace_back(1 == 1);
+c.emplace_back(true);
 assert(c.size() == 3);
 assert(c.front() == false);
 assert(c[1] == true);
@@ -82,7 +82,7 @@
 assert(c.front() == false);
 assert(c.back() == true);
 #endif
-c.emplace_back(1 == 1);
+c.emplace_back(true);
 assert(c.size() == 3);
 assert(c.front() == false);
 assert(c[1] == true);


Index: test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
===
--- test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
+++ test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
@@ -48,7 +48,7 @@
 assert(c.front() == false);
 assert(c.back() == true);
 #endif
-c.emplace_back(1 == 1);
+c.emplace_back(true);
 assert(c.size() == 3);
 assert(c.front() == false);
 assert(c[1] == true);
@@ -82,7 +82,7 @@
 assert(c.front() == false);
 assert(c.back() == true);
 #endif
-c.emplace_back(1 == 1);
+c.emplace_back(true);
 assert(c.size() == 3);
 assert(c.front() == false);
 assert(c[1] == true);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D32726: [libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.

2017-05-03 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added inline comments.



Comment at: test/support/msvc_stdlib_force_include.hpp:76
 
+#include 
+

EricWF wrote:
> Is the `stdlib.h` include above not enough?
It isn't enough. In MSVC there's a distinction between CRT headers like 
`stdlib.h` and STL headers like `cstdlib`. Only the STL headers drag in 
`yvals.h`, our internal STL-wide header that defines internal macros like 
`_HAS_CXX17`.



Comment at: test/support/msvc_stdlib_force_include.hpp:78
+
+#if _HAS_CXX17
+#define TEST_STD_VER 17

EricWF wrote:
> Should this be `#if defined(_HAS_CXX17) && _HAS_CXX17` since Clang doesn't 
> define it to the best of my knowledge? (Or maybe Clang/C2 does, IDK)
I guess I didn't explain the macro. `_HAS_CXX17` is an MSVC STL library macro, 
unconditionally defined. We centralize everything on this, because we have to 
ask different questions to determine whether C1XX, EDG, or Clang is in 14 or 17 
mode, and we additionally permit users to override the detection in one way 
(it's okay to ask for 17 from the compiler, but only 14 from the libs, at least 
for the moment; only noexcept in the type system will give us a headache).

As this header is for testing MSVC's STL, we can assume `_HAS_CXX17` is defined.


https://reviews.llvm.org/D32726



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


[PATCH] D32778: [libcxx] [test] Conditionally workaround C1XX/EDG bugs

2017-05-02 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT accepted this revision.
STL_MSFT added inline comments.
This revision is now accepted and ready to land.



Comment at: test/support/archetypes.hpp:20
 protected:
+#endif // !TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
   NullBase() = default;

I think that this comment doesn't match the ifndef check, but it's a style 
question.



Comment at: test/support/archetypes.ipp:10
+#ifdef TEST_WORKAROUND_EDG_EXPLICIT_CONSTEXPR
+#define DEFINE_CONSTEXPR
+#else // TEST_WORKAROUND_EDG_EXPLICIT_CONSTEXPR

Should you define it to be `inline` instead of nothing?


https://reviews.llvm.org/D32778



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


[PATCH] D32727: [libcxx] [test] Be compatible with LWG 2438 "std::iterator inheritance shouldn't be mandated".

2017-05-01 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Be compatible with LWG 2438 "std::iterator inheritance 
shouldn't be mandated".

In C++17, these iterators are allowed but not required to inherit from the 
deprecated std::iterator base class.


https://reviews.llvm.org/D32727

Files:
  test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
  test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
  test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp

Index: test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
===
--- test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
+++ test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
@@ -27,16 +27,32 @@
 int main()
 {
 typedef std::ostreambuf_iterator I1;
+#if TEST_STD_VER <= 14
 static_assert((std::is_convertible >::value), "");
+#else
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 
 typedef std::ostreambuf_iterator I2;
+#if TEST_STD_VER <= 14
 static_assert((std::is_convertible >::value), "");
+#else
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
Index: test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
===
--- test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
+++ test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
@@ -26,14 +26,30 @@
 int main()
 {
 typedef std::ostream_iterator I1;
+#if TEST_STD_VER <= 14
 static_assert((std::is_convertible >::value), "");
+#else
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 typedef std::ostream_iterator I2;
+#if TEST_STD_VER <= 14
 static_assert((std::is_convertible >::value), "");
+#else
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
+#endif
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
 static_assert((std::is_same::value), "");
Index: test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
===
--- test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
+++ test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
@@ -43,19 +43,35 @@
 int main()
 {
 typedef std::istream_iterator I1; // double is trivially destructible
+#if TEST_STD_VER <= 14
 static_assert((std::is_convertible

[PATCH] D32726: [libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.

2017-05-01 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set 
TEST_STD_VER.

_HAS_CXX17 indicates whether MSVC's STL is in C++17 mode.


https://reviews.llvm.org/D32726

Files:
  test/support/msvc_stdlib_force_include.hpp


Index: test/support/msvc_stdlib_force_include.hpp
===
--- test/support/msvc_stdlib_force_include.hpp
+++ test/support/msvc_stdlib_force_include.hpp
@@ -40,8 +40,6 @@
 
 // MSVC frontend only configurations
 #if !defined(__clang__)
-#define TEST_STD_VER 17
-
 // Simulate feature-test macros.
 #define __has_feature(X) _MSVC_HAS_FEATURE_ ## X
 #define _MSVC_HAS_FEATURE_cxx_exceptions1
@@ -75,4 +73,12 @@
 // Silence warnings about raw pointers and other unchecked iterators.
 #define _SCL_SECURE_NO_WARNINGS
 
+#include 
+
+#if _HAS_CXX17
+#define TEST_STD_VER 17
+#else // _HAS_CXX17
+#define TEST_STD_VER 14
+#endif // _HAS_CXX17
+
 #endif // SUPPORT_MSVC_STDLIB_FORCE_INCLUDE_HPP


Index: test/support/msvc_stdlib_force_include.hpp
===
--- test/support/msvc_stdlib_force_include.hpp
+++ test/support/msvc_stdlib_force_include.hpp
@@ -40,8 +40,6 @@
 
 // MSVC frontend only configurations
 #if !defined(__clang__)
-#define TEST_STD_VER 17
-
 // Simulate feature-test macros.
 #define __has_feature(X) _MSVC_HAS_FEATURE_ ## X
 #define _MSVC_HAS_FEATURE_cxx_exceptions1
@@ -75,4 +73,12 @@
 // Silence warnings about raw pointers and other unchecked iterators.
 #define _SCL_SECURE_NO_WARNINGS
 
+#include 
+
+#if _HAS_CXX17
+#define TEST_STD_VER 17
+#else // _HAS_CXX17
+#define TEST_STD_VER 14
+#endif // _HAS_CXX17
+
 #endif // SUPPORT_MSVC_STDLIB_FORCE_INCLUDE_HPP
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D32386: [libcxx] [test] Avoid P0138R2, direct-list-init of fixed enums from integers.

2017-04-21 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Avoid P0138R2, direct-list-init of fixed enums from integers.

This C++17 Core Language feature isn't necessary when testing std::byte.
It's a minor convenience, but it limits test coverage to very new compilers.

(I encountered this because C1XX currently has a bug in this feature, and our 
Clang/C2 is still 3.8 and missing this feature. But these tests had UNSUPPORTED 
comments knocking out several versions of Clang, so the impact isn't just 
limited to us.)


https://reviews.llvm.org/D32386

Files:
  test/std/language.support/support.types/byteops/and.assign.pass.cpp
  test/std/language.support/support.types/byteops/and.pass.cpp
  test/std/language.support/support.types/byteops/lshift.assign.pass.cpp
  test/std/language.support/support.types/byteops/lshift.fail.cpp
  test/std/language.support/support.types/byteops/lshift.pass.cpp
  test/std/language.support/support.types/byteops/not.pass.cpp
  test/std/language.support/support.types/byteops/or.assign.pass.cpp
  test/std/language.support/support.types/byteops/or.pass.cpp
  test/std/language.support/support.types/byteops/rshift.assign.pass.cpp
  test/std/language.support/support.types/byteops/rshift.fail.cpp
  test/std/language.support/support.types/byteops/rshift.pass.cpp
  test/std/language.support/support.types/byteops/to_integer.fail.cpp
  test/std/language.support/support.types/byteops/to_integer.pass.cpp
  test/std/language.support/support.types/byteops/xor.assign.pass.cpp
  test/std/language.support/support.types/byteops/xor.pass.cpp

Index: test/std/language.support/support.types/byteops/xor.pass.cpp
===
--- test/std/language.support/support.types/byteops/xor.pass.cpp
+++ test/std/language.support/support.types/byteops/xor.pass.cpp
@@ -11,16 +11,13 @@
 #include 
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
-// The following compilers don't like "std::byte b1{1}"
-// UNSUPPORTED: clang-3.5, clang-3.6, clang-3.7, clang-3.8
-// UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8.0
 
 // constexpr byte operator^(byte l, byte r) noexcept;
 
 int main () {
-	constexpr std::byte b1{1};
-	constexpr std::byte b8{8};
-	constexpr std::byte b9{9};
+	constexpr std::byte b1{static_cast(1)};
+	constexpr std::byte b8{static_cast(8)};
+	constexpr std::byte b9{static_cast(9)};
 
 	static_assert(noexcept(b1 ^ b8), "" );
 
Index: test/std/language.support/support.types/byteops/xor.assign.pass.cpp
===
--- test/std/language.support/support.types/byteops/xor.assign.pass.cpp
+++ test/std/language.support/support.types/byteops/xor.assign.pass.cpp
@@ -11,9 +11,6 @@
 #include 
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
-// The following compilers don't like "std::byte b1{1}"
-// UNSUPPORTED: clang-3.5, clang-3.6, clang-3.7, clang-3.8
-// UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8.0
 
 // constexpr byte& operator ^=(byte l, byte r) noexcept;
 
@@ -26,9 +23,9 @@
 
 int main () {
 	std::byte b;  // not constexpr, just used in noexcept check
-	constexpr std::byte b1{1};
-	constexpr std::byte b8{8};
-	constexpr std::byte b9{9};
+	constexpr std::byte b1{static_cast(1)};
+	constexpr std::byte b8{static_cast(8)};
+	constexpr std::byte b9{static_cast(9)};
 
 	static_assert(noexcept(b ^= b), "" );
 
Index: test/std/language.support/support.types/byteops/to_integer.pass.cpp
===
--- test/std/language.support/support.types/byteops/to_integer.pass.cpp
+++ test/std/language.support/support.types/byteops/to_integer.pass.cpp
@@ -11,18 +11,15 @@
 #include 
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
-// The following compilers don't like "std::byte b1{1}"
-// UNSUPPORTED: clang-3.5, clang-3.6, clang-3.7, clang-3.8
-// UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8.0
 
 // template 
 //constexpr IntegerType to_integer(byte b) noexcept;
 // This function shall not participate in overload resolution unless 
 //   is_integral_v is true.
 
 int main () {
-	constexpr std::byte b1{1};
-	constexpr std::byte b3{3};
+	constexpr std::byte b1{static_cast(1)};
+	constexpr std::byte b3{static_cast(3)};
 	
 	static_assert(noexcept(std::to_integer(b1)), "" );
 	static_assert(std::is_same::value, "" );
Index: test/std/language.support/support.types/byteops/to_integer.fail.cpp
===
--- test/std/language.support/support.types/byteops/to_integer.fail.cpp
+++ test/std/language.support/support.types/byteops/to_integer.fail.cpp
@@ -11,16 +11,13 @@
 #include 
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
-// The following compilers don't like "std::byte b1{1}"
-// UNSUPPORTED: clang-3.5, clang-3.6, clang-3.7, clang-3.8
-// UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8.0
 
 // template 
 //constexpr IntegerType to_integer(byte 

[PATCH] D31966: [libcxx] [test] Avoid Clang's -Wunused-const-variable in is_constructible.pass.cpp.

2017-04-11 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Avoid Clang's -Wunused-const-variable in 
is_constructible.pass.cpp.

This happens when using Clang with MSVC's STL, so there are no actual uses of 
this variable.


https://reviews.llvm.org/D31966

Files:
  test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp


Index: 
test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
===
--- test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
+++ test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
@@ -251,6 +251,7 @@
 LIBCPP_STATIC_ASSERT(
 clang_disallows_valid_static_cast_bug !=
 std::__libcpp_is_constructible>::value, "");
+((void)clang_disallows_valid_static_cast_bug); // Prevent unused warning
 #else
 static_assert(clang_disallows_valid_static_cast_bug == false, "");
 LIBCPP_STATIC_ASSERT(std::__libcpp_is_constructible>::value, "");


Index: test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
===
--- test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
+++ test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
@@ -251,6 +251,7 @@
 LIBCPP_STATIC_ASSERT(
 clang_disallows_valid_static_cast_bug !=
 std::__libcpp_is_constructible>::value, "");
+((void)clang_disallows_valid_static_cast_bug); // Prevent unused warning
 #else
 static_assert(clang_disallows_valid_static_cast_bug == false, "");
 LIBCPP_STATIC_ASSERT(std::__libcpp_is_constructible>::value, "");
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D31513: [Sema] Add __is_aggregate type-trait and implement LWG 2015

2017-04-03 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added inline comments.



Comment at: docs/LanguageExtensions.rst:996
 * ``__is_abstract`` (GNU, Microsoft)
+* ``__is_aggregate`` (GNU, Microsoft)
 * ``__is_base_of`` (GNU, Microsoft)

aaron.ballman wrote:
> EricWF wrote:
> > aaron.ballman wrote:
> > > Has Microsoft already implemented this? If not, do we want to wait for 
> > > them before claiming they implement it as well?
> > I asked @STL_MSFT to ping the frontend team to confirm they were planning 
> > on implementing it with this name. I was concerned this doc would never get 
> > updated otherwise. 
> Seems reasonable. My concern is that we claim Microsoft implements this when 
> they don't (yet) and someone uses this documentation to try to force 
> Microsoft's hand. However, it seems that this documentation not being updated 
> is the far more likely scenario. ;-)
MS intends to implement this hook under this name. No ETA yet.


https://reviews.llvm.org/D31513



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


[PATCH] D29140: [libcxx] [test] Avoid MSVC's non-Standard ABI in underlying_type.pass.cpp.

2017-01-25 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Avoid MSVC's non-Standard ABI in underlying_type.pass.cpp.

When compiled with Clang for Windows, this was emitting "enumerator value
evaluates to 4294967295, which cannot be narrowed to type 'int' 
[-Wc++11-narrowing]".

The test should more strenuously avoid poking this ABI deficiency (and it
already has coverage for explicitly specified underlying types).


https://reviews.llvm.org/D29140

Files:
  test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp


Index: 
test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
===
--- test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
+++ test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
@@ -17,32 +17,40 @@
 #include "test_macros.h"
 
 enum E { V = INT_MIN };
-enum F { W = UINT_MAX };
 
-int main()
-{
 #if !defined(_WIN32) || defined(__MINGW32__)
-typedef unsigned ExpectUnsigned;
+#define TEST_UNSIGNED_UNDERLYING_TYPE 1
 #else
-typedef int ExpectUnsigned; // MSVC's ABI doesn't follow the Standard
+#define TEST_UNSIGNED_UNDERLYING_TYPE 0 // MSVC's ABI doesn't follow the 
Standard
 #endif
+
+#if TEST_UNSIGNED_UNDERLYING_TYPE
+enum F { W = UINT_MAX };
+#endif // TEST_UNSIGNED_UNDERLYING_TYPE
+
+int main()
+{
 static_assert((std::is_same::value),
   "E has the wrong underlying type");
-static_assert((std::is_same::value),
+#if TEST_UNSIGNED_UNDERLYING_TYPE
+static_assert((std::is_same::value),
   "F has the wrong underlying type");
+#endif // TEST_UNSIGNED_UNDERLYING_TYPE
 
 #if TEST_STD_VER > 11
 static_assert((std::is_same::value), "");
-static_assert((std::is_same::value), "");
-#endif
+#if TEST_UNSIGNED_UNDERLYING_TYPE
+static_assert((std::is_same::value), 
"");
+#endif // TEST_UNSIGNED_UNDERLYING_TYPE
+#endif // TEST_STD_VER > 11
 
 #if TEST_STD_VER >= 11
 enum G : char { };
 
 static_assert((std::is_same::value),
   "G has the wrong underlying type");
 #if TEST_STD_VER > 11
 static_assert((std::is_same::value), "");
-#endif
+#endif // TEST_STD_VER > 11
 #endif // TEST_STD_VER >= 11
 }


Index: test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
===
--- test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
+++ test/std/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp
@@ -17,32 +17,40 @@
 #include "test_macros.h"
 
 enum E { V = INT_MIN };
-enum F { W = UINT_MAX };
 
-int main()
-{
 #if !defined(_WIN32) || defined(__MINGW32__)
-typedef unsigned ExpectUnsigned;
+#define TEST_UNSIGNED_UNDERLYING_TYPE 1
 #else
-typedef int ExpectUnsigned; // MSVC's ABI doesn't follow the Standard
+#define TEST_UNSIGNED_UNDERLYING_TYPE 0 // MSVC's ABI doesn't follow the Standard
 #endif
+
+#if TEST_UNSIGNED_UNDERLYING_TYPE
+enum F { W = UINT_MAX };
+#endif // TEST_UNSIGNED_UNDERLYING_TYPE
+
+int main()
+{
 static_assert((std::is_same::value),
   "E has the wrong underlying type");
-static_assert((std::is_same::value),
+#if TEST_UNSIGNED_UNDERLYING_TYPE
+static_assert((std::is_same::value),
   "F has the wrong underlying type");
+#endif // TEST_UNSIGNED_UNDERLYING_TYPE
 
 #if TEST_STD_VER > 11
 static_assert((std::is_same::value), "");
-static_assert((std::is_same::value), "");
-#endif
+#if TEST_UNSIGNED_UNDERLYING_TYPE
+static_assert((std::is_same::value), "");
+#endif // TEST_UNSIGNED_UNDERLYING_TYPE
+#endif // TEST_STD_VER > 11
 
 #if TEST_STD_VER >= 11
 enum G : char { };
 
 static_assert((std::is_same::value),
   "G has the wrong underlying type");
 #if TEST_STD_VER > 11
 static_assert((std::is_same::value), "");
-#endif
+#endif // TEST_STD_VER > 11
 #endif // TEST_STD_VER >= 11
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D29139: [libcxx] [test] Fix Clang -Wpessimizing-move "moving a temporary object prevents copy elision".

2017-01-25 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix Clang -Wpessimizing-move "moving a temporary object 
prevents copy elision".

N4618 30.6.6 [futures.unique_future]/12 declares "shared_future share() 
noexcept;".


https://reviews.llvm.org/D29139

Files:
  test/std/thread/futures/futures.unique_future/share.pass.cpp


Index: test/std/thread/futures/futures.unique_future/share.pass.cpp
===
--- test/std/thread/futures/futures.unique_future/share.pass.cpp
+++ test/std/thread/futures/futures.unique_future/share.pass.cpp
@@ -26,49 +26,49 @@
 std::promise p;
 std::future f0 = p.get_future();
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(f.valid());
 }
 {
 typedef int T;
 std::future f0;
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(!f.valid());
 }
 {
 typedef int& T;
 std::promise p;
 std::future f0 = p.get_future();
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(f.valid());
 }
 {
 typedef int& T;
 std::future f0;
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(!f.valid());
 }
 {
 typedef void T;
 std::promise p;
 std::future f0 = p.get_future();
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(f.valid());
 }
 {
 typedef void T;
 std::future f0;
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(!f.valid());
 }


Index: test/std/thread/futures/futures.unique_future/share.pass.cpp
===
--- test/std/thread/futures/futures.unique_future/share.pass.cpp
+++ test/std/thread/futures/futures.unique_future/share.pass.cpp
@@ -26,49 +26,49 @@
 std::promise p;
 std::future f0 = p.get_future();
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(f.valid());
 }
 {
 typedef int T;
 std::future f0;
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(!f.valid());
 }
 {
 typedef int& T;
 std::promise p;
 std::future f0 = p.get_future();
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(f.valid());
 }
 {
 typedef int& T;
 std::future f0;
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(!f.valid());
 }
 {
 typedef void T;
 std::promise p;
 std::future f0 = p.get_future();
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(f.valid());
 }
 {
 typedef void T;
 std::future f0;
 static_assert( noexcept(f0.share()), "");
-std::shared_future f = std::move(f0.share());
+std::shared_future f = f0.share();
 assert(!f0.valid());
 assert(!f.valid());
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D29138: [libcxx] [test] Fix Clang -Wdeprecated-declarations with MSVC's CRT.

2017-01-25 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix Clang -Wdeprecated-declarations with MSVC's CRT.

libcxx's tests use various C Standard Library functions that have been
marked by MSVC's CRT as deprecated by Microsoft (not by ISO).

libcxx's usage is cromulent (just checking with decltype to see if the functions
are being dragged in by various headers as required by the Standard), so
defining _CRT_SECURE_NO_WARNINGS will silence the warnings in a targeted manner.
This needs to be defined before including any CRT headers.

Also, make this file prettier.


https://reviews.llvm.org/D29138

Files:
  test/support/msvc_stdlib_force_include.hpp


Index: test/support/msvc_stdlib_force_include.hpp
===
--- test/support/msvc_stdlib_force_include.hpp
+++ test/support/msvc_stdlib_force_include.hpp
@@ -13,14 +13,17 @@
 // This header is force-included when running the libc++ tests against the
 // MSVC standard library.
 
+// Silence warnings about CRT machinery.
+#define _CRT_SECURE_NO_WARNINGS
+
 // Avoid assertion dialogs.
 #define _CRT_SECURE_INVALID_PARAMETER(EXPR) ::abort()
 
 #include 
 #include 
 
 #if defined(_LIBCPP_VERSION)
-#error This header may not be used when targeting libc++
+#error This header may not be used when targeting libc++
 #endif
 
 struct AssertionDialogAvoider {
@@ -35,27 +38,24 @@
 
 const AssertionDialogAvoider assertion_dialog_avoider{};
 
-
 // MSVC frontend only configurations
 #if !defined(__clang__)
-
-#define TEST_STD_VER 17
-
-// Simulate feature-test macros.
-#define __has_feature(X) _MSVC_HAS_FEATURE_ ## X
-#define _MSVC_HAS_FEATURE_cxx_exceptions1
-#define _MSVC_HAS_FEATURE_cxx_rtti  1
-#define _MSVC_HAS_FEATURE_address_sanitizer 0
-#define _MSVC_HAS_FEATURE_memory_sanitizer  0
-#define _MSVC_HAS_FEATURE_thread_sanitizer  0
-
-// Silence compiler warnings.
-#pragma warning(disable: 4180) // qualifier applied to function type has no 
meaning; ignored
-#pragma warning(disable: 4521) // multiple copy constructors specified
-#pragma warning(disable: 4702) // unreachable code
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition 
does not satisfy test.  Loop body not executed.
-#pragma warning(disable: 28251) // Inconsistent annotation for 'new': this 
instance has no annotations.
-
+#define TEST_STD_VER 17
+
+// Simulate feature-test macros.
+#define __has_feature(X) _MSVC_HAS_FEATURE_ ## X
+#define _MSVC_HAS_FEATURE_cxx_exceptions1
+#define _MSVC_HAS_FEATURE_cxx_rtti  1
+#define _MSVC_HAS_FEATURE_address_sanitizer 0
+#define _MSVC_HAS_FEATURE_memory_sanitizer  0
+#define _MSVC_HAS_FEATURE_thread_sanitizer  0
+
+// Silence compiler warnings.
+#pragma warning(disable: 4180) // qualifier applied to function type has 
no meaning; ignored
+#pragma warning(disable: 4521) // multiple copy constructors specified
+#pragma warning(disable: 4702) // unreachable code
+#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition 
does not satisfy test.  Loop body not executed.
+#pragma warning(disable: 28251) // Inconsistent annotation for 'new': this 
instance has no annotations.
 #endif // !defined(__clang__)
 
 // MSVC doesn't have __int128_t.


Index: test/support/msvc_stdlib_force_include.hpp
===
--- test/support/msvc_stdlib_force_include.hpp
+++ test/support/msvc_stdlib_force_include.hpp
@@ -13,14 +13,17 @@
 // This header is force-included when running the libc++ tests against the
 // MSVC standard library.
 
+// Silence warnings about CRT machinery.
+#define _CRT_SECURE_NO_WARNINGS
+
 // Avoid assertion dialogs.
 #define _CRT_SECURE_INVALID_PARAMETER(EXPR) ::abort()
 
 #include 
 #include 
 
 #if defined(_LIBCPP_VERSION)
-#error This header may not be used when targeting libc++
+#error This header may not be used when targeting libc++
 #endif
 
 struct AssertionDialogAvoider {
@@ -35,27 +38,24 @@
 
 const AssertionDialogAvoider assertion_dialog_avoider{};
 
-
 // MSVC frontend only configurations
 #if !defined(__clang__)
-
-#define TEST_STD_VER 17
-
-// Simulate feature-test macros.
-#define __has_feature(X) _MSVC_HAS_FEATURE_ ## X
-#define _MSVC_HAS_FEATURE_cxx_exceptions1
-#define _MSVC_HAS_FEATURE_cxx_rtti  1
-#define _MSVC_HAS_FEATURE_address_sanitizer 0
-#define _MSVC_HAS_FEATURE_memory_sanitizer  0
-#define _MSVC_HAS_FEATURE_thread_sanitizer  0
-
-// Silence compiler warnings.
-#pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
-#pragma warning(disable: 4521) // multiple copy constructors specified
-#pragma warning(disable: 4702) // unreachable code
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
-#pragma warning(disable: 28251) // Inconsistent annotation for 'new': this instance has no annotations.
-
+ 

[PATCH] D29137: [libcxx] [test] Fix Clang -Wunused-local-typedef, part 3/3.

2017-01-25 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix Clang -Wunused-local-typedef, part 3/3.

test/std/strings/string.classes/typedefs.pass.cpp
Actually test what basic_string's typedefs stand for.

test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
NotDerived and ND were completely unused.

test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
https://reviews.llvm.org/P2 was mistakenly not being used. Yes, that's
right: -Wunused-local-typedef CAUGHT A MISTAKE! AMAZING!


https://reviews.llvm.org/D29137

Files:
  test/std/strings/string.classes/typedefs.pass.cpp
  test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
  test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp


Index: test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
===
--- test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
+++ test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
@@ -49,7 +49,7 @@
 using P = std::pair;
 static_assert(!std::is_default_constructible::value, "");
 using P2 = std::pair;
-static_assert(!std::is_default_constructible::value, "");
+static_assert(!std::is_default_constructible::value, "");
 }
 #endif
 }
Index: test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
===
--- test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
+++ test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
@@ -26,7 +26,6 @@
 
 struct F {};
 struct FD : public F {};
-struct NotDerived {};
 
 template 
 void test_result_of_imp()
@@ -43,7 +42,6 @@
 
 int main()
 {
-typedef NotDerived ND;
 {
 typedef char F::*PMD;
 test_result_of_imp();
Index: test/std/strings/string.classes/typedefs.pass.cpp
===
--- test/std/strings/string.classes/typedefs.pass.cpp
+++ test/std/strings/string.classes/typedefs.pass.cpp
@@ -18,13 +18,14 @@
 // typedef basic_string wstring;
 
 #include 
+#include 
 
 int main()
 {
-typedef std::string test1;
-typedef std::wstring test2;
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
-typedef std::u16string test3;
-typedef std::u32string test4;
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
 #endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
 }


Index: test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
===
--- test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
+++ test/std/utilities/utility/pairs/pairs.pair/default.pass.cpp
@@ -49,7 +49,7 @@
 using P = std::pair;
 static_assert(!std::is_default_constructible::value, "");
 using P2 = std::pair;
-static_assert(!std::is_default_constructible::value, "");
+static_assert(!std::is_default_constructible::value, "");
 }
 #endif
 }
Index: test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
===
--- test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
+++ test/std/utilities/meta/meta.trans/meta.trans.other/result_of11.pass.cpp
@@ -26,7 +26,6 @@
 
 struct F {};
 struct FD : public F {};
-struct NotDerived {};
 
 template 
 void test_result_of_imp()
@@ -43,7 +42,6 @@
 
 int main()
 {
-typedef NotDerived ND;
 {
 typedef char F::*PMD;
 test_result_of_imp();
Index: test/std/strings/string.classes/typedefs.pass.cpp
===
--- test/std/strings/string.classes/typedefs.pass.cpp
+++ test/std/strings/string.classes/typedefs.pass.cpp
@@ -18,13 +18,14 @@
 // typedef basic_string wstring;
 
 #include 
+#include 
 
 int main()
 {
-typedef std::string test1;
-typedef std::wstring test2;
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
-typedef std::u16string test3;
-typedef std::u32string test4;
+static_assert((std::is_same::value), "");
+static_assert((std::is_same::value), "");
 #endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org

[PATCH] D29136: [libcxx] [test] Fix Clang -Wunused-local-typedef, part 2/3.

2017-01-25 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix Clang -Wunused-local-typedef, part 2/3.

These typedefs were completely unused.


https://reviews.llvm.org/D29136

Files:
  test/std/containers/sequences/deque/deque.cons/size.pass.cpp
  test/std/containers/sequences/list/list.cons/size_type.pass.cpp
  test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
  test/std/containers/unord/unord.multimap/load_factor.pass.cpp
  test/std/containers/unord/unord.multimap/max_bucket_count.pass.cpp
  test/std/containers/unord/unord.multimap/max_load_factor.pass.cpp
  test/std/containers/unord/unord.multimap/swap_member.pass.cpp
  
test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_non_member.pass.cpp
  test/std/containers/unord/unord.multiset/bucket_count.pass.cpp
  test/std/containers/unord/unord.multiset/load_factor.pass.cpp
  test/std/containers/unord/unord.multiset/max_load_factor.pass.cpp
  test/std/containers/unord/unord.multiset/swap_member.pass.cpp
  
test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_non_member.pass.cpp
  test/std/containers/unord/unord.set/bucket_count.pass.cpp
  test/std/containers/unord/unord.set/load_factor.pass.cpp
  test/std/containers/unord/unord.set/max_load_factor.pass.cpp
  test/std/containers/unord/unord.set/swap_member.pass.cpp
  test/std/containers/unord/unord.set/unord.set.swap/swap_non_member.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/atan.pass.cpp
  test/std/numerics/complex.number/complex.transcendentals/tan.pass.cpp
  
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.cauchy/eval.pass.cpp
  
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.chisq/eval.pass.cpp
  test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.f/eval.pass.cpp
  
test/std/numerics/rand/rand.dis/rand.dist.norm/rand.dist.norm.normal/eval.pass.cpp
  
test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.exp/eval.pass.cpp
  
test/std/numerics/rand/rand.dis/rand.dist.pois/rand.dist.pois.weibull/eval.pass.cpp
  test/std/strings/basic.string/string.cons/iter_alloc.pass.cpp
  test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp
  test/std/strings/basic.string/string.cons/pointer_size_alloc.pass.cpp
  test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
  test/std/strings/basic.string/string.cons/substr.pass.cpp
  
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
  
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
  
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
  
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
  
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
  test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp

Index: test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
===
--- test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
+++ test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
@@ -61,11 +61,9 @@
 void test_implicit()
 {
 {
-using T = long long;
 static_assert(implicit_conversion(42, 42), "");
 }
 {
-using T = long double;
 static_assert(implicit_conversion(3.14, 3.14), "");
 }
 {
@@ -97,18 +95,15 @@
 void test_explicit() {
 {
 using T = ExplicitTrivialTestTypes::TestType;
-using O = optional;
 static_assert(explicit_conversion(42, 42), "");
 }
 {
 using T = ExplicitConstexprTestTypes::TestType;
-using O = optional;
 static_assert(explicit_conversion(42, 42), "");
 static_assert(!std::is_convertible::value, "");
 }
 {
 using T = ExplicitTestTypes::TestType;
-using O = optional;
 T::reset();
 {
 assert(explicit_conversion(42, 42));
Index: test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
===
--- test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
+++ test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_type.pass.cpp
@@ -31,7 +31,6 @@
 //   OUTERMOST_ALLOC_TRAITS(*this)::construct(
 //  OUTERMOST (*this), p, std::forward(args)...).
 void test_bullet_one() {
-using VoidAlloc1 = CountingAllocator;
 using VoidAlloc2 = CountingAllocator;
 
 AllocController POuter;
@@ -41,7 +40,6 @@
 using Outer = CountingAllocator;
 using Inner = CountingAllocator;
 using SA = std::scoped_allocator_adaptor;
-using SAInner = std::scoped_allocator_adaptor;
 

[PATCH] D29135: [libcxx] [test] Fix Clang -Wunused-local-typedef, part 1/3.

2017-01-25 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix Clang -Wunused-local-typedef, part 1/3.

Mark typedefs as LIBCPP_ONLY when their only usage is within 
LIBCPP_STATIC_ASSERT.

test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
Additionally deal with conditional compilation.

test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
Additionally deal with typedefs used by other typedefs.


https://reviews.llvm.org/D29135

Files:
  test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
  test/std/containers/associative/map/map.cons/dtor_noexcept.pass.cpp
  test/std/containers/associative/map/map.cons/move_assign_noexcept.pass.cpp
  test/std/containers/associative/map/map.cons/move_noexcept.pass.cpp
  test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
  
test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
  test/std/containers/associative/multimap/multimap.cons/dtor_noexcept.pass.cpp
  
test/std/containers/associative/multimap/multimap.cons/move_assign_noexcept.pass.cpp
  test/std/containers/associative/multimap/multimap.cons/move_noexcept.pass.cpp
  
test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
  
test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
  test/std/containers/associative/multiset/multiset.cons/dtor_noexcept.pass.cpp
  
test/std/containers/associative/multiset/multiset.cons/move_assign_noexcept.pass.cpp
  test/std/containers/associative/multiset/multiset.cons/move_noexcept.pass.cpp
  
test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
  test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp
  test/std/containers/associative/set/set.cons/dtor_noexcept.pass.cpp
  test/std/containers/associative/set/set.cons/move_assign_noexcept.pass.cpp
  test/std/containers/associative/set/set.cons/move_noexcept.pass.cpp
  test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp
  
test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
  
test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
  test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
  
test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
  test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
  test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
  test/std/containers/sequences/deque/deque.cons/dtor_noexcept.pass.cpp
  test/std/containers/sequences/deque/deque.cons/move_assign_noexcept.pass.cpp
  test/std/containers/sequences/deque/deque.cons/move_noexcept.pass.cpp
  test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
  
test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
  
test/std/containers/sequences/forwardlist/forwardlist.cons/dtor_noexcept.pass.cpp
  
test/std/containers/sequences/forwardlist/forwardlist.cons/move_assign_noexcept.pass.cpp
  
test/std/containers/sequences/forwardlist/forwardlist.cons/move_noexcept.pass.cpp
  
test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
  test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
  test/std/containers/sequences/list/list.cons/dtor_noexcept.pass.cpp
  test/std/containers/sequences/list/list.cons/move_assign_noexcept.pass.cpp
  test/std/containers/sequences/list/list.cons/move_noexcept.pass.cpp
  test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
  test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
  test/std/containers/sequences/vector.bool/dtor_noexcept.pass.cpp
  test/std/containers/sequences/vector.bool/move_assign_noexcept.pass.cpp
  test/std/containers/sequences/vector.bool/move_noexcept.pass.cpp
  test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
  test/std/containers/sequences/vector/vector.cons/dtor_noexcept.pass.cpp
  test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
  test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp
  test/std/containers/unord/unord.map/unord.map.cnstr/dtor_noexcept.pass.cpp
  
test/std/containers/unord/unord.map/unord.map.cnstr/move_assign_noexcept.pass.cpp
  test/std/containers/unord/unord.map/unord.map.cnstr/move_noexcept.pass.cpp
  test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp
  
test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp
  
test/std/containers/unord/unord.multimap/unord.multimap.cnstr/dtor_noexcept.pass.cpp
  
test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_assign_noexcept.pass.cpp
  

[PATCH] D28837: [libcxx] [test] Fix MSVC warnings C4127 and C6326 about constants.

2017-01-17 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.

[libcxx] [test] Fix MSVC warnings C4127 and C6326 about constants.

MSVC has compiler warnings C4127 "conditional expression is constant" (enabled
by /https://reviews.llvm.org/W4) and C6326 "Potential comparison of a constant 
with another constant"
(enabled by /analyze). They're potentially useful, although they're slightly
annoying to library devs who know what they're doing. In the latest version of
the compiler, C4127 is suppressed when the compiler sees simple tests like
"if (name_of_thing)", so extracting comparison expressions into named
constants is a workaround. At the same time, using std::integral_constant
avoids C6326, which doesn't look at template arguments.

test/std/containers/sequences/vector.bool/emplace.pass.cpp
Replace 1 == 1 with true, which is the same as far as the library is concerned.


https://reviews.llvm.org/D28837

Files:
  test/std/containers/sequences/vector.bool/emplace.pass.cpp
  
test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
  test/std/utilities/function.objects/unord.hash/enum.pass.cpp
  test/std/utilities/function.objects/unord.hash/integral.pass.cpp
  test/std/utilities/template.bitset/bitset.members/all.pass.cpp
  test/std/utilities/template.bitset/bitset.members/any.pass.cpp
  test/std/utilities/template.bitset/bitset.members/index.pass.cpp
  test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
  test/std/utilities/template.bitset/bitset.members/none.pass.cpp
  test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
  test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
  test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp

Index: test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
@@ -11,16 +11,18 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 template 
 void test_to_ulong()
 {
 const std::size_t M = sizeof(unsigned long) * CHAR_BIT < N ? sizeof(unsigned long) * CHAR_BIT : N;
-const std::size_t X = M == 0 ? sizeof(unsigned long) * CHAR_BIT - 1 : sizeof(unsigned long) * CHAR_BIT - M;
-const std::size_t max = M == 0 ? 0 : std::size_t(std::numeric_limits::max()) >> X;
+const bool is_M_zero = std::integral_constant::value; // avoid compiler warnings
+const std::size_t X = is_M_zero ? sizeof(unsigned long) * CHAR_BIT - 1 : sizeof(unsigned long) * CHAR_BIT - M;
+const std::size_t max = is_M_zero ? 0 : std::size_t(std::numeric_limits::max()) >> X;
 std::size_t tests[] = {0,
std::min(1, max),
std::min(2, max),
Index: test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
@@ -11,15 +11,17 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
 template 
 void test_to_ullong()
 {
 const std::size_t M = sizeof(unsigned long long) * CHAR_BIT < N ? sizeof(unsigned long long) * CHAR_BIT : N;
-const std::size_t X = M == 0 ? sizeof(unsigned long long) * CHAR_BIT - 1 : sizeof(unsigned long long) * CHAR_BIT - M;
-const unsigned long long max = M == 0 ? 0 : (unsigned long long)(-1) >> X;
+const bool is_M_zero = std::integral_constant::value; // avoid compiler warnings
+const std::size_t X = is_M_zero ? sizeof(unsigned long long) * CHAR_BIT - 1 : sizeof(unsigned long long) * CHAR_BIT - M;
+const unsigned long long max = is_M_zero ? 0 : (unsigned long long)(-1) >> X;
 unsigned long long tests[] = {0,
std::min(1, max),
std::min(2, max),
Index: test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
@@ -13,6 +13,7 @@
 // bool operator!=(const bitset& rhs) const;
 
 #include 
+#include 
 #include 
 #include 
 
@@ -36,7 +37,8 @@
 const std::bitset v1 = make_bitset();
 std::bitset v2 = v1;
 assert(v1 == v2);
-if (N > 0)
+const bool greater_than_0 = std::integral_constant 0)>::value; // avoid compiler warnings
+if (greater_than_0)
 {
 v2[N/2].flip();
 assert(v1 != v2);
Index: test/std/utilities/template.bitset/bitset.members/none.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/none.pass.cpp
+++ 

[PATCH] D28592: [libcxx] [test] Fix MSVC warning C4127 "conditional expression is constant".

2017-01-13 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT abandoned this revision.
STL_MSFT added a comment.

Actually, this pattern annoys "warning C6326: Potential comparison of a 
constant with another constant." from /analyze. I'll figure out a better fix, 
probably with integral_constant.


https://reviews.llvm.org/D28592



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


[PATCH] D28592: [libcxx] [test] Fix MSVC warning C4127 "conditional expression is constant".

2017-01-11 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

[libcxx] [test] Fix MSVC warning C4127 "conditional expression is constant".

MSVC has a compiler warning (enabled at /https://reviews.llvm.org/W4) that's 
potentially useful,
although slightly annoying to library devs who know what they're doing.
In the latest version of the compiler, the warning is suppressed when the
compiler sees simple tests like "if (name_of_thing)", so extracting comparison
expressions into named constants is a workaround. This is useful for ensuring
that libraries are C4127-clean.


https://reviews.llvm.org/D28592

Files:
  
test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
  test/std/utilities/function.objects/unord.hash/enum.pass.cpp
  test/std/utilities/function.objects/unord.hash/integral.pass.cpp
  test/std/utilities/template.bitset/bitset.members/all.pass.cpp
  test/std/utilities/template.bitset/bitset.members/any.pass.cpp
  test/std/utilities/template.bitset/bitset.members/index.pass.cpp
  test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
  test/std/utilities/template.bitset/bitset.members/none.pass.cpp
  test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp

Index: test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
@@ -36,7 +36,8 @@
 const std::bitset v1 = make_bitset();
 std::bitset v2 = v1;
 assert(v1 == v2);
-if (N > 0)
+const bool greater_than_0 = N > 0;
+if (greater_than_0)
 {
 v2[N/2].flip();
 assert(v1 != v2);
Index: test/std/utilities/template.bitset/bitset.members/none.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/none.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/none.pass.cpp
@@ -20,7 +20,8 @@
 assert(v.none() == true);
 v.set();
 assert(v.none() == (N == 0));
-if (N > 1)
+const bool greater_than_1 = N > 1;
+if (greater_than_1)
 {
 v[N/2] = false;
 assert(v.none() == false);
Index: test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
@@ -31,7 +31,8 @@
 void test_index_const()
 {
 const std::bitset v1 = make_bitset();
-if (N > 0)
+const bool greater_than_0 = N > 0;
+if (greater_than_0)
 {
 assert(v1[N/2] == v1.test(N/2));
 }
Index: test/std/utilities/template.bitset/bitset.members/index.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/index.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/index.pass.cpp
@@ -31,7 +31,8 @@
 void test_index_const()
 {
 std::bitset v1 = make_bitset();
-if (N > 0)
+const bool greater_than_0 = N > 0;
+if (greater_than_0)
 {
 assert(v1[N/2] == v1.test(N/2));
 typename std::bitset::reference r = v1[N/2];
Index: test/std/utilities/template.bitset/bitset.members/any.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/any.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/any.pass.cpp
@@ -20,7 +20,8 @@
 assert(v.any() == false);
 v.set();
 assert(v.any() == (N != 0));
-if (N > 1)
+const bool greater_than_1 = N > 1;
+if (greater_than_1)
 {
 v[N/2] = false;
 assert(v.any() == true);
Index: test/std/utilities/template.bitset/bitset.members/all.pass.cpp
===
--- test/std/utilities/template.bitset/bitset.members/all.pass.cpp
+++ test/std/utilities/template.bitset/bitset.members/all.pass.cpp
@@ -20,7 +20,8 @@
 assert(v.all() == (N == 0));
 v.set();
 assert(v.all() == true);
-if (N > 1)
+const bool greater_than_1 = N > 1;
+if (greater_than_1)
 {
 v[N/2] = false;
 assert(v.all() == false);
Index: test/std/utilities/function.objects/unord.hash/integral.pass.cpp
===
--- test/std/utilities/function.objects/unord.hash/integral.pass.cpp
+++ test/std/utilities/function.objects/unord.hash/integral.pass.cpp
@@ -36,7 +36,8 @@
 for (int i = 0; i <= 5; ++i)
 {
 T t(static_cast(i));
-if (sizeof(T) <= sizeof(std::size_t))
+const bool small = sizeof(T) <= sizeof(std::size_t);
+if (small)
 {
   

[PATCH] D28591: [libcxx] [test] Don't ask whether Incomplete& can be assigned to.

2017-01-11 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

[libcxx] [test] Don't ask whether Incomplete& can be assigned to.

This is the subject of an active NB comment. Regardless of what the Working
Paper currently says, asking this question is morally wrong, because the
answer can change when the type is completed. C1XX now detects such
precondition violations and complains about them; perhaps Clang should too.


https://reviews.llvm.org/D28591

Files:
  test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp


Index: test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
===
--- test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
+++ test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
@@ -82,5 +82,4 @@
 
 //  pointer to incomplete template type
test_is_assignable ();
-test_is_not_assignable();
 }


Index: test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
===
--- test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
+++ test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
@@ -82,5 +82,4 @@
 
 //  pointer to incomplete template type
 	test_is_assignable ();
-test_is_not_assignable();
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D27786: [libcxx] [test] Strip trailing whitespace.

2016-12-14 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

[libcxx] [test] Strip trailing whitespace.


https://reviews.llvm.org/D27786

Files:
  test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
  test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
  test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
  
test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
  test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp


Index: 
test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
===
--- test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
+++ test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
@@ -19,7 +19,7 @@
 
 template 
   using callFoo = decltype(std::declval().Foo());
-  
+
 struct yesFoo {
 int Foo() { return 0; }
 };
Index: 
test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
===
--- 
test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
+++ 
test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
@@ -19,7 +19,7 @@
 
 template 
   using callFoo = decltype(std::declval().Foo());
-  
+
 struct yesFoo {
 int Foo() { return 0; }
 };
Index: test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
===
--- test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
+++ test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
@@ -19,7 +19,7 @@
 
 template 
   using copy_assign_t = decltype(std::declval() = std::declval());
-  
+
 struct not_assignable {
 not_assignable & operator=(const not_assignable&) = delete;
 };
Index: test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
===
--- test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
+++ test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
@@ -19,7 +19,7 @@
 
 template 
   using callFoo = decltype(std::declval().Foo());
-  
+
 struct yesFoo {
 int Foo() { return 0; }
 };
Index: test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
===
--- test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
+++ test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
@@ -19,7 +19,7 @@
 
 template 
   using hasFoo = typename T::Foo;
-  
+
 struct yesFoo {
 using Foo = int;
 };


Index: test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
===
--- test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
+++ test/std/experimental/utilities/meta/meta.detect/is_detected_exact.pass.cpp
@@ -19,7 +19,7 @@
 
 template 
   using callFoo = decltype(std::declval().Foo());
-  
+
 struct yesFoo {
 int Foo() { return 0; }
 };
Index: test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
===
--- test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
+++ test/std/experimental/utilities/meta/meta.detect/is_detected_convertible.pass.cpp
@@ -19,7 +19,7 @@
 
 template 
   using callFoo = decltype(std::declval().Foo());
-  
+
 struct yesFoo {
 int Foo() { return 0; }
 };
Index: test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
===
--- test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
+++ test/std/experimental/utilities/meta/meta.detect/is_detected.pass.cpp
@@ -19,7 +19,7 @@
 
 template 
   using copy_assign_t = decltype(std::declval() = std::declval());
-  
+
 struct not_assignable {
 not_assignable & operator=(const not_assignable&) = delete;
 };
Index: test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
===
--- test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
+++ test/std/experimental/utilities/meta/meta.detect/detected_t.pass.cpp
@@ -19,7 +19,7 @@
 
 template 
   using callFoo = decltype(std::declval().Foo());
-  
+
 struct yesFoo {
 int Foo() { return 0; }
 };
Index: test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
===
--- test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp
+++ test/std/experimental/utilities/meta/meta.detect/detected_or.pass.cpp

[PATCH] D27785: [libcxx] [test] Fix recently introduced warnings emitted by MSVC.

2016-12-14 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

[libcxx] [test] Fix recently introduced warnings emitted by MSVC.

test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
These tests were using malloc()'s return value without checking for null,
which MSVC's /analyze rightly warns about. Asserting that the pointer is
non-null both expresses the test's intention and silences the warning.

test/support/controlled_allocators.hpp
Fix two unreferenced parameters by removing their names, and one unused 
variable by void-casting it.

test/support/uses_alloc_types.hpp
Fix an unreferenced function parameter pack by removing its name.


https://reviews.llvm.org/D27785

Files:
  
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_const_lvalue_pair.pass.cpp
  
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_piecewise.pass.cpp
  
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
  
test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
  test/support/controlled_allocators.hpp
  test/support/uses_alloc_types.hpp

Index: test/support/uses_alloc_types.hpp
===
--- test/support/uses_alloc_types.hpp
+++ test/support/uses_alloc_types.hpp
@@ -372,7 +372,7 @@
 : Base(()) {}
 // Non-Uses Allocator Ctor
 template  = false>
-NotUsesAllocator(Args&&... args) : Base(()) {}
+NotUsesAllocator(Args&&...) : Base(()) {}
 
 // Uses Allocator Arg Ctor
 template 
Index: test/support/controlled_allocators.hpp
===
--- test/support/controlled_allocators.hpp
+++ test/support/controlled_allocators.hpp
@@ -117,16 +117,16 @@
 }
 
 template 
-void countConstruct(Alloc const& a, Tp *p) {
+void countConstruct(Alloc const&, Tp *p) {
   ++construct_called;
   last_construct_pointer = p;
   last_construct_alloc = ();
   last_construct_type = ();
   last_construct_args = ();
 }
 
 template 
-void countDestroy(Alloc const& a, Tp *p) {
+void countDestroy(Alloc const&, Tp *p) {
   ++destroy_called;
   last_destroy_alloc = ();
   last_destroy_type = ();
@@ -264,6 +264,7 @@
 template 
 void construct(U *p, Args&&... args) {
   auto *c = ::new ((void*)p) U(std::forward(args)...);
+  ((void)c); // Prevent unused warning
   P->countConstruct(*this, p);
 }
 
Index: test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
===
--- test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
+++ test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_values.pass.cpp
@@ -41,6 +41,7 @@
 using SA = std::scoped_allocator_adaptor;
 static_assert(std::uses_allocator::value, "");
 Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+assert(ptr != nullptr);
 Alloc CA(P);
 SA A(CA);
 A.construct(ptr, x, std::move(y));
@@ -65,6 +66,7 @@
 using SA = std::scoped_allocator_adaptor;
 static_assert(std::uses_allocator::value, "");
 Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+assert(ptr != nullptr);
 Alloc CA(P);
 SA A(CA);
 A.construct(ptr, std::move(x), y);
@@ -99,6 +101,7 @@
 static_assert(!std::uses_allocator::value, "");
 static_assert(std::uses_allocator::value, "");
 Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+assert(ptr != nullptr);
 Outer O(POuter);
 Inner I(PInner);
 SA A(O, I);
@@ -127,6 +130,7 @@
 static_assert(!std::uses_allocator::value, "");
 static_assert(std::uses_allocator::value, "");
 Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
+assert(ptr != nullptr);
 Outer O(POuter);
 Inner I(PInner);
 SA A(O, I);
Index: test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
===
--- test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
+++ test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair_rvalue.pass.cpp
@@ -42,6 +42,7 @@
 

[PATCH] D27777: [libcxx] [test] Fix MSVC x64 truncation warnings with 32-bit allocator size_type/difference_type.

2016-12-14 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

[libcxx] [test] Fix MSVC x64 truncation warnings with 32-bit allocator 
size_type/difference_type.

test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
Iterate with C::size_type because that's what operator[] takes.

test/std/containers/sequences/vector/contiguous.pass.cpp
test/std/strings/basic.string/string.require/contiguous.pass.cpp
Add static_cast because that's what the iterator's 
operator+ takes.


https://reviews.llvm.org/D2

Files:
  
test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
  
test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
  test/std/containers/sequences/vector/contiguous.pass.cpp
  test/std/strings/basic.string/string.require/contiguous.pass.cpp


Index: test/std/strings/basic.string/string.require/contiguous.pass.cpp
===
--- test/std/strings/basic.string/string.require/contiguous.pass.cpp
+++ test/std/strings/basic.string/string.require/contiguous.pass.cpp
@@ -22,7 +22,7 @@
 void test_contiguous ( const C  )
 {
 for ( size_t i = 0; i < c.size(); ++i )
-assert ( *(c.begin() + i) == *(std::addressof(*c.begin()) + i));
+assert ( *(c.begin() + static_cast(i)) == 
*(std::addressof(*c.begin()) + i));
 }
 
 int main()
Index: test/std/containers/sequences/vector/contiguous.pass.cpp
===
--- test/std/containers/sequences/vector/contiguous.pass.cpp
+++ test/std/containers/sequences/vector/contiguous.pass.cpp
@@ -21,7 +21,7 @@
 void test_contiguous ( const C  )
 {
 for ( size_t i = 0; i < c.size(); ++i )
-assert ( *(c.begin() + i) == *(std::addressof(*c.begin()) + i));
+assert ( *(c.begin() + static_cast(i)) == 
*(std::addressof(*c.begin()) + i));
 }
 
 int main()
Index: 
test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
===
--- 
test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
+++ 
test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
@@ -50,7 +50,7 @@
 test q(d, test_allocator(4));
 assert(q.get_allocator() == test_allocator(4));
 assert(q.size() == 5);
-for (std::size_t i = 0; i < d.size(); ++i)
+for (C::size_type i = 0; i < d.size(); ++i)
 {
 assert(q.top() == d[d.size() - i - 1]);
 q.pop();
Index: 
test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
===
--- 
test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
+++ 
test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
@@ -50,7 +50,7 @@
 test q(d, test_allocator(4));
 assert(q.get_allocator() == test_allocator(4));
 assert(q.size() == 5);
-for (std::size_t i = 0; i < d.size(); ++i)
+for (C::size_type i = 0; i < d.size(); ++i)
 {
 assert(q.front() == d[i]);
 q.pop();


Index: test/std/strings/basic.string/string.require/contiguous.pass.cpp
===
--- test/std/strings/basic.string/string.require/contiguous.pass.cpp
+++ test/std/strings/basic.string/string.require/contiguous.pass.cpp
@@ -22,7 +22,7 @@
 void test_contiguous ( const C  )
 {
 for ( size_t i = 0; i < c.size(); ++i )
-assert ( *(c.begin() + i) == *(std::addressof(*c.begin()) + i));
+assert ( *(c.begin() + static_cast(i)) == *(std::addressof(*c.begin()) + i));
 }
 
 int main()
Index: test/std/containers/sequences/vector/contiguous.pass.cpp
===
--- test/std/containers/sequences/vector/contiguous.pass.cpp
+++ test/std/containers/sequences/vector/contiguous.pass.cpp
@@ -21,7 +21,7 @@
 void test_contiguous ( const C  )
 {
 for ( size_t i = 0; i < c.size(); ++i )
-assert ( *(c.begin() + i) == *(std::addressof(*c.begin()) + i));
+assert ( *(c.begin() + static_cast(i)) == *(std::addressof(*c.begin()) + i));
 }
 
 int main()
Index: test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
===
--- test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
+++ test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
@@ -50,7 +50,7 @@
 test q(d, test_allocator(4));
 assert(q.get_allocator() == test_allocator(4));
 

[PATCH] D27270: [libcxx] [test] Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 4/4.

2016-12-14 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT abandoned this revision.
STL_MSFT added a comment.

Abandoning; I have changes in our STL to fix the bulk of these warnings, plus a 
small number of test changes that I'm about to send out.


https://reviews.llvm.org/D27270



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


[PATCH] D27691: [libcxx] [test] Fix size_t-to-int truncation warnings in syserr.hash.

2016-12-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT retitled this revision from "[libcxx] [test] Fix a size_t-to-int 
truncation warning in error_code.pass.cpp." to "[libcxx] [test] Fix 
size_t-to-int truncation warnings in syserr.hash.".
STL_MSFT updated the summary for this revision.
STL_MSFT updated this revision to Diff 81160.
STL_MSFT added a comment.

This regressed after r289363, adding that to the notes. Also, the 
error_condition test was equally affected, which I initially missed because we 
haven't implemented LWG 2686 "Why is std::hash specialized for error_code, but 
not error_condition?" yet (so the test is disabled for us).


https://reviews.llvm.org/D27691

Files:
  test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
  test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp


Index: test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
===
--- test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
+++ test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
@@ -23,16 +23,16 @@
 #include "test_macros.h"
 
 void
-test(std::size_t i)
+test(int i)
 {
 typedef std::error_condition T;
 typedef std::hash H;
 static_assert((std::is_same::value), "" );
 static_assert((std::is_same::value), "" );
 H h;
 T ec(i, std::system_category());
 const std::size_t result = h(ec);
-LIBCPP_ASSERT(result == i);
+LIBCPP_ASSERT(result == static_cast(i));
 ((void)result); // Prevent unused warning
 }
 
Index: test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
===
--- test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
+++ test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
@@ -23,16 +23,16 @@
 #include "test_macros.h"
 
 void
-test(std::size_t i)
+test(int i)
 {
 typedef std::error_code T;
 typedef std::hash H;
 static_assert((std::is_same::value), "" );
 static_assert((std::is_same::value), "" );
 H h;
 T ec(i, std::system_category());
 const std::size_t result = h(ec);
-LIBCPP_ASSERT(result == i);
+LIBCPP_ASSERT(result == static_cast(i));
 ((void)result); // Prevent unused warning
 }
 


Index: test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
===
--- test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
+++ test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
@@ -23,16 +23,16 @@
 #include "test_macros.h"
 
 void
-test(std::size_t i)
+test(int i)
 {
 typedef std::error_condition T;
 typedef std::hash H;
 static_assert((std::is_same::value), "" );
 static_assert((std::is_same::value), "" );
 H h;
 T ec(i, std::system_category());
 const std::size_t result = h(ec);
-LIBCPP_ASSERT(result == i);
+LIBCPP_ASSERT(result == static_cast(i));
 ((void)result); // Prevent unused warning
 }
 
Index: test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
===
--- test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
+++ test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
@@ -23,16 +23,16 @@
 #include "test_macros.h"
 
 void
-test(std::size_t i)
+test(int i)
 {
 typedef std::error_code T;
 typedef std::hash H;
 static_assert((std::is_same::value), "" );
 static_assert((std::is_same::value), "" );
 H h;
 T ec(i, std::system_category());
 const std::size_t result = h(ec);
-LIBCPP_ASSERT(result == i);
+LIBCPP_ASSERT(result == static_cast(i));
 ((void)result); // Prevent unused warning
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D27691: [libcxx] [test] Fix a size_t-to-int truncation warning in error_code.pass.cpp.

2016-12-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

[libcxx] [test] Fix a size_t-to-int truncation warning in error_code.pass.cpp.

This test was triggering MSVC x64 warning C4267
"conversion from 'size_t' to 'int', possible loss of data" by taking 0, 2, and 
10
as std::size_t, then constructing error_code(int, const error_category&)
from that (N4618 19.5.3.2 [syserr.errcode.constructors]/3).

The fix is simple: take these ints as int, pass them to the int-taking
constructor, and perform a value-preserving static_cast
when comparing them to `std::size_t result`.


https://reviews.llvm.org/D27691

Files:
  test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp


Index: test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
===
--- test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
+++ test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
@@ -23,16 +23,16 @@
 #include "test_macros.h"
 
 void
-test(std::size_t i)
+test(int i)
 {
 typedef std::error_code T;
 typedef std::hash H;
 static_assert((std::is_same::value), "" );
 static_assert((std::is_same::value), "" );
 H h;
 T ec(i, std::system_category());
 const std::size_t result = h(ec);
-LIBCPP_ASSERT(result == i);
+LIBCPP_ASSERT(result == static_cast(i));
 ((void)result); // Prevent unused warning
 }
 


Index: test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
===
--- test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
+++ test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
@@ -23,16 +23,16 @@
 #include "test_macros.h"
 
 void
-test(std::size_t i)
+test(int i)
 {
 typedef std::error_code T;
 typedef std::hash H;
 static_assert((std::is_same::value), "" );
 static_assert((std::is_same::value), "" );
 H h;
 T ec(i, std::system_category());
 const std::size_t result = h(ec);
-LIBCPP_ASSERT(result == i);
+LIBCPP_ASSERT(result == static_cast(i));
 ((void)result); // Prevent unused warning
 }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D26623: [libcxx] [test] Swapping non-equal non-POCS allocators is UB.

2016-12-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT abandoned this revision.
STL_MSFT added a comment.

r289358 fixes everything for me, thanks! Abandoning this revision.


https://reviews.llvm.org/D26623



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


[PATCH] D27555: [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory".

2016-12-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT abandoned this revision.
STL_MSFT added a comment.

Verified compiler fix. Abandoning this patch - nothing has been committed.


https://reviews.llvm.org/D27555



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


[PATCH] D27555: [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory".

2016-12-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Actually, the compiler bug was resolved as fixed earlier today.  Verifying...


https://reviews.llvm.org/D27555



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


[PATCH] D27270: [libcxx] [test] Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 4/4.

2016-12-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Yeah, users are free to do this, which also triggers conversion warnings for 
us. I think I'll need to investigate actually fixing/suppressing them in our 
sources and abandoning this patch; leaving it open for now as a todo.


https://reviews.llvm.org/D27270



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


[PATCH] D27555: [libcxx] [test] Fix MSVC warning C6001 "Using uninitialized memory".

2016-12-12 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Hmm, would a pragma guarded by _MSC_VER be better? I can easily do that. I've 
tried to avoid cluttering the test with VC-specific pragmas, but I understand 
your concern about initializing too much memory.


https://reviews.llvm.org/D27555



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


[PATCH] D27633: [libcxx] [test] Fix string_view tests.

2016-12-09 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

[libcxx] [test] Fix string_view tests.

test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
Passing -1 to size_t triggers signed/unsigned mismatch warnings because it's
a value-modifying conversion. Add static_cast to soothe the compiler.
(This file refers to size_t unqualified.)

test/std/strings/string.view/string.view.ops/substr.pass.cpp
Add  for std::min() and  for std::out_of_range.

N4618 21.4.2.4 [string.view.access]/1: "Requires: pos < size()."
/4: "[ Note: Unlike basic_string::operator[], 
basic_string_view::operator[](size())
has undefined behavior instead of returning charT(). -end note ]"


https://reviews.llvm.org/D27633

Files:
  test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
  test/std/strings/string.view/string.view.ops/substr.pass.cpp


Index: test/std/strings/string.view/string.view.ops/substr.pass.cpp
===
--- test/std/strings/string.view/string.view.ops/substr.pass.cpp
+++ test/std/strings/string.view/string.view.ops/substr.pass.cpp
@@ -16,6 +16,8 @@
 // Returns: basic_string_view(data()+pos, rlen).
 
 #include 
+#include 
+#include 
 #include 
 
 #include "test_macros.h"
@@ -39,7 +41,7 @@
 #endif
 const size_t rlen = std::min(n, sv.size() - pos);
 assert (sv1.size() == rlen);
-for (size_t i = 0; i <= rlen; ++i)
+for (size_t i = 0; i < rlen; ++i)
 assert(sv[pos+i] == sv1[i]);
 }
 
Index: 
test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
===
--- test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
+++ test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
@@ -376,7 +376,7 @@
 test("abcdefghijklmnopqrst", 5, 5, "", 20);
 test("abcdefghijklmnopqrst", 0, 8, "abcde", 15);
 test("abcdefghijklmnopqrst", 0, 12, "abcdefghij", 10);
-test("abcdefghijklmnopqrst", 0, -1, "abcdefghijklmnopqrst", 0);
+test("abcdefghijklmnopqrst", 0, static_cast(-1), 
"abcdefghijklmnopqrst", 0);
 }
 
 {
@@ -395,7 +395,7 @@
 test(L"abcdefghijklmnopqrst", 5, 5, L"", 20);
 test(L"abcdefghijklmnopqrst", 0, 8, L"abcde", 15);
 test(L"abcdefghijklmnopqrst", 0, 12, L"abcdefghij", 10);
-test(L"abcdefghijklmnopqrst", 0, -1, L"abcdefghijklmnopqrst", 0);
+test(L"abcdefghijklmnopqrst", 0, static_cast(-1), 
L"abcdefghijklmnopqrst", 0);
 }
 
 #if TEST_STD_VER >= 11
@@ -415,7 +415,7 @@
 test(U"abcdefghijklmnopqrst", 5, 5, U"", 20);
 test(U"abcdefghijklmnopqrst", 0, 8, U"abcde", 15);
 test(U"abcdefghijklmnopqrst", 0, 12, U"abcdefghij", 10);
-test(U"abcdefghijklmnopqrst", 0, -1, U"abcdefghijklmnopqrst", 0);
+test(U"abcdefghijklmnopqrst", 0, static_cast(-1), 
U"abcdefghijklmnopqrst", 0);
 }
 
 {
@@ -434,7 +434,7 @@
 test(u"abcdefghijklmnopqrst", 5, 5, u"", 20);
 test(u"abcdefghijklmnopqrst", 0, 8, u"abcde", 15);
 test(u"abcdefghijklmnopqrst", 0, 12, u"abcdefghij", 10);
-test(u"abcdefghijklmnopqrst", 0, -1, u"abcdefghijklmnopqrst", 0);
+test(u"abcdefghijklmnopqrst", 0, static_cast(-1), 
u"abcdefghijklmnopqrst", 0);
 }
 #endif
 


Index: test/std/strings/string.view/string.view.ops/substr.pass.cpp
===
--- test/std/strings/string.view/string.view.ops/substr.pass.cpp
+++ test/std/strings/string.view/string.view.ops/substr.pass.cpp
@@ -16,6 +16,8 @@
 // Returns: basic_string_view(data()+pos, rlen).
 
 #include 
+#include 
+#include 
 #include 
 
 #include "test_macros.h"
@@ -39,7 +41,7 @@
 #endif
 const size_t rlen = std::min(n, sv.size() - pos);
 assert (sv1.size() == rlen);
-for (size_t i = 0; i <= rlen; ++i)
+for (size_t i = 0; i < rlen; ++i)
 assert(sv[pos+i] == sv1[i]);
 }
 
Index: test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
===
--- test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
+++ test/std/strings/string.view/string.view.ops/compare.pointer_size.pass.cpp
@@ -376,7 +376,7 @@
 test("abcdefghijklmnopqrst", 5, 5, "", 20);
 test("abcdefghijklmnopqrst", 0, 8, "abcde", 15);
 test("abcdefghijklmnopqrst", 0, 12, "abcdefghij", 10);
-test("abcdefghijklmnopqrst", 0, -1, "abcdefghijklmnopqrst", 0);
+test("abcdefghijklmnopqrst", 0, static_cast(-1), "abcdefghijklmnopqrst", 0);
 }
 
 {
@@ -395,7 +395,7 @@
 test(L"abcdefghijklmnopqrst", 5, 5, L"", 20);
 test(L"abcdefghijklmnopqrst", 0, 8, L"abcde", 15);
 test(L"abcdefghijklmnopqrst", 0, 12, L"abcdefghij", 10);
-test(L"abcdefghijklmnopqrst", 0, -1, L"abcdefghijklmnopqrst", 0);
+test(L"abcdefghijklmnopqrst", 0, static_cast(-1), L"abcdefghijklmnopqrst", 0);
 }

[PATCH] D27622: [libcxx] [test] Add LIBCPP_ASSERT_NOEXCEPT/LIBCPP_ASSERT_NOT_NOEXCEPT, remove an unused variable.

2016-12-09 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

[libcxx] [test] Add LIBCPP_ASSERT_NOEXCEPT/LIBCPP_ASSERT_NOT_NOEXCEPT, remove 
an unused variable.

test/support/test_macros.h
For convenience/greppability, add macros for libcxx-specific static_asserts 
about noexceptness.

(Moving the definitions of ASSERT_NOEXCEPT/ASSERT_NOT_NOEXCEPT isn't 
technically necessary
because they're macros, but I think it's better style to define stuff before 
using it.)

test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
There was a completely unused `TrackedCallable obj;`.

apply() isn't depicted with conditional noexcept in C++17.

test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
Now that we have LIBCPP_ASSERT_NOEXCEPT, use it.


https://reviews.llvm.org/D27622

Files:
  test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
  test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
  test/support/test_macros.h

Index: test/support/test_macros.h
===
--- test/support/test_macros.h
+++ test/support/test_macros.h
@@ -128,23 +128,27 @@
 #define TEST_NORETURN [[noreturn]]
 #endif
 
+#define ASSERT_NOEXCEPT(...) \
+static_assert(noexcept(__VA_ARGS__), "Operation must be noexcept")
+
+#define ASSERT_NOT_NOEXCEPT(...) \
+static_assert(!noexcept(__VA_ARGS__), "Operation must NOT be noexcept")
+
 /* Macros for testing libc++ specific behavior and extensions */
 #if defined(_LIBCPP_VERSION)
 #define LIBCPP_ASSERT(...) assert(__VA_ARGS__)
 #define LIBCPP_STATIC_ASSERT(...) static_assert(__VA_ARGS__)
+#define LIBCPP_ASSERT_NOEXCEPT(...) ASSERT_NOEXCEPT(__VA_ARGS__)
+#define LIBCPP_ASSERT_NOT_NOEXCEPT(...) ASSERT_NOT_NOEXCEPT(__VA_ARGS__)
 #define LIBCPP_ONLY(...) __VA_ARGS__
 #else
 #define LIBCPP_ASSERT(...) ((void)0)
 #define LIBCPP_STATIC_ASSERT(...) ((void)0)
+#define LIBCPP_ASSERT_NOEXCEPT(...) ((void)0)
+#define LIBCPP_ASSERT_NOT_NOEXCEPT(...) ((void)0)
 #define LIBCPP_ONLY(...) ((void)0)
 #endif
 
-#define ASSERT_NOEXCEPT(...) \
-static_assert(noexcept(__VA_ARGS__), "Operation must be noexcept")
-
-#define ASSERT_NOT_NOEXCEPT(...) \
-static_assert(!noexcept(__VA_ARGS__), "Operation must NOT be noexcept")
-
 namespace test_macros_detail {
 template 
 struct is_same { enum { value = 0};} ;
Index: test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
===
--- test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
+++ test/std/utilities/tuple/tuple.tuple/tuple.apply/make_from_tuple.pass.cpp
@@ -175,14 +175,14 @@
 Tuple tup; ((void)tup);
 Tuple const& ctup = tup; ((void)ctup);
 ASSERT_NOT_NOEXCEPT(std::make_from_tuple(ctup));
-LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple(std::move(tup;
+LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple(std::move(tup)));
 }
 {
 using Tuple = std::pair;
 Tuple tup; ((void)tup);
 Tuple const& ctup = tup; ((void)ctup);
 ASSERT_NOT_NOEXCEPT(std::make_from_tuple(ctup));
-LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple(std::move(tup;
+LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple(std::move(tup)));
 }
 {
 using Tuple = std::tuple;
@@ -192,7 +192,7 @@
 {
 using Tuple = std::tuple;
 Tuple tup; ((void)tup);
-LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple(tup)));
+LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple(tup));
 }
 {
 using Tuple = std::array;
@@ -202,7 +202,7 @@
 {
 using Tuple = std::array;
 Tuple tup; ((void)tup);
-LIBCPP_ONLY(ASSERT_NOEXCEPT(std::make_from_tuple(tup)));
+LIBCPP_ASSERT_NOEXCEPT(std::make_from_tuple(tup));
 }
 }
 
Index: test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
===
--- test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
+++ test/std/utilities/tuple/tuple.tuple/tuple.apply/apply.pass.cpp
@@ -166,7 +166,6 @@
 
 void test_call_quals_and_arg_types()
 {
-TrackedCallable obj;
 using Tup = std::tuple;
 const int x = 42;
 unsigned y = 101;
@@ -199,15 +198,15 @@
 // test that the functions noexcept-ness is propagated
 using Tup = std::tuple;
 Tup t;
-ASSERT_NOEXCEPT(std::apply(nec, t));
+LIBCPP_ASSERT_NOEXCEPT(std::apply(nec, t));
 ASSERT_NOT_NOEXCEPT(std::apply(tc, t));
 }
 {
 // test that the noexcept-ness of the argument conversions is checked.
 using Tup = std::tuple;
 Tup t;
 ASSERT_NOT_NOEXCEPT(std::apply(nec, t));
-

[PATCH] D26626: [libcxx] [test] Fix an improper assumption about Null Forward Iterators.

2016-12-08 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

I could mark these assertions as libcxx-specific, but I tend to believe that 
they should be removed outright (even if the natural implementation of a list 
without debug checks provides this behavior).


https://reviews.llvm.org/D26626



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


[PATCH] D27541: [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 4/7.

2016-12-08 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

Responded to https://reviews.llvm.org/D27540. tuple is affected just like pair.


https://reviews.llvm.org/D27541



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


[PATCH] D27544: [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 7/7.

2016-12-08 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT updated the summary for this revision.
STL_MSFT updated this revision to Diff 80810.
STL_MSFT marked an inline comment as done.
STL_MSFT added a comment.

Changed test/std/re/re.traits/value.pass.cpp to iterate with wchar_t as 
requested.


https://reviews.llvm.org/D27544

Files:
  
test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
  
test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
  
test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
  
test/std/language.support/support.limits/limits/numeric.limits.members/infinity.pass.cpp
  test/std/numerics/complex.number/cmplx.over/arg.pass.cpp
  test/std/numerics/complex.number/cmplx.over/norm.pass.cpp
  test/std/numerics/rand/rand.eng/rand.eng.lcong/seed_result_type.pass.cpp
  test/std/re/re.traits/value.pass.cpp
  test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
  test/std/strings/string.view/string.view.hash/string_view.pass.cpp
  
test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp
  test/std/utilities/function.objects/unord.hash/integral.pass.cpp
  test/std/utilities/utility/exchange/exchange.pass.cpp
  test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp

Index: test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp
===
--- test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp
+++ test/std/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp
@@ -21,29 +21,29 @@
 {
 {
 typedef std::pair P1;
-P1 p1 = std::make_pair(3, 4);
+P1 p1 = std::make_pair(3, static_cast(4));
 assert(p1.first == 3);
 assert(p1.second == 4);
 }
 
 #if TEST_STD_VER >= 11
 {
 typedef std::pair P1;
-P1 p1 = std::make_pair(std::unique_ptr(new int(3)), 4);
+P1 p1 = std::make_pair(std::unique_ptr(new int(3)), static_cast(4));
 assert(*p1.first == 3);
 assert(p1.second == 4);
 }
 {
 typedef std::pair P1;
-P1 p1 = std::make_pair(nullptr, 4);
+P1 p1 = std::make_pair(nullptr, static_cast(4));
 assert(p1.first == nullptr);
 assert(p1.second == 4);
 }
 #endif
 #if TEST_STD_VER >= 14
 {
 typedef std::pair P1;
-constexpr P1 p1 = std::make_pair(3, 4);
+constexpr P1 p1 = std::make_pair(3, static_cast(4));
 static_assert(p1.first == 3, "");
 static_assert(p1.second == 4, "");
 }
Index: test/std/utilities/utility/exchange/exchange.pass.cpp
===
--- test/std/utilities/utility/exchange/exchange.pass.cpp
+++ test/std/utilities/utility/exchange/exchange.pass.cpp
@@ -22,10 +22,10 @@
 int v = 12;
 assert ( std::exchange ( v, 23 ) == 12 );
 assert ( v == 23 );
-assert ( std::exchange ( v, 67.2 ) == 23 );
+assert ( std::exchange ( v, static_cast(67) ) == 23 );
 assert ( v == 67 );
 
-assert ((std::exchange ( v, {} )) == 67 );
+assert ((std::exchange ( v, {} )) == 67 );
 assert ( v == 0 );
 
 }
Index: test/std/utilities/function.objects/unord.hash/integral.pass.cpp
===
--- test/std/utilities/function.objects/unord.hash/integral.pass.cpp
+++ test/std/utilities/function.objects/unord.hash/integral.pass.cpp
@@ -35,7 +35,7 @@
 
 for (int i = 0; i <= 5; ++i)
 {
-T t(i);
+T t(static_cast(i));
 if (sizeof(T) <= sizeof(std::size_t))
 {
 const std::size_t result = h(t);
Index: test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp
===
--- test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp
+++ test/std/utilities/function.objects/bind/func.bind/func.bind.bind/nested.pass.cpp
@@ -28,7 +28,7 @@
   T
   operator()(T a, T b)
   {
-return std::pow(a, b);
+return static_cast(std::pow(a, b));
   }
 };
 
Index: test/std/strings/string.view/string.view.hash/string_view.pass.cpp
===
--- test/std/strings/string.view/string.view.hash/string_view.pass.cpp
+++ test/std/strings/string.view/string.view.hash/string_view.pass.cpp
@@ -38,7 +38,7 @@
 char_type g1 [ 10 ];
 char_type g2 [ 10 ];
 for ( int i = 0; i < 10; ++i )
-g1[i] = g2[9-i] = '0' + i;
+g1[i] = g2[9-i] = static_cast('0' + i);
 T s1(g1, 10);
 T s2(g2, 10);
 assert(h(s1) != h(s2));
Index: test/std/strings/basic.string/string.cons/size_char_alloc.pass.cpp
===
--- 

  1   2   >