Better diagnostic for static override when methods are thiscall by default

Methods are thiscall by default in the MS ABI, and also in MinGW targetting GCC 4.7 or later.

This changes the diagnostic from the technically correct but hard to understand:

  virtual function 'foo' has different calling convention attributes ('void ()') than the function it overrides (which has calling convention 'void () __attribute__((thiscall))')

to the more intuitive and also correct:

  'static' member function 'foo' overrides a virtual function

We already have a test for this. Let's just run it in both ABI modes.

Differential Revision: http://llvm-reviews.chandlerc.com/D2375

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197055 91177308-0d34-0410-b5e6-96231b3b80d8
[analyzer] Add checker callbacks for MemberExpr and UnaryExprOrTypeTraitExpr.

Found by Arthur Yoo!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197059 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-cxxabi] Fix linkage of dtor thunks for anonymous classes

We were mistakengly giving linkonce_odr linkage instead of internal
linkage to the deleting and complete destructor thunks for classes in
anonymous namespaces.

Fixes PR17273.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197060 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64] Refactor the NEON scalar floating-point reciprocal estimate, floating-
point reciprocal exponent, and floating-point reciprocal square root estimate
LLVM AArch64 intrinsics to use f32/f64 types, rather than their vector
equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197069 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64] Refactor the NEON scalar floating-point reciprocal step and
floating-point reciprocal square root step LLVM AArch64 intrinsics to
use f32/f64 types, rather than their vector equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197070 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64] Add NEON scalar floating-point compare LLVM AArch64 intrinsics that
use f32/f64 types, rather than their vector equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197071 91177308-0d34-0410-b5e6-96231b3b80d8
[objcmt] When whitelisting the headers we want to modify, allow changing the
the ObjC implementation declarations, just don't change implementations for
classes that are not in the whitelisted headers.

For example, if we change a method to return 'instancetype' we should also
update the method definition in the implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197075 91177308-0d34-0410-b5e6-96231b3b80d8
[objcmt] When emitting a remap file, use a json format with the edit entries, instead of applying the changes
to a temp file directly.

This allows to combine the edits when they can be different based on whether you saw
the implementation or not, e.g. with the designated initializer migration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197076 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r197043, not a good comment

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197077 91177308-0d34-0410-b5e6-96231b3b80d8
No longer accepting attribute spellings with prefix and suffix underscores except for GNU attributes, or C++11-style attributes in the GNU namespace. This prevents attributes such as __declspec(__dllexport__) or [[__noreturn__]] from being treated as known attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197082 91177308-0d34-0410-b5e6-96231b3b80d8
[ms-abi][cleanup] Removing FinalizeCXXLayout : no functional change

After r196549 there is no need to separate FinalizeCXXLayout and 
FinalizeLayout so they were merged and FinalizeCXXLayout was eliminated.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197083 91177308-0d34-0410-b5e6-96231b3b80d8
Remove extra qualification to fix build with g++ after r197076

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197086 91177308-0d34-0410-b5e6-96231b3b80d8
[AArch64] Refactor NEON floating-point Max/Min/Maxnm/Minnm across vector AArch64
intrinsics to use f32 types, rather than their vector equivalents.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197091 91177308-0d34-0410-b5e6-96231b3b80d8
Change semantics of regex expectations in the diagnostic verifier

Previously, a line like

  // expected-error-re {{foo}}

treats the entirety of foo as a regex. This is inconvenient when matching type
names containing regex characters. For example, to match
"void *(class test8::A::*)(void)" inside such a regex, one would have to type
"void \*\(class test8::A::\*\)\(void\)".

This patch changes the semantics of expected-error-re to only treat the parts
of the directive wrapped in double curly braces as regexes. This avoids the
escaping problem and leads to nicer patterns for those cases; see e.g. the
change to test/Sema/format-strings-scanf.c.

(The balanced search for closing }} of a directive also makes us handle the
full directive in test\SemaCXX\constexpr-printing.cpp:41 and :53.)

Differential Revision: http://llvm-reviews.chandlerc.com/D2388

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197092 91177308-0d34-0410-b5e6-96231b3b80d8
Add new PrintingPolicy entry to trim number of newlines.  Useful for the CFG printer.

The change isn't completely comprehensive.  This can be filled in
lazily as needed.  There is one consumer right now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197093 91177308-0d34-0410-b5e6-96231b3b80d8
Add CFG tests for switch's involving "extended" enum.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197094 91177308-0d34-0410-b5e6-96231b3b80d8
Use llvm::Regex::Escape in VerifyDiagnosticConsumer.cpp

This depends on LLVM r197096.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197101 91177308-0d34-0410-b5e6-96231b3b80d8
Objective-C migrator: when inferring 'readonly' property of an
Objective-C object conforming to 'NSCopying' protocol, infer
a 'copy' property, instead of 'strong'. // rdar://15525937


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197102 91177308-0d34-0410-b5e6-96231b3b80d8
PR18217: Rewrite JumpDiagnostics' handling of temporaries, to correctly handle
declarations that might lifetime-extend multiple temporaries. In passing, fix a
crasher (PR18217) if an initializer was dependent and exactly the wrong shape,
and remove a bogus function (Expr::findMaterializedTemporary) now its last use
is gone.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197103 91177308-0d34-0410-b5e6-96231b3b80d8
Added a Subjects clause to the section attribute and made its diagnostics more consistent with other attributes.

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