Fix two small bugs in typo correction. One assertion failure building member expressions because the lookup finds a different name than the original, fixed by updating the LookupResult's name with the name of the found decl. Second is that we also diagnose delayed typo exprs in the index of an array subscript expression.

The testcase shows a third bug with a FIXME in it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224183 91177308-0d34-0410-b5e6-96231b3b80d8
Pretty print support for template arg enum constants

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224184 91177308-0d34-0410-b5e6-96231b3b80d8
NFC: Minor formatting fix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224185 91177308-0d34-0410-b5e6-96231b3b80d8
Sema: Constexpr functions must have return statements which have an expr

clang lets programmers be pretty cavalier when it comes to void return
statements in functions which have non-void return types.  However, we
cannot be so forgiving in constexpr functions: evaluation will go off
the rails very quickly.

Instead, keep the return statement in the AST but mark the function as
invalid.  Doing so gives us nice diagnostics while making constexpr
evaluation halt.

This fixes PR21859.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224189 91177308-0d34-0410-b5e6-96231b3b80d8
Parse: MS property members cannot have an in-class initializer

We would crash trying to treat a property member as a field.  These
shoudl be forbidden anyway, reject programs which contain them.

This fixes PR21840.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224193 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: Add unsupported /Gv option (PR21892)

We don't currently support any of the calling convention options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224199 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: Make /Gd ignored instead of unsupported

/Gd is the default calling convention setting, so we don't
need to take any action.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224200 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: ignore /cgthreads (PR21894)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224201 91177308-0d34-0410-b5e6-96231b3b80d8
clang-cl: Fix handling of the /volatile flag (PR21893)

The /volatile:iso flag is our default behaviour, so it can be ignored.

Parse /volatile:ms as unsupported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224202 91177308-0d34-0410-b5e6-96231b3b80d8
Sema: attribute((annotate)) must have at least one argument

Sema::handleAnnotateAttr expects that some basic validation is done on
the given AttributeList.  However, ProcessAccessDeclAttributeList called
it directly.  Instead, pass the list to ProcessDeclAttribute.

This fixes PR21847.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224204 91177308-0d34-0410-b5e6-96231b3b80d8
If a non-template constructor instantiated to X(X),
ignore it during overload resolution when initializing
X from a value of type cv X.

Previously, our rule here only ignored specializations
of constructor templates.  That's probably because the
standard says that constructors are outright ill-formed
if their first parameter is literally X and they're
callable with one argument.  However, Clang only
enforces that prohibition against non-implicit
instantiations; I'm not sure why, but it seems to be
deliberate.  Given that, the most sensible thing to
do is to just ignore the "illegal" constructor
regardless of where it came from.

Also, stop ignoring such constructors silently:
print a note explaining why they're being ignored.

Fixes <rdar://19199836>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224205 91177308-0d34-0410-b5e6-96231b3b80d8
Lex: Don't crash if both conflict markers are on the same line

We would check if the terminator marker is on a newline.  However, the
logic would end up out-of-bounds if the terminator marker immediately
follows the start marker.

This fixes PR21820.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224210 91177308-0d34-0410-b5e6-96231b3b80d8
AST: Limit zero-sized constexpr behavior to array types

Restricting this "extension" to array types maximizes our standards
conformance while not miscompiling real-world programs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224215 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: Compound literals with funny types shouldn't crash

CodeGen assumed that a compound literal with array type should have a
corresponding LLVM IR array type.

We had two bugs in this area:
- Zero sized arrays in compound literals would lead to the creation of
  an opaque type.  This is unnecessary, we should just create an array
  type with a bound of zero.
- Funny record types (like unions) lead to exotic IR types for compound
  literals.  In this case, CodeGen must be prepared to deal with the
  possibility that it might not have an array IR type.

This fixes PR21912.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224219 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: More accurate line information for placement new.

This actually came up as a break in UBSan tests (look for a follow-up
commit to this one to see the UBSan test fallout) when I tried a broader
fix to location information.

I have some other ideas about how to do that broader change & will keep
looking into it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224221 91177308-0d34-0410-b5e6-96231b3b80d8
Don't break single-line raw string literals.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D6636

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224223 91177308-0d34-0410-b5e6-96231b3b80d8
MSVC: A wide string literal from L#macro_arg in a macro
Clang should form a wide string literal from L#macro_arg in a function-like macro in -fms-compatibility mode.
Fix for http://llvm.org/PR9984.
Differential Revision: http://reviews.llvm.org/D6604


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224228 91177308-0d34-0410-b5e6-96231b3b80d8
Bugfix for Codegen of atomic load/store/other ops.
Currently clang fires assertions on x86-64 on any atomic operations for long double operands. Patch fixes codegen for such operations.
Differential Revision: http://reviews.llvm.org/D6499


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224230 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed test/CodeGen/atomic_ops.c for compatibility with hexagon target


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224231 91177308-0d34-0410-b5e6-96231b3b80d8
Parse: Don't reorder tokens using ConsumeToken

ConsumeToken doesn't work with special tokens.  Instead, just use PP.Lex
to eat the token.

This fixes PR21817.

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