Sema: Implement DR477

Summary: Friend declarations shouldn't mention explicit or virtual.

Reviewers: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207682 91177308-0d34-0410-b5e6-96231b3b80d8
Fix typos in carries_dependency docs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207686 91177308-0d34-0410-b5e6-96231b3b80d8
PR19601: std::remove_if does not really remove the elements.

It moves them at the end of the range instead, so an extra erase is needed.

It is strange that this code works without the erase. On the other hand, removing the remove_if will make fail some tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207696 91177308-0d34-0410-b5e6-96231b3b80d8
Comment parsing: remove HTML attribute validation

Since the community says that a blacklist is not good enough, and I don't have
enough time now to implement a proper whitelist, let's just remove the
attribute validation.

But, nevertheless, we can still communicate in the generated XML if our parser
found an issue with the HTML.  But this bit is best-effort and is specifically
called out in the schema as such.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207712 91177308-0d34-0410-b5e6-96231b3b80d8
Make typo-correction of inheriting constructors work a bit better. Limit
correction to direct base class members, and recover properly after we apply
such a correction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207731 91177308-0d34-0410-b5e6-96231b3b80d8
MS ABI x64: Don't destroy arguments twice on x64

We were destroying them in the callee, and then again in the caller.  We
should use an EH-only cleanup and disable it at the point of the call
for win64, even though we don't use inalloca.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207733 91177308-0d34-0410-b5e6-96231b3b80d8
Add support for __declspec(thread) under -fms-extensions

Reviewers: rsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207734 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid a potential race between stat() and open() of ASTFile

We need to open an ASTFile while checking its expected size and
modification time, or another clang instance can modify the file between
the stat() and the open().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207735 91177308-0d34-0410-b5e6-96231b3b80d8
write a line marker right before adding included file

Enclosing the original #include directive inside #if 0 adds lines,
so warning/errors messages would have the line number off in
"In file included from <file>:<line>:", so add line marker to fix this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207756 91177308-0d34-0410-b5e6-96231b3b80d8
do not warn about unknown pragmas in modes that do not handle them (pr9537)

And refactor to have just one place in code that sets up the empty
pragma handlers.



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

There's nothing wrong with the change itself, but
test/Frontend/rewrite-includes-messages.c fails without another
not-yet-committed fix.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207762 91177308-0d34-0410-b5e6-96231b3b80d8
do not use "1" for line marker for the main file

"1" means entering a new file (from a different one), but the main
file is not included from anything (and this would e.g. confuse -Wunused-macros
to not report unused macros in the main file, see pr15610, or also see pr18948).
The line marker is still useful e.g. if the resulting file is renamed or used
via a pipe.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207764 91177308-0d34-0410-b5e6-96231b3b80d8
Support 'remark' in VerifyDiagnosticConsumer

After Diego added support for -Rpass=inliner we have now in-tree remarks which
we can use to properly test this feature.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207765 91177308-0d34-0410-b5e6-96231b3b80d8
Fixing a FIXME -- no longer using std::memcpy, since that would fail for non-trivial types. Replaced with std::copy. No functional changes intended since all uses of this functionality either use pointers or integers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207766 91177308-0d34-0410-b5e6-96231b3b80d8
[libclang] Add attribute support for 'pure', 'const' and 'noduplicate'.

This bumps CINDEX_VERSION_MINOR up (to 26).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207767 91177308-0d34-0410-b5e6-96231b3b80d8
MSVCCompat: Don't produce an invalid AST when accepting void pseudo-dtors

We accept 'void *p; p->~void();' for MSVC compatibility since r148682.
However, we were returning ExprError, rather than producing an AST,
despite only diagnosing it with a warning.  CodeGen noticed that the
template function specialization had an invalid AST, and therefore
didn't generate code for it.  This change makes us produce an AST with a
void pseudo-dtor call.

Part of PR18256.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207771 91177308-0d34-0410-b5e6-96231b3b80d8
Fix declspec-thread.cpp test with a triple

Not all triples support it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207772 91177308-0d34-0410-b5e6-96231b3b80d8
Fix typo (first commit to test commit access).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207775 91177308-0d34-0410-b5e6-96231b3b80d8
AST: Mangle reference temporaries reliably

Summary:
Previously, we would generate a single name for all reference
temporaries and allow LLVM to rename them for us.  Instead, number the
reference temporaries as we build them in Sema.

Reviewers: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207776 91177308-0d34-0410-b5e6-96231b3b80d8
Fix debug-info-alias test to add CHECK to some lines that were missing it.

To simplify source location offsets, this test uses line directives to
force particular lines of interest to have known line numbers so that
adjustments before/after those points don't require updates to the CHECK
lines.

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