[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread James Dennett via Phabricator via cfe-commits
jdennett added a comment.

In D56731#1358907 , @Quuxplusone wrote:

> For my own use-cases, I will continue to want a 100% comprehensive `-Wctad`. 
> All these "heuristics" you're proposing seem very ad-hoc, and make a lot of 
> work for the compiler vendor, and seem complicated enough that I would still 
> worry about bugs slipping through the cracks. Whereas, if the user can simply 
> 100% outlaw CTAD, then they don't ever have to worry.


That's fair; I don't think anyone here is speaking against such a diagnostic 
(though maybe the name will be a bikeshed).  It's just that this patch is a 
solution for a different problem: allowing the sufficiently safe uses of CTAD 
without allowing too many bugs.


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

https://reviews.llvm.org/D56731



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


[PATCH] D28189: Extend documentation of how to test clang-tidy checks.

2017-01-02 Thread James Dennett via Phabricator via cfe-commits
jdennett marked 2 inline comments as done.
jdennett added a comment.

Thanks for the review.  I've address your comments, and will check over the 
(presumed-final) diff before submitting.




Comment at: docs/clang-tidy/index.rst:558
+typically the basic `CHECK` forms (`CHECK-MESSAGES` and `CHECK-FIXES`)
+are sufficient for matcher tests.  Note that the `FileCheck`
+documentation mostly assumes the default prefix (`CHECK`), and hence

alexfh wrote:
> I'm not sure the term "matcher tests" is used anywhere else in our 
> documentation. And it doesn't seem obvious to me either (if it refers to AST 
> matchers, then it's just an implementation detail of clang-tidy checks, if it 
> refers to the check patterns, then it's not a commonly used term for those 
> either). I don't know what would be a good short replacement, maybe 
> "clang-tidy lit tests" or just "clang-tidy tests".
I went with clang-tidy tests.  (The "matcher test" references are because I was 
thinking about some new matchers such as `argumentsAre(arg1, ..., argn)` at the 
same time, and didn't manage to do a complete context switch when working on 
these docs.  Thanks for catching that.)


https://reviews.llvm.org/D28189



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


[PATCH] D28189: Extend documentation of how to test clang-tidy checks.

2017-01-02 Thread James Dennett via Phabricator via cfe-commits
jdennett updated this revision to Diff 82818.
jdennett added a comment.

Addressed review comments: double-backtick quoting, underscores for references
to FileCheck, and change "matcher tests" to "clang-tidy tests".


https://reviews.llvm.org/D28189

Files:
  docs/clang-tidy/index.rst


Index: docs/clang-tidy/index.rst
===
--- docs/clang-tidy/index.rst
+++ docs/clang-tidy/index.rst
@@ -546,7 +546,26 @@
 The ``check_clang_tidy.py`` script provides an easy way to test both
 diagnostic messages and fix-its. It filters out ``CHECK`` lines from the test
 file, runs :program:`clang-tidy` and verifies messages and fixes with two
-separate `FileCheck`_ invocations. To use the script, put a .cpp file with the
+separate `FileCheck`_ invocations: once with FileCheck's directive
+prefix set to ``CHECK-MESSAGES``, validating the diagnostic messages,
+and once with the directive prefix set to ``CHECK-FIXES``, running
+against the fixed code (i.e., the code after generated fixits are
+applied). In particular, ``CHECK-FIXES:`` can be used to check
+that code was not modified by fixits, by checking that it is present
+unchanged in the fixed code.  The full set of `FileCheck`_ directives
+is available (e.g., ``CHECK-MESSAGES-SAME:``, ``CHECK-MESSAGES-NOT:``), though
+typically the basic ``CHECK`` forms (``CHECK-MESSAGES`` and ``CHECK-FIXES``)
+are sufficient for clang-tidy tests.  Note that the `FileCheck`_
+documentation mostly assumes the default prefix (``CHECK``), and hence
+describes the directive as ``CHECK:``, ``CHECK-SAME:``, ``CHECK-NOT:``, etc.
+Replace ``CHECK`` by either ``CHECK-FIXES`` or ``CHECK-MESSAGES`` for
+clang-tidy tests.
+
+An additional check enabled by ``check_clang_tidy.py`` ensures that
+if `CHECK-MESSAGES:` is used in a file then every warning or error
+must have an associated CHECK in that file.
+
+To use the ``check_clang_tidy.py`` script, put a .cpp file with the
 appropriate ``RUN`` line in the ``test/clang-tidy`` directory. Use
 ``CHECK-MESSAGES:`` and ``CHECK-FIXES:`` lines to write checks against
 diagnostic messages and fixed code.


Index: docs/clang-tidy/index.rst
===
--- docs/clang-tidy/index.rst
+++ docs/clang-tidy/index.rst
@@ -546,7 +546,26 @@
 The ``check_clang_tidy.py`` script provides an easy way to test both
 diagnostic messages and fix-its. It filters out ``CHECK`` lines from the test
 file, runs :program:`clang-tidy` and verifies messages and fixes with two
-separate `FileCheck`_ invocations. To use the script, put a .cpp file with the
+separate `FileCheck`_ invocations: once with FileCheck's directive
+prefix set to ``CHECK-MESSAGES``, validating the diagnostic messages,
+and once with the directive prefix set to ``CHECK-FIXES``, running
+against the fixed code (i.e., the code after generated fixits are
+applied). In particular, ``CHECK-FIXES:`` can be used to check
+that code was not modified by fixits, by checking that it is present
+unchanged in the fixed code.  The full set of `FileCheck`_ directives
+is available (e.g., ``CHECK-MESSAGES-SAME:``, ``CHECK-MESSAGES-NOT:``), though
+typically the basic ``CHECK`` forms (``CHECK-MESSAGES`` and ``CHECK-FIXES``)
+are sufficient for clang-tidy tests.  Note that the `FileCheck`_
+documentation mostly assumes the default prefix (``CHECK``), and hence
+describes the directive as ``CHECK:``, ``CHECK-SAME:``, ``CHECK-NOT:``, etc.
+Replace ``CHECK`` by either ``CHECK-FIXES`` or ``CHECK-MESSAGES`` for
+clang-tidy tests.
+
+An additional check enabled by ``check_clang_tidy.py`` ensures that
+if `CHECK-MESSAGES:` is used in a file then every warning or error
+must have an associated CHECK in that file.
+
+To use the ``check_clang_tidy.py`` script, put a .cpp file with the
 appropriate ``RUN`` line in the ``test/clang-tidy`` directory. Use
 ``CHECK-MESSAGES:`` and ``CHECK-FIXES:`` lines to write checks against
 diagnostic messages and fixed code.
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits