Don't crash when binding a reference to a temporary pointer created from
resolving an overloaded function reference within an initializer list.
Previously we would try to resolve the overloaded function reference without
first stripping off the InitListExpr wrapper.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172517 91177308-0d34-0410-b5e6-96231b3b80d8
Resolved merge error with r172323 (llvm::X -> X)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172528 91177308-0d34-0410-b5e6-96231b3b80d8
Fixes various bugs around the keywords class, struct and union.

This switches to parsing record definitions only if we can clearly
identify them. We're specifically allowing common patterns for
visibility control through macros and attributes, but we cannot
currently fix all instances. This fixes all known bugs we have though.

Before:
static class A f() {
  return g();
} int x;

After:
static class A f() {
  return g();
}
int x;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172530 91177308-0d34-0410-b5e6-96231b3b80d8
Improve operator kind detection in presence of comments.

We used to incorrectly identify some operators (*, &, +, -, etc.) if
there were comments around them.

Example:
Before: int a = /**/ - 1;
After:  int a = /**/ -1;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172533 91177308-0d34-0410-b5e6-96231b3b80d8
Fix formatting of preprocessor directives (incluces, warnings & errors).

Treat tokens inside <> for includes and everything from the second token
of a warning / error on as an implicit string literal, e.g. do not
change its whitespace at all.

Now correctly formats:
 #include < path with space >
 #error Leave     all         white!!!!! space* alone!

Note that for #error and #warning we still format the space up to the
first token of the text, so:
   #  error   Text
will become
 #error Text

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172536 91177308-0d34-0410-b5e6-96231b3b80d8
Do not traverse the break-state when we know we cannot break anyway.

This is an optimization that djasper spottet. For now, we do not format
anything after the first token that belongs to such an implicit string
literal. All our state is not made for handling that anyway, so we'll
revisit this if we find a problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172537 91177308-0d34-0410-b5e6-96231b3b80d8
Add a test for -Wsemicolon-before-method-body fixit


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172545 91177308-0d34-0410-b5e6-96231b3b80d8
[driver/Darwin] Adjust SDKROOT handling code to not generate "-isysroot /".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172548 91177308-0d34-0410-b5e6-96231b3b80d8
Typo correction; no functional change.

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

Eliminate a cast and resulting cast-qual warning by using a temporary
as the target of memcpy.

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

Avoid a cast-away-const error by properly using const_cast<>.

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

Do proper casting to avoid a cast-away-const error.

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

Make the const_cast explicit to silence a compiler warning.

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

Properly use const_cast to fix a cast-away-const error.

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

Use const_cast<> to avoid a cast-away-const error.

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

Use const_cast<> to avoid a cast-away-const error.

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

Use const_cast<> to avoid a cast-away-const error.

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

Use const_cast<> to avoid a cast-away-const error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172565 91177308-0d34-0410-b5e6-96231b3b80d8
When checking availability attributes for consistency between an
overriding and overridden method, allow the overridden method to have
a narrower contract (introduced earlier, deprecated/obsoleted later)
than the overriding method. Fixes <rdar://problem/12992023>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172567 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid unsigned Compare to int

Cast arithmetic results to avoid comparison of an unsigned to an int.

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