[AST] Fix the CXXFoldExpr source range when parentheses range is invalid.
authorHaojian Wu <hokein.wu@gmail.com>
Wed, 12 Aug 2020 07:20:23 +0000 (09:20 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Wed, 12 Aug 2020 07:20:23 +0000 (09:20 +0200)
commitdc7b1e9db58152273d3232cca3fa95cef721796b
tree4d9db4d613a60bb0ab059937c68111140c74721c
parente6c5e6efd080ab80f133a6591a7e4f0b617c291f
[AST] Fix the CXXFoldExpr source range when parentheses range is invalid.

The CXXFoldExpr's range is invalid if the cxxfoldexpr is formed via the
Concept's TypeContraints (because the parentheses are not written in the
source code). We fallback to use the range from the pattern.

Differential Revision: https://reviews.llvm.org/D85645
clang/include/clang/AST/ExprCXX.h
clang/test/AST/ast-dump-concepts.cpp