hanchenye-llvm-project/clang-tools-extra
Melanie Blower 759948467e Reapply "Fix crash on switch conditions of non-integer types in templates"
This patch reapplies commit 76945821b9. The first version broke
buildbots due to clang-tidy test fails. The fails are because some
errors in templates are now diagnosed earlier (does not wait till
instantiation). I have modified the tests to add checks for these
diagnostics/prevent these diagnostics. There are no additional code
changes.

Summary of code changes:

Clang currently crashes for switch statements inside a template when the
condition is a non-integer field member because contextual implicit
conversion is skipped when parsing the condition. This conversion is
however later checked in an assert when the case statement is handled.
The conversion is skipped when parsing the condition because
the field member is set as type-dependent based on its containing class.
This patch sets the type dependency based on the field's type instead.

This patch fixes Bug 40982.

Reviewers: rnk, gribozavr2

Patch by: Elizabeth Andrews (eandrews)

Differential revision: https://reviews.llvm.org/D69950
2019-11-08 10:17:06 -08:00
..
clang-apply-replacements [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible 2019-10-04 20:30:02 +00:00
clang-change-namespace [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible 2019-10-04 20:30:02 +00:00
clang-doc [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible 2019-10-04 20:30:02 +00:00
clang-include-fixer [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible 2019-10-04 20:30:02 +00:00
clang-move [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible 2019-10-04 20:30:02 +00:00
clang-query [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible 2019-10-04 20:30:02 +00:00
clang-reorder-fields [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible 2019-10-04 20:30:02 +00:00
clang-tidy [clang-tidy] Update TransformerClangTidyCheck to use new Transformer bindings. 2019-11-06 10:13:33 -05:00
clangd [clangd] NFC, hide the internal-only utility function lex. 2019-11-07 10:58:09 +01:00
docs [clang-tidy] Add readability-make-member-function-const 2019-11-06 09:27:02 +01:00
modularize [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible 2019-10-04 20:30:02 +00:00
pp-trace [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible 2019-10-04 20:30:02 +00:00
test Reapply "Fix crash on switch conditions of non-integer types in templates" 2019-11-08 10:17:06 -08:00
tool-template [clang-tools-extra] [cmake] Link against libclang-cpp whenever possible 2019-10-04 20:30:02 +00:00
unittests [clang-tidy] Update TransformerClangTidyCheck to use new Transformer bindings. 2019-11-06 10:13:33 -05:00
.arcconfig
.gitignore
CMakeLists.txt Remove clang-tidy-vs from clang-tools-extra (PR41791) 2019-08-27 18:36:08 +00:00
CODE_OWNERS.TXT Update CODE_OWNERS.txt for clang-doc 2019-06-28 17:32:26 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
README.txt

README.txt

//===----------------------------------------------------------------------===//
// Clang Tools repository
//===----------------------------------------------------------------------===//

Welcome to the repository of extra Clang Tools.  This repository holds tools
that are developed as part of the LLVM compiler infrastructure project and the
Clang frontend.  These tools are kept in a separate "extra" repository to
allow lighter weight checkouts of the core Clang codebase.

This repository is only intended to be checked out inside of a full LLVM+Clang
tree, and in the 'tools/extra' subdirectory of the Clang checkout.

All discussion regarding Clang, Clang-based tools, and code in this repository
should be held using the standard Clang mailing lists:
  http://lists.llvm.org/mailman/listinfo/cfe-dev

Code review for this tree should take place on the standard Clang patch and
commit lists:
  http://lists.llvm.org/mailman/listinfo/cfe-commits

If you find a bug in these tools, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/