Fix PR13207 (Mangling of templates with back references when using -cxx-abi microsoft)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160667 91177308-0d34-0410-b5e6-96231b3b80d8
Introduces a new concept for binding results to matchers
as per Chandler's request:
- introduces a new matcher base type BindableMatcher that
  provides the bind() call
- makes all dynamic-cast matcher creation functions return
  BindableMatchers; the special case about dynamic-cast
  matchers is that the node they match on and the node
  their child matchers match on are the same node, just
  casted to a different type; thus, there is no ambiguity
  on what bind() matches on; additionally, those are the
  matchers that we name with nouns in the matcher language,
  so it's easy for users to intuitively know which matchers
  are bindable

To make this change possible, we got rid of a non-orthogonal
implementation of thisPointerType, which had an implicit
dynamic-cast matcher from CallExpr to CXXMemberCallExpr; as
alternative, we now provide a memberCall dynamic-cast matcher
and thisPointerType is a predicate on CXXMemberCallExpr.

Last, the ArgumentAdaptingMatcher is actually not required
for the implementation of makeDynCastAllOfComposite - this
simplification makes it more obvious where the bind() call
can be used based on the matcher creation function types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160673 91177308-0d34-0410-b5e6-96231b3b80d8
Comment parsing: retokenized text tokens are now pushed back in correct (not
reverse) order


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160675 91177308-0d34-0410-b5e6-96231b3b80d8
Move TextTokenRetokenizer from CommentLexer.h to CommentParser.cpp since it is
an implementation detail of the parser.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160679 91177308-0d34-0410-b5e6-96231b3b80d8
Comment parsing: couple TextTokenRetokenizer and comment parser together to
remove one of the two variable-length lookahead buffers.  Now retokenizer will
ask for more tokens when it needs them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160680 91177308-0d34-0410-b5e6-96231b3b80d8
Tweak warning text for returning incomplete type from extern "C" functions.

A warning was added in r150128 for returning non-C compatible
user-defined types from functions with C linkage.

This makes the text more clear for the case when the type isn't
decidedly non-C compatible, but incomplete.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160681 91177308-0d34-0410-b5e6-96231b3b80d8
Comment parsing: allow newlines between \param, direction specification (e.g.,
[in]), parameter name and description paragraph.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160682 91177308-0d34-0410-b5e6-96231b3b80d8
ABIArgInfo's constructor is private and only used by the static get* methods.
No need to abuse default arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160684 91177308-0d34-0410-b5e6-96231b3b80d8
Don't use a temporary file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160686 91177308-0d34-0410-b5e6-96231b3b80d8
Pedantic -pedantic correction. Duplicate cv-qualifiers are permitted in C++11
unless they appear in a decl-specifier-seq.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160688 91177308-0d34-0410-b5e6-96231b3b80d8
CommentSema: simplify functions, per Jordan's comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160689 91177308-0d34-0410-b5e6-96231b3b80d8
When a && or || appears as the condition of a ?:, perform appropriate
short-circuiting when building the CFG. Also be sure to skip parens before
checking for the && / || special cases. Finally, fix some crashes in CFG
printing in the presence of calls to destructors for array of array of class
type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160691 91177308-0d34-0410-b5e6-96231b3b80d8
Comment diagnostics: add warning for multiple \param commands with duplicate
parameter names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160696 91177308-0d34-0410-b5e6-96231b3b80d8
Comment diagnostics tests: add a function with zero arguments, for completeness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160697 91177308-0d34-0410-b5e6-96231b3b80d8
Add __has_feature(attribute_availability_with_message).

This tests for the ability to include a "message" field in availability
attributes, like so:

  extern void ATSFontGetName(const char *oName)
    __attribute__((availability(macosx,introduced=8.0,deprecated=9.0,
                                message="use CTFontCopyFullName")));

This was actually supported in Clang 3.1, but we got a request for a
__has_feature so that header files can use this more safely. It's
unfortunate that the 3.1 release doesn't include this, however.

<rdar://problem/11886458>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160699 91177308-0d34-0410-b5e6-96231b3b80d8
Comment parsing tests: fix test


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160700 91177308-0d34-0410-b5e6-96231b3b80d8
Make comments::Parser and comments::Sema noncopyable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160702 91177308-0d34-0410-b5e6-96231b3b80d8
PR12057: Allow variadic template pack expansions to cross lambda boundaries.
Rather than adding a ContainsUnexpandedParameterPack bit to essentially every
AST node, we tunnel the bit directly up to the surrounding lambda expression
when we reach a context where an unexpanded pack can not normally appear.
Thus any statement or declaration within a lambda can now potentially contain
an unexpanded parameter pack.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160705 91177308-0d34-0410-b5e6-96231b3b80d8