• Home
  • History
  • Annotate
  • only in /external/clang/test/Parser/
History log of /external/clang/test/Parser/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
icrosoftExtensions.c
icrosoftExtensions.cpp
icrosoftExtensionsInlineAsm.c
ltivec-csk-bool.c
ltivec.c
rackets.c
rackets.cpp
uda-kernel-call-c++11.cu
uda-kernel-call.cu
xx-altivec.cpp
xx-ambig-decl-expr-xfail.cpp
xx-template-decl.cpp
xx0x-member-initializers.cpp
s-if-exists.cpp
s-inline-asm-nested-braces.c
s-inline-asm.c
ragma-loop.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
elayedTemplateParsing.cpp
icrosoftExtensions.c
ltivec.c
rm-windows-calling-convention-handling.c
ttributes.c
heck-objc2-syntax-1.m
ompound_literal.c
xx-altivec.cpp
xx-casting.cpp
xx0x-attributes.cpp
xx0x-for-range.cpp
xx0x-lambda-expressions.cpp
xx11-user-defined-literals.cpp
of.cpp
pencl-astype.cl
ragma-optimize-diagnostics.cpp
ecovery.cpp
witch-recovery.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
elayedTemplateParsing.cpp
icrosoftExtensions.c
icrosoftExtensions.cpp
ltivec-csk-bool.c
sm.c
ttributes.c
ttributes.mm
ad-control.c
uiltin_classify_type.c
heck-objc2-syntax-1.m
xx-class.cpp
xx-decl.cpp
xx-friend.cpp
xx-reference.cpp
xx-template-argument.cpp
xx-template-decl.cpp
xx-using-declaration.cpp
xx0x-ambig.cpp
xx0x-attributes.cpp
xx0x-decl.cpp
xx0x-lambda-expressions.cpp
xx0x-rvalue-reference.cpp
xx11-type-specifier.cpp
xx11-user-defined-literals.cpp
eclarators.c
iag-crash.c
s-inline-asm.c
amespace-alias-attr.cpp
bjc-error-qualified-implementation.m
bjcbridge-related-attribute.m
bjcxx11-attributes.mm
pencl-keywords.cl
ecovery.cpp
arn-semicolon-before-method-body.m
e78e8fc27140309092fb56d77a72f31fa085f9da 23-Dec-2013 Bill Wendling <isanbard@gmail.com> ---Merging r196453

Parse: Recover better from bad definitions with base specifiers

We would skip until the next comma, hoping good things whould lie there,
however this would fail when we have such things as this:

struct A {};
template <typename>
struct D;
template <>
struct D<C> : B, A::D;

Once this happens, we would believe that D with a nested namespace
specifier of A was a variable that was being declared. We would go on
to complain that there was an extraneous 'template <>' on their variable
declaration.

Crashes would happen when 'A' gets defined as 'enum class A {}' as
various asserts would fire.

Instead, we should skip up until the semicolon if we see that we are in
the middle of a definition and the current token is a ':'

This fixes PR17084.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@197905 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.cpp
f0cc19f43d5e05dbd22d00faca8c093b7005be3f 19-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195163:
------------------------------------------------------------------------
r195163 | rsmith | 2013-11-19 14:47:36 -0800 (Tue, 19 Nov 2013) | 5 lines

PR9547: If we're parsing a simple-declaration that contains a tag definition,
and we see an ill-formed declarator that would probably be well-formed if the
tag definition were just missing a semicolon, use that as the diagnostic
instead of producing some other mysterious error.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195165 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
ecovery.cpp
7faf81ff1dc8f8dc724e928ba90ccbfad0fdc2bc 16-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17949: Fix crash if someone puts a namespace inside a class template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194872 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.cpp
aed01168e7593c42ce99aaf1c48deeb8a77dd120 15-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Diagnose C++11 attributes before fp_contract pragmas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194850 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-stmt-attributes.cpp
b72227faec6ac8aa78d1cc230d8d575c874f36a4 15-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix bogus diagnostic wording. There's no such thing as a compound expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194849 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-fp-contract.c
d1fa81ccbce1ba2d8f467e7c2800250b81ea2e35 13-Nov-2013 Serge Pavlov <sepavloff@gmail.com> Warn on duplicate function specifier

This patch fixes PR8264. Duplicate qualifiers already are diagnozed,
now the same diagnostics is issued for duplicate function specifiers.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194559 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
b310439121c875937d78cc49cc969bc1197fc025 09-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Try to recover a bit better if a close brace is missing from the end of a class
definition. If we see something that looks like a namespace definition inside a
class, that strongly indicates that a close brace was missing somewhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194319 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.cpp
c4fb7ef24f3586fd88dd548cd3789125109e7b1f 09-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix name in test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194291 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
0464e09c7ba8e436e6caed06b0377cdeddc3e3ec 08-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix %select numbering confusion between diagnostic and Diag call.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194281 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
d386fef64f1fd00fc9a97efb963d8ec393fd1ace 31-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Factor out custom parsing for iboutletcollection and vec_type_hint attributes
into a separate "parse an attribute that takes a type argument" codepath. This
results in both codepaths being a lot cleaner and simpler, and fixes some bugs
where the type argument handling bled into the expression argument handling and
caused us to both accept invalid and reject valid attribute arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193731 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.c
xx-attributes.cpp
8fa2cbf31edbd5124692864007de566d59125559 29-Oct-2013 Nick Lewycky <nicholas@mxc.ca> Add missing attributes [[gnu::no_sanitize_address]] and
[[gnu::no_address_safety_analysis]].


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193583 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
966a0fc4681a6c3b55ed6c1404c10d9816eeefda 29-Oct-2013 Nick Lewycky <nicholas@mxc.ca> Treat [[gnu::__const]] the same as [[gnu::const]]. GCC's tokenizer can't tell
the difference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193582 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
961d0573487933199cb287ce8c472121812b3c78 28-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix a parser crash when there are #pragmas in a context which requires a single
statement (after a case label, if, etc). Patch by Olivier Goffart!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193545 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-weak.c
df1cce5bcd367ee47f4a7579c3a1cb4618248514 24-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Support GNU attributes in alias-declarations now that GCC has implemented them
and we know where they go.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193297 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-decl.cpp
d92aa2d2880d1c30baff996cb4c4f0836dbc355e 24-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17666: Instead of allowing an initial identifier argument in any attribute
which we don't think can't have one, only allow it in the tiny number of
attributes which opts into this weird parse rule.

I've manually checked that the handlers for all these attributes can in fact
cope with an identifier as the argument. This is still somewhat terrible; we
should move more fully towards picking the parsing rules based on the
attribute, and make the Parse -> Sema interface more type-safe.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193295 91177308-0d34-0410-b5e6-96231b3b80d8
xx-attributes.cpp
645526c3e42170e356f792b1bc0ac2acb65c26c4 23-Oct-2013 David Majnemer <david.majnemer@gmail.com> Parse: Disable delayed template parsing for constexpr functions

Commit r191484 treated constexpr function templates as normal function
templates with respect to delaying their parsing. However, this is
unnecessarily restrictive because there is no compatibility concern with
constexpr, MSVC doesn't support it.

Instead, simply disable delayed template parsing for constexpr function
templates. This largely reverts the changes made in r191484 but keeps
it's unit test.

This fixes PR17661.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193274 91177308-0d34-0410-b5e6-96231b3b80d8
elayedTemplateParsing.cpp
d661d50118716e9695af5a893a2df45e87a6b3c8 22-Oct-2013 Chandler Carruth <chandlerc@gmail.com> Revert r193073 and the attempt to fix it in r193170.

This patch wasn't reviewed, and isn't correctly preserving the behaviors
relied upon by QT. I don't have a direct example of fallout, but it
should go through the standard code review process. For example, it
should never have removed the QT test case that was added when fixing
those users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193174 91177308-0d34-0410-b5e6-96231b3b80d8
ad-control.c
37acb250dbcf580393c9936c1e71552f84220398 22-Oct-2013 Serge Pavlov <sepavloff@gmail.com> Reenable 'break' in 'for' specifier to allow compilation of QT macro 'foreach'

This is a fix to PR17649, caused by fix in r193073. QT uses 'break' statement
to implement their 'foreach' macro. To enable build of QT, this fix reenables
break but only in 'for' statement specifier and only in the third expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193170 91177308-0d34-0410-b5e6-96231b3b80d8
ad-control.c
2cfbf0552f90c7ef42975ca1b9064888550ca2ee 22-Oct-2013 Reid Kleckner <reid@kleckner.net> Revert "Re-enable passing MS inline asm test."

Microsoft inline asm crashes on the hexagon bot for unknown reasons.

This reverts commit r193124.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193128 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
150f9da3b7cbef35563e1c7bbd681b29329e463d 22-Oct-2013 Reid Kleckner <reid@kleckner.net> Re-enable passing MS inline asm test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193124 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
fb90266d8bb5a977de45d07e702277f4cb54d74e 21-Oct-2013 Serge Pavlov <sepavloff@gmail.com> Fix to PR8880 (clang dies processing a for loop).

Due to statement expressions supported as GCC extension, it is possible
to put 'break' or 'continue' into a loop/switch statement but outside its
body, for example:

for ( ; ({ if (first) { first = 0; continue; } 0; }); )

Such usage must be diagnosed as an error, GCC rejects it. To recognize
this and similar patterns the flags BreakScope and ContinueScope are
temporarily turned off while parsing condition expression.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193073 91177308-0d34-0410-b5e6-96231b3b80d8
ad-control.c
b5c7768a74936d4e2c7a484570a638cb74702d8b 19-Oct-2013 Kaelyn Uhrain <rikka@google.com> Allow CorrectTypo to replace CXXScopeSpecifiers that refer to classes.

Now that CorrectTypo knows how to correctly search classes for typo
correction candidates, there is no good reason to only replace an
existing CXXScopeSpecifier if it refers to a namespace. While the actual
enablement was a matter of changing a single comparison, the fallout
from enabling the functionality required a lot more code changes
(including my two previous commits).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193020 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-directive.cpp
witch-recovery.cpp
530fa4fc800f2788cfe6d4113677ca631d1e801f 18-Oct-2013 Alp Toker <alp@nuanti.com> Check "late parsed" friend functions for redefinition

r177003 applied the late parsed template technique to friend functions
but omitted the corresponding check for redefinitions.

This patch adds the same check already in use for templates to the
new code path in order to diagnose and reject invalid redefinitions
that were being silently accepted.

Fixes PR17324.

Reviewed by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192948 91177308-0d34-0410-b5e6-96231b3b80d8
xx-friend.cpp
5eed7e00b4ac8d589ca83e126dafa8767e8a0358 15-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Tidy up and improve error recovery for C++11 attributes in bad places. Based on
a patch by Michael Han.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192666 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
b79b17b67f2c0de8fd343fdd070e5ccbfe20d602 15-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17567: Improve diagnostic for a mistyped constructor name. If we see something
that looks like a function declaration, except that it's missing a return type,
try typo-correcting it to the relevant constructor name.

In passing, fix a bug where the missing-type-specifier recovery codepath would
drop a preceding scope specifier on the floor, leading to follow-on diagnostics
and incorrect recovery for the auto-in-c++98 hack.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192644 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
xx0x-in-cxx98.cpp
8d1ab8a083d5613b24bbfd68bf02cd2a295dab22 14-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't get confused by a virt-specifier after a trailing-return-type - it's not
an accidentally-included name for the declarator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192559 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-decl.cpp
fbac5c11d4ecd39f083a8d7247ddcb5a0a49c667 10-Oct-2013 Benjamin Kramer <benny.kra@googlemail.com> Parser: Avoid a crash-on-invalid when trying to diagnose function calls with -> in it.

Use the existing convenience function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192347 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
eeac7a4bb4bf6b2bf423ec84eabcf179b9d7e4ea 09-Oct-2013 David Majnemer <david.majnemer@gmail.com> Make wording for certain invalid unary expressions more consistent.

An invalid decltype expression like 'decltype int' gives:
error: expected '(' after 'decltype'

This makes it so 'sizeof int' gives a similar one:
error: expected parentheses around type name in sizeof expression


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192258 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.c
5dbed6674bda07dd147183932bc843c52205633f 09-Oct-2013 Reid Kleckner <reid@kleckner.net> -Wmicrosoft: Don't warn on non-inline pure virtual method definitions

MSVC and clang with -fms-extensions allow pure virtual methods to be
defined inline after the "= 0" tokens. Clang warns on these because it
is not standard, but incorrectly warns on out-of-line definitions, which
are standard.

With this change, clang will only warn on inline definitions of pure
virtual methods.

Fixes some self-host warnings on out-of-line definitions of pure virtual
destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192244 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
2e391e516c70c64457c009574de18d0a29ca42b6 08-Oct-2013 Serge Pavlov <sepavloff@gmail.com> Fixed messages in tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192208 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.c
2a0a49612ec8866fe2e75b1e0aab04326861b5f2 08-Oct-2013 Serge Pavlov <sepavloff@gmail.com> Add fixits suggesting parenthesis around type name in expressions like sizeof.
This fixes PR16992 - Fixit missing when "sizeof type" found.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192200 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.c
9beaf20b882eb83082da27a74760277bb9fc0bdd 28-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add compat/extension warnings for init captures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191609 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
bjcxx0x-lambda-expressions.mm
04fa7a33279808dc3e5117c41b5f84c40eeb7362 28-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Per latest drafting, switch to implementing init-captures as if by declaring
and capturing a variable declaration, and complete the implementation of them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191605 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
c420e3cbafbc0468645ca9aab1b71c76c30d280f 27-Sep-2013 David Majnemer <david.majnemer@gmail.com> AST: Handle multidimensional arrays inside of __uuidof()

We previously handled one-dimensional arrays but didn't consider the
general case. The fix is simple: keep going through subsequent
dimensions until we get to the base element.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191493 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
54679205de1a348f410d03ce4b331b56b21dce49 27-Sep-2013 David Majnemer <david.majnemer@gmail.com> Sema: Respect -fdelayed-template-parsing when parsing constexpr functions

Functions declared as constexpr must have their parsing delayed in
-fdelayed-template-parsing mode so as not to upset later template
instantiation.

N.B. My reading of the standard makes it seem like delayed template
parsing is at odds with constexpr. We may want to make refinements in
other places in clang to make constexpr play nicer with this feature.

This fixes PR17334.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191484 91177308-0d34-0410-b5e6-96231b3b80d8
elayedTemplateParsing.cpp
2330df43c89dfbcf888a1b0d608f71546f29b6cf 24-Sep-2013 Fariborz Jahanian <fjahanian@apple.com> Revert my patch in r191155 to allow forward
class/protocol decls in @implementation and
fixup modern rewriter to handle that.
// rdar://15066233


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191311 91177308-0d34-0410-b5e6-96231b3b80d8
issing-end-4.m
ff989a8b1d3cf52131c179fceea656d7977e5b3c 22-Sep-2013 David Majnemer <david.majnemer@gmail.com> Parse: Don't crash during parsing if we lack a simple-type-specifier

Summary:
Parsing cast expressions during error recovery can put us in a bad
state. Check to see if the token for a simple-type-specifier makes
sense before further parsing.

Fixes PR17255.

Reviewers: rsmith, doug.gregor, CornedBee, eli.friedman

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191159 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
44242396a3cf647f4f45058856c7e751df1d9a6e 22-Sep-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC: ObjC declarations, including forward class
and protocols can be at global scope only.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191155 91177308-0d34-0410-b5e6-96231b3b80d8
issing-end-4.m
ef8f90caa14d85cffba2fea4b6bd425c3b22eea7 20-Sep-2013 Richard Trieu <rtrieu@google.com> Modify the uninitialized field visitor to detect uninitialized use across the
fields in the class. This allows a better checking of member intiailizers and
in class initializers in regards to initialization ordering.

For instance, this code will now produce warnings:

class A {
int x;
int y;
A() : x(y) {} // y is initialized after x, warn here
A(int): y(x) {} // default initialization of leaves x uninitialized, warn here
};

Several test cases were updated with -Wno-uninitialized to silence this warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191068 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ambig-init-templ.cpp
c561714647f16b028f2c098ae810bd553138d17b 13-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> As Aaron pointed out it's simpler to reject wide string availability attr messages in the parser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190706 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
9bd3cdc3b78653275a36f15df81e1def3b2db8db 13-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR13657 (and duplicates):

When a comma occurs in a default argument or default initializer within a
class, disambiguate whether it is part of the initializer or whether it ends
the initializer.

The way this works (which I will be proposing for standardization) is to treat
the comma as ending the default argument or default initializer if the
following token sequence matches the syntactic constraints of a
parameter-declaration-clause or init-declarator-list (respectively).

This is both consistent with the disambiguation rules elsewhere (where entities
are treated as declarations if they can be), and should have no regressions
over our old behavior. I think it might also disambiguate all cases correctly,
but I don't have a proof of that.

There is an annoyance here: because we're performing a tentative parse in a
situation where we may not have seen declarations of all relevant entities (if
the comma is part of the initializer, lookup may find entites declared later in
the class), we need to turn off typo-correction and diagnostics during the
tentative parse, and in the rare case that we decide the comma is part of the
initializer, we need to revert all token annotations we performed while
disambiguating.

Any diagnostics that occur outside of the immediate context of the tentative
parse (for instance, if we trigger the implicit instantiation of a class
template) are *not* suppressed, mirroring the usual rules for a SFINAE context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190639 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ambig-init-templ.cpp
xx-default-args.cpp
xx0x-member-initializers.cpp
29b37a06fc58bb2993d1c35cf7411b6b94b1116a 07-Sep-2013 David Majnemer <david.majnemer@gmail.com> AST: __uuidof should leak through templated types

Summary:
__uuidof on templated types should exmaine if any of its template
parameters have a uuid declspec. If exactly one does, then take it.
Otherwise, issue an appropriate error.

Reviewers: rsmith, thakis, rnk

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190240 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
9ec28913dcec67bf3f6b841f34d1401229ba4604 06-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++11 attributes after 'constructor-name (' unambiguously signal that we have a
constructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190111 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
efb288c3c1e67cb94410fd43aa0352922bcb5d52 05-Sep-2013 Richard Trieu <rtrieu@google.com> For "expected unqualified-id" errors after a double colon, and the double colon
is at the end of the line, point to the location after the double colon instead
of at the next token. There is more context to be given this way. In addition,
the next token can be several lines later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190029 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
67ac9989e3ec53174b524ab8bc7d08185346cace 04-Sep-2013 David Majnemer <david.majnemer@gmail.com> Parser: support Microsoft syntax for 'typename typedef'

Summary:
Transform the token sequence for:
typename typedef T U;

to:
typename T typedef U;

Raise a diagnostic when this happens but only if we succeeded handling
the typename.

Reviewers: rsmith, rnk

Reviewed By: rsmith

CC: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189867 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
d1282ec56231c967439c1eb67fe4afe792287911 23-Aug-2013 David Majnemer <david.majnemer@gmail.com> Sema: Properly support Microsoft-mode template arguments

Summary:
There were two things known to be wrong with our implementation of MSVC
mode template arguments:

- We didn't properly handle __uuidof/CXXUuidofExpr and skipped all type
checking completely.
- We didn't allow for MSVC's extension of allowing certain constant
"foldable" expressions from showing up in template arguments.
They allow various casts dereference and address-of operations.
We can make it more general as we find further peculiarities but this
is the known extent.

Reviewers: rsmith, doug.gregor, rjmccall

Reviewed By: doug.gregor

CC: cfe-commits, rnk

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189087 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
2d67097ad41f4c2fe82ebce3f587e06498f1bd71 17-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor all diagnosing of TypoCorrections through a common function, in
preparation for teaching this function how to diagnose a correction that
includes importing a module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188602 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.cpp
4fce06cd52a8f4714524baa13b544ead9fd298a4 14-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Fix Altivec vector literal parser hack for C++11.

It doesn't make any sense to accept "..." in the argument to a C-style cast,
so use a separate expression list parsing routine which rejects it. PR16874.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188330 91177308-0d34-0410-b5e6-96231b3b80d8
xx-altivec.cpp
62f675cf69ca52c163fd9c0564d84356bb7ffca1 10-Aug-2013 Serge Pavlov <sepavloff@gmail.com> Avoid spurious error messages if parent template class cannot be instantiated

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188133 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-argument.cpp
fcbe20811e3848869054ad13352cbb431bd423eb 01-Aug-2013 David Majnemer <david.majnemer@gmail.com> Parse: Don't consider attributes of broken member declarators

ParseCXXClassMemberDeclaration was trying to use the result of
ActOnCXXMemberDeclarator to attach it to some late parsed attributes.

However when failures arise, we have no decl to attach to which
eventually leads us to a NULL pointer dereference.

While we are here, clean up the code a bit.

Fixes PR16765


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187557 91177308-0d34-0410-b5e6-96231b3b80d8
xx-attributes.cpp
3cd6feb87a62fb52c31cbc83655d76ace020513f 30-Jul-2013 Aaron Ballman <aaron@aaronballman.com> err_attribute_not_string has been subsumed by err_attribute_argument_type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187400 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
a38253c3e7dbd2b5aadb0556845dc3848168b904 11-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR5066: If a declarator cannot have an identifier, and cannot possibly be
followed by an identifier, then diagnose an identifier as being a bogus part of
the declarator instead of tripping over it. Improves diagnostics for cases like

std::vector<const int *p> my_vec;


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186061 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
xx-template-argument.cpp
xx0x-decl.cpp
bcd0650c1e50a2e73b11717731e074a1ac2ac5ba 08-Jul-2013 David Majnemer <david.majnemer@gmail.com> Sema: Do not merge new decls with invalid, old decls

Sema::MergeFunctionDecl attempts merging two decls even if the old decl
is invalid. This can lead to interesting circumstances where we
successfully merge the decls but the result makes no sense.

Take the following for example:

template <typename T>
int main(void);

int main(void);

Sema will not consider these to be overloads of the same name because
main can't be overloaded, which means that this must be a redeclaration.

In this case the templated decl is compatible with the non-templated
decl allowing the Sema::CheckFunctionDeclaration machinery to move on
and do bizarre things like setting the previous decl of a non-templated
decl to a templated decl!

The way I see it, we should just bail from MergeFunctionDecl if the old
decl is invalid.

This fixes PR16531.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185779 91177308-0d34-0410-b5e6-96231b3b80d8
elayedTemplateParsing.cpp
b7a5120f9dbc87b026233eb9e8a00be636265d0c 05-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Use the new --crash option in commands that are expected to crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185679 91177308-0d34-0410-b5e6-96231b3b80d8
rash-report.c
96e7813f08c6adf1d8657b0da86741b54e850fd7 04-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Add 'not' to commands that are expected to fail.

This is at least good documentation, but also opens the possibility of
using pipefail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185652 91177308-0d34-0410-b5e6-96231b3b80d8
R11000.cpp
rash-report.c
xx-member-crash.cpp
bjc-diag-width.mm
arser_overflow.c
54ca069d1526df84a48a3974871a7c4f46549651 04-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16480: Reimplement token-caching for constructor initializer lists. This
previously didn't work if a mem-initializer-id had a template argument which
contained parentheses or braces.

We now implement a simple rule: just look for a ') {' or '} {' that is not
nested. The '{' is assumed to start the function-body. There are still two
cases which we misparse, where the ') {' comes from a compound literal or
from a lambda. The former case is not valid C++, and the latter will probably
not be valid C++ once DR1607 is resolved, so these seem to be of low value,
and we do not regress on them with this change. EDG and g++ also misparse
both of these cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185598 91177308-0d34-0410-b5e6-96231b3b80d8
xx-member-initializers.cpp
3e3d20b2b26a885fcae855bb0b02dbc42d7c5739 03-Jul-2013 Bill Schmidt <wschmidt@linux.vnet.ibm.com> "bool" should be a context-sensitive keyword in Altivec mode.

PR16456 reported that Clang implements a hybrid between AltiVec's
"Keyword and Predefine Method" and its "Context Sensitive Keyword
Method," where "bool" is always a keyword, but "vector" and "pixel"
are context-sensitive keywords. This isn't permitted by the AltiVec
spec. For consistency with gcc, this patch implements the Context
Sensitive Keyword Method for bool, and stops treating true and false
as keywords in Altivec mode.

The patch removes KEYALTIVEC as a trigger for defining these keywords
in include/clang/Basic/TokenKinds.def, and adds logic for "vector
bool" that mirrors the existing logic for "vector pixel." The test
case is taken from the bug report.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185580 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec-csk-bool.c
b2567ddad9a1142d7224e5363029d640e8f4f59d 03-Jul-2013 Kaelyn Uhrain <rikka@google.com> Allow typo correction to try removing nested name specifiers.

The removal is tried by retrying the failed lookup of a correction
candidate with either the MemberContext or SS (CXXScopeSpecifier) or
both set to NULL if they weren't already. If the candidate identifier
is then looked up successfully, make a note in the candidate that the
SourceRange should include any existing nested name specifier even if
the candidate isn't adding a different one (i.e. the candidate has a
NULL NestedNameSpecifier).

Also tweak the diagnostic messages to differentiate between a suggestion
that just replaces the identifer but leaves the existing nested name
specifier intact and one that replaces the entire qualified identifier,
in cases where the suggested replacement is unqualified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185487 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-directive.cpp
c7e863f888bbcb2c6508acf193e74195c1b230e9 26-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR8302: Check for shadowing a template parameter when declaring a template
template parameter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184884 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
8d90b4ab994c48c4b6d53122282dc93ac722bfc7 24-Jun-2013 Kaelyn Uhrain <rikka@google.com> Add the global namespace (the "::" namespace specifier) to the list of
namespaces to try for potential typo corrections.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184762 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-directive.cpp
6e91f4bd9a05ca2c58ba11d541d8f9dab5514b76 20-Jun-2013 Richard Trieu <rtrieu@google.com> Fix for PR 16367, display the name of a function in a diagnostic instead of
showing "(null)".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184377 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class-template-specialization.cpp
122e601886ae527d6e7100c589339c05190a168a 08-Jun-2013 Serge Pavlov <sepavloff@gmail.com> Recognition of empty structures and unions is moved to semantic stage

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183609 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
50c859ea82a339747a8b531a21e6084bdf3b3111 04-Jun-2013 Sylvestre Ledru <sylvestre@debian.org> Fix a typo (chek => check)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183223 91177308-0d34-0410-b5e6-96231b3b80d8
xx-member-crash.cpp
aa9df09729fb8aee3e645549e95fcb413306a7aa 23-May-2013 Aaron Ballman <aaron@aaronballman.com> Adding in parsing and the start of semantic support for __sptr and __uptr pointer type qualifiers. This patch also fixes the correlated __ptr32 and __ptr64 pointer qualifiers so that they are truly type attributes instead of declaration attributes.

For more information about __sptr and __uptr, see MSDN: http://msdn.microsoft.com/en-us/library/aa983399.aspx

Patch reviewed by Richard Smith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182535 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
440d456c5cf9613a3ee6a3297f892ddd8da5b8f8 22-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16094: I should have known Obj-C init-capture disambiguation couldn't be
*that* easy...

Try a bit harder to disambiguate. This is mostly straightforward, but for
=-style initializers, we actually need to know where an expression ends:

[foo = bar baz]

is a message send, whereas

[foo = bar + baz]

is a lambda-introducer. Handle this by parsing the expression eagerly, and
replacing it with an annotation token. By chance, we use the *exact same*
parsing rules in both cases (except that we need to assume we're inside a
message send for the parse, to turn off various forms of inapplicable
error recovery).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182432 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx0x-lambda-expressions.mm
e4bb74973cfdf0c82aca2088ccfae5e61727c846 17-May-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C parsing. Error recovery when category implementation
declaration is illegally protocol qualified. // rdar://13920026


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182136 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-error-qualified-implementation.m
0d8e9646bc000bab521ce52ed294209a92298cef 16-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> First pass of semantic analysis for init-captures: check the initializer, build
a FieldDecl from it, and propagate both into the closure type and the
LambdaExpr.

You can't do much useful with them yet -- you can't use them within the body
of the lambda, because we don't have a representation for "the this of the
lambda, not the this of the enclosing context". We also don't have support or a
representation for a nested capture of an init-capture yet, which was intended
to work despite not being allowed by the current standard wording.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181985 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
bjcxx0x-lambda-expressions.mm
0a664b863255065d960342dd074a77d63c753d35 09-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y n3648: parse and reject init-captures for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181553 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
bjcxx0x-lambda-expressions.mm
3ce0de611e7f754df9ba9f883333eef8399f7af7 04-May-2013 Aaron Ballman <aaron@aaronballman.com> Properly parsing __declspec(safebuffers), though there is no semantic hookup. For more information about safebuffers, see MSDN: http://msdn.microsoft.com/en-us/library/dd778695(v=vs.110).aspx

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181123 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
51c30afe7e2eb9273dd706229f42d87524fb8660 25-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C parsing [qoi]: Recover gracefully with good diagnostic
when class implementation declaration adds protocol qualifier
list. // rdar://12233858


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180228 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-error-qualified-implementation.m
840462670ba7a6bc26265a2306b35f2f0f01f51c 21-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> The 'constexpr implies const' rule for non-static member functions is gone in
C++1y, so stop adding the 'const' there. Provide a compatibility warning for
code relying on this in C++11, with a fix-it hint. Update our lazily-written
tests to add the const, except for those ones which were testing our
implementation of this rule.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179969 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-ambig.cpp
xx0x-decl.cpp
0c7102f070c10a261ea40700cfbb9102f642ad72 19-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C++: Enable passing of modern C++11 style
initialized temporaries to objc++ methods.
// rdar://12788429


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179818 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx11-initialized-temps.mm
0ac0ee9be071c796b0f05392b473234b884c0ae8 18-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C parsing [qoi]: Provide good recovery when
Objective-C dictionary literals has bad syntax for the
separator. // rdar://10679157


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179784 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-boxing.m
bd95745d0efb0d3c6e7cc2f946438a8b2c39c858 18-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Parser] Handle #pragma pack/align inside C structs.

Fixes PR13580. Patch by Serge Pavlov!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179743 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-options.c
ragma-pack.c
85192c7fe187d5486e12dbc6960af28f16a558a0 16-Apr-2013 Tareq A. Siraj <tareq.a.sriaj@intel.com> Parser support for #pragma clang __debug captured

This patch implements parsing ‘#pragma clang __debug’ as a first step for
implementing captured statements. Captured statements are a mechanism for
doing outlining in the AST.
see http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html.

Currently returns StmtEmpty

Author: Andy Zhang <andy.zhang@intel.com>

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179614 91177308-0d34-0410-b5e6-96231b3b80d8
aptured-statements.c
76da55d3a49e1805f51b1ced7c5da5bcd7f759d8 16-Apr-2013 John McCall <rjmccall@apple.com> Basic support for Microsoft property declarations and
references thereto.

Patch by Tong Shen!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179585 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
3a0f7ac43aa3dcf1e3231549ca9ce8cffd5a2d7c 13-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Give this test a triple so that its use of thread_local doesn't make it fail on the MSVC bot.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179432 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-decl.cpp
ec64244f5939fa81596fbeddad966cca4b4a4c51 13-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Parsing support for thread_local and _Thread_local. We give them the same
semantics as __thread for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179424 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-decl.cpp
e145bfd06c7eaf0cff0f7d825d1c6244127c26df 04-Apr-2013 Nico Weber <nicolasweber@gmx.de> Make the ObjC attributes diagnostics a bit more informative.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178720 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.mm
9f4f5f1ca1e1967daf64d5422717c9b1e75eeb9e 03-Apr-2013 Nico Weber <nicolasweber@gmx.de> Emit a nicer diagnostic for misplaced attributes on ObjC directives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178670 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.mm
refix-attributes.m
4cf4a5e96ab0babd13774b17112e7c1d83042ea7 28-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> Support C11 _Atomic type qualifier. This is more-or-less just syntactic sugar for the _Atomic type specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178210 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
tomic.c
cdd81e5a68cefd5ba057f1f638f31a3ec6ace18d 25-Mar-2013 Nick Lewycky <nicholas@mxc.ca> Try harder to be signal-safe inside our signal handler. The most prominent behavioural
difference is that we no longer clean the token before emitting it. This fixes a bug where
clang hangs in the middle of crashing because the crash handler calls malloc from inside
a crash that happened inside of free.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177919 91177308-0d34-0410-b5e6-96231b3b80d8
rash-report.c
695031cd78fe789efbb88504372413432ae2feaa 20-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Do the error recovery for @end only.
I am not sure how much we can improve for
when a randon ObjC keyword is thrown into the
ivar decl. block. // rdar://6854840


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177553 91177308-0d34-0410-b5e6-96231b3b80d8
issing-closing-rbrace.m
4cc0cf1a54541b26b258c45cd7a3c80c9401eaad 20-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C [qoi] more gracefull recovery when
'}' is missing for the ivar declarations.
// rdar://6854840


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177549 91177308-0d34-0410-b5e6-96231b3b80d8
issing-closing-rbrace.m
576f32c5e1f3ac5555ea20bb9effce2d59ad2fa9 20-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> Teach statement / declaration disambiguation about C++11-style generalized initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177480 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-ambig.cpp
5bba867123a788085b677fb4b12f21917dec5c51 19-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C [qoi]: Provide improved parse diagnostics when
closing rbrace is missing in an ObjC class declaration.
Can do beter than this, but it involves addition of
overhead which will be present in correct code.
// rdar://6854840


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177435 91177308-0d34-0410-b5e6-96231b3b80d8
issing-closing-rbrace.m
c7f811638f8603fa373d2be724e8b1c8ba51ad75 18-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add missing diagnostic for a nested-name-specifier on a free-standing type definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177335 91177308-0d34-0410-b5e6-96231b3b80d8
11-noreturn.c
xx-class.cpp
4b02dff7aebb98d2d60b2ff4d3fc86109213128c 05-Mar-2013 David Blaikie <dblaikie@gmail.com> Add quotation marks to template names in diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176474 91177308-0d34-0410-b5e6-96231b3b80d8
xx-casting.cpp
d1084f6dd10ec79d1618d957fd3174bd04096cb3 01-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Fix warning text of my last patch.
// rdar://13158394


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176308 91177308-0d34-0410-b5e6-96231b3b80d8
laceholder-recovery.m
ced0e6570a90e3e7ab09691fd7f04428f4e97977 28-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> objective-C: clang, following gcc, warns on
use of stand-alone protocol as type and uses
id<proto>. Modify warning to say what compiler
is doing. // rdar//13158394


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176303 91177308-0d34-0410-b5e6-96231b3b80d8
laceholder-recovery.m
684aa73192d92850a926870be62a1787eb5b7ed9 22-Feb-2013 Michael Han <fragmentshaders@gmail.com> [Sema] Semantic analysis for empty-declaration and attribute-declaration.

Introduce a new AST Decl node "EmptyDecl" to model empty-declaration. Have attributes from attribute-declaration appertain
to the EmptyDecl node by creating the AST representations of these attributes and attach them to the EmptyDecl node so these
attributes can be sema checked just as attributes attached to "normal" declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175900 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
672edb0a04a5273e3a501f3b196844c125290780 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't accidentally and silently accept C++11 attributes in decl-specifier-seqs
in C++98.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175879 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
68ea3aeff1be9412658f4c96fdab0d8ad875be6c 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Per the grammar in [dcl.dcl]p1, a simple-declaration can only have attributes
if it has declarators. We were missing the check for this in a couple of places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175876 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
150d853343758281f7b0c44e058ea81da45b79be 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Don't skip '_Alignas' when disambiguating 'final'. '_Alignas' can't appear here,
and we used to assert if it did.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175866 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-ambig.cpp
9e738cc9d4b4655c44dadeb22f3a314daf43b995 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,
to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting
levels for parentheses, brackets and braces.

Some code with heavy macro use exceeds the default limit of 256, but we don't
want to increase it generally to avoid stack overflow on stack-constrained
systems.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175855 91177308-0d34-0410-b5e6-96231b3b80d8
arser_overflow.c
30f2a74f882adcadb8060d914684f65a401d87ba 20-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15311: Finish implementation of the suggested resolution of core issue 1488,
which allows grouping parens in an abstract-pack-declarator. This was already
mostly implemented, but missed some cases. Add an ExtWarn for use of this
extension until CWG ratifies it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175660 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-ambig.cpp
6b3d3e54c003b03f16e235ad2ff49e95587bbf92 20-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Process and handle attributes on conditions and for loop variables. Process and
diagnose attributes on alias declarations, using directives, and attribute
declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175649 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
053214013990ad8ec096dafc64aa7c0ad2b05bc0 20-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15300: Support C++11 attributes on base-specifiers. We don't support any such
attributes yet, so just issue the appropriate diagnostics. Also generalize the
fixit for attributes-in-the-wrong-place code and reuse it here, if attributes
are placed after the access-specifier or 'virtual' in a base specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175575 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-base-spec-attributes.cpp
xx11-stmt-attributes.cpp
bjcxx11-attributes.mm
3fa3feab35096b608f1d79bb541798b37a55e7b9 02-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15132: Replace "address expression must be an lvalue or a function
designator" diagnostic with more correct and more human-friendly "cannot take
address of rvalue of type 'T'".

For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully
saying "cannot take address of rvalue of type '<overloaded function type>'".

For the case of &array_temporary, treat it just like a class temporary
(including allowing it as an extension); the existing diagnostic wording
for the class temporary case works fine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174262 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx0x-lambda-expressions.mm
d03de6aaa312d57dcd6e2bc76bed1e89f5c5019d 29-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Downgrade 'attribute ignored when parsing type' from error to warning, to match
the diagnostic's warn_ name. Switch some places (notably C++11 attributes)
which really wanted an error over to a different diagnostic. Finally, suppress
the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing
diagnostics in important system headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173788 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
xx0x-attributes.cpp
4cd81c5bf5957b2b10ddf253035f6e1596082108 29-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 [dcl.align]p1 and C11 6.7.5/2 rules for alignas and _Alignas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173779 91177308-0d34-0410-b5e6-96231b3b80d8
1x-alignas.c
8338a9d28c4a9d06b19b1c5df51e70182914e2df 29-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15017: A '>' can appear after a type-specifier in a template-argument-list.
It turns out that there's no correctness bug here (because we can't have a type
definition in this location), but there was a diagnostic bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173766 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
33f04a208a1a6e73da73460142327ff05e8c391b 29-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Treat alignas and _Alignas as keyword attributes. This allows us to
pretty-print them properly (modulo the more general badness in alignment
attribute printing).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173752 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-stmt-attributes.cpp
db55c04cb3384b192a418a840a9ba6321941fc0d 26-Jan-2013 Richard Trieu <rtrieu@google.com> Give a more informative error message when the dot or arrow operator is used
on a type. Currently, it gives a generic "expected unqualified-id" error.
The new error message is "cannot use (dot|arrow) operator on a type".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173556 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
69bb7f6bbe6fcdb6a8f44a036e62af82724e9329 25-Jan-2013 Renato Golin <renato.golin@linaro.org> Temporarily disabling ms-asm test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173510 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
8b3326527eb83fbab624a7173acd0d6813dc5845 24-Jan-2013 Chad Rosier <mcrosier@apple.com> Fail these tests in a way that doesn't cause unexpected successes, per Daniel's
suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173367 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
bce9205e430e94918476ae62579f9e3c811294d7 22-Jan-2013 Chad Rosier <mcrosier@apple.com> Add a triple, per Ben's suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173198 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
bd00bdb4f70d280bfffe785561bd368a7b6e9f27 22-Jan-2013 Chad Rosier <mcrosier@apple.com> Second attempt to fix ppc bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173193 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
80d38eb7f25cd0fe2483a52ab225fa7331615f18 22-Jan-2013 Chad Rosier <mcrosier@apple.com> Add x86 requirement to hopefully fix ppc bots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173190 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
c666cf404d37d6624a4efdf06cc2f9f1995cfe9c 22-Jan-2013 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Remove a warning about ms-style inline assembly not being
supported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173177 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
s-inline-asm.c
ba65f505b7cc2551571b299d05d767e0a892aaae 19-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix five more cases of tokens which can legally follow a type specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172886 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
xx0x-decl.cpp
55fc3a767b9945bd1f311f2339dcaa8761da5661 18-Jan-2013 Nico Weber <nicolasweber@gmx.de> Fix parsing of class specifiers before '\n' 'operator'.

r159549 / r159164 regressed clang to reject

struct s {};
struct s
operator++(struct s a)
{ return a; }

This fixes the regression. Richard, pleas check if this looks right.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172834 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
de03c15ad92b44a4be11507ca2501bb9dd014dce 17-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Parsing support for C11's _Noreturn keyword. No semantics yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172761 91177308-0d34-0410-b5e6-96231b3b80d8
11-noreturn.c
cd8ab51a44e80625d84126780b0d85a7732e25af 17-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 semantics for [[noreturn]] attribute. This required splitting
it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their
semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as
affecting the function type, whereas [[noreturn]] does not).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172691 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
bjcxx11-attributes.mm
ef8e498b3abfc42968fa0749835e155c5ceb9685 15-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> 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
arn-semicolon-before-method-body.m
d3e723e28848e4d33e58249042ca14df9308d1b9 15-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR14918: Don't confuse braced-init-lists after template variable declarations
with function definitions.

We really should remove Parser::isDeclarationAfterDeclarator entirely, since
it's meaningless in C++11 (an open brace could be either a function definition
or an initializer, which is what it's trying to differentiate between). The
other caller of it happens to be correct right now...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172510 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-brace-initializers.cpp
5c52166525f8714c3e3a979b156ec23426947fd3 15-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix behavior of [[gnu::]] function attributes. Per g++'s behavior, these
attributes appertain to a declaration, even though they would be much more
naturally modelled as appertaining to a function type. Previously, we would
try to distribute them from the declarator to the function type, then
reject them for being at an incorrect location. Now, we just distribute them
as far as the declarator; the existing attribute handling code can actually
apply them there just fine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172504 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx11-attributes.mm
f7a052732c2b6c82f74708038f75fa92c9b4dba0 14-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Accept [[gnu::*]] for all __attribute__((*))s which are:
1) Supported by Clang, and
2) Supported by GCC, and
3) Documented in GCC's manual.

g++ allows its C++11-style attributes to appertain only to the entity being
declared, and never to a type (even for a type attribute), so we do the same.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172382 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
7b19cb116d0909de72dc8242b0a4e6c5ed39d421 14-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> *this is const in a trailing-return-type for a constexpr member function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172375 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-decl.cpp
6a502c4430088fe3bac7b5886cd9425f7e306b63 08-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR14855: don't silently swallow a nested-name-specifier after a type name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171908 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-decl.cpp
07fc1ba7553f2f5bf26984091197311decd9028e 07-Jan-2013 Michael Han <fragmentshaders@gmail.com> Add fixit hints for misplaced C++11 attributes around class specifiers.

Following r168626, in class declaration or definition, there are a combination of syntactic locations
where C++11 attributes could appear, and among those the only valid location permitted by standard is
between class-key and class-name. So for those attributes appear at wrong locations, fixit is used to
move them to expected location and we recover by applying them to the class specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171757 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
b13621d08e20ac7aa550e05896de8a57ee99c1e8 18-Dec-2012 Guy Benyei <guy.benyei@intel.com> Re-commit r170428 changes with Linux style file endings.

Add OpenCL images as clang builtin types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170432 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-image-access.cl
7f92f2d8d9b7a07900c030183bc13a9ff60057cc 18-Dec-2012 Guy Benyei <guy.benyei@intel.com> Revert changes from r170428, as I accidentally changed the line endings of these files to Windows style.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170431 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-image-access.cl
736104a7619c53ef92553780273d7357a3cdde81 18-Dec-2012 Guy Benyei <guy.benyei@intel.com> Add OpenCL images as clang builtin types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170428 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-image-access.cl
b707a4762fcc47c12b5f487856ba0781c9399295 14-Dec-2012 Nico Weber <nicolasweber@gmx.de> Don't require a space between the two ">" in "vector<id<protocol>>" in objc++11.

C++11 allowed writing "vector<vector<int>>" without a space between the two ">".
This change allows this for protocols in template lists too in -std=c++11 mode,
and improves the diagnostic in c++98 mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170223 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx11-protocol-in-template.mm
569cdc82c1a99fe1e950a1ddbe5ff82df0b13f3d 09-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14549. Don't assert if we see an incomplete decltype specifier at the end of the file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169688 91177308-0d34-0410-b5e6-96231b3b80d8
racket-crash.cpp
e23fbf1fca9be5653ca706ccefc31d5e5a3a334d 06-Dec-2012 Chad Rosier <mcrosier@apple.com> [driver, ms-inline asm] Have -fms-extensions enable the AsmBlocks language
option. MS-style inline asm can now be enabled by either -fasm-blocks or
-fms-extensions.
rdar://12808010

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169445 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
15490fd42d7d8dca2f9b5b3a9dc074892ca1acd7 05-Dec-2012 Chad Rosier <mcrosier@apple.com> [driver, ms-inline asm] MS-Style inline assembly is controlled by the
-fasm-blocks flag, not the -fms-extensions flag.
rdar://12808010

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169422 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
s-inline-asm.c
37ec8d589c5de34d0e260f0599395519bd7498de 05-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> In C++, if we hit an error in the class-head, don't try to parse the class body.
Our error recovery path may have made the class anonymous, and that has a pretty
disastrous impact on any attempt to parse a class body containing constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169374 91177308-0d34-0410-b5e6-96231b3b80d8
xx-undeclared-identifier.cpp
ecovery.cpp
52b501cd723d56efe3ad2ab708c2b75530fe6caa 29-Nov-2012 Michael Han <Michael.Han@autodesk.com> Implement C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq appertains to a friend declaration, that declaration shall be a definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168826 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
2e39713a3d72c243a2bcd13cc8f5036ba6b487d9 26-Nov-2012 Michael Han <Michael.Han@autodesk.com> Improve diagnostic on C++11 attribute specifiers that appear at wrong syntactic locations around class specifiers.

This change list implemented logic that explicitly detects several combinations of locations where C++11 attribute
specifiers might be incorrectly placed within a class specifier. Previously we emit generic diagnostics like
"expected identifier" for such cases; now we emit specific diagnostic against the misplaced attributes, this also
fixed a bug in old code where attributes appear at legitimate locations were incorrectly rejected.

Thanks to Richard Smith for reviewing!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168626 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
97f8461a2c553f68a258612d2322e4281c3f0915 17-Nov-2012 Andy Gibbs <andyg1001@hotmail.co.uk> Made the "expected string literal" diagnostic more expressive

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168267 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
6f9a445760992a6fbff2c0b08becf35ae9eafa71 15-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR9903: Recover from a member functon declared with the 'typedef' specifier by
dropping the specifier, just like we do for non-member functions and function
templates declared 'typedef'. Patch by Brian Brooks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168108 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
xx0x-decl.cpp
f64231e9f47234826fbcdc3b4fe0370ef6c9961d 06-Nov-2012 Michael Han <Michael.Han@autodesk.com> Teach Clang parser to reject C++11 attributes that appertain to declaration specifiers.

We don't support any C++11 attributes that appertain to declaration specifiers so reject
the attributes in parser until we support them; this also conforms to what g++ 4.8 is doing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167481 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
d096acc220fc72ec73c2abf21d6c251d867e950d 05-Nov-2012 Matt Beaumont-Gay <matthewbg@google.com> Our style for diagnostic messages is to not include a trailing dot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167379 91177308-0d34-0410-b5e6-96231b3b80d8
mpty-translation-unit.c
3f320aa93253cc69d03579b37fd0724055883a6e 04-Nov-2012 Lang Hames <lhames@gmail.com> Test case for r167363.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167369 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-fp-contract.c
eacff03a37eaa984a2f72ae68281910fffea99b9 02-Nov-2012 Richard Trieu <rtrieu@google.com> Fix test cases I broken when fixing grammar in diagnostic message.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167320 91177308-0d34-0410-b5e6-96231b3b80d8
olon-colon-parentheses.cpp
919b9557b4f0155dfaaea309493ff2a702fca676 02-Nov-2012 Richard Trieu <rtrieu@google.com> When finding a '(' after '::', emit error with hint to remove '(' and matching
')', if found. Don't crash.
Fixes PR11852.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167268 91177308-0d34-0410-b5e6-96231b3b80d8
olon-colon-parentheses.cpp
e1bb329744ec98ca921bfc4f0888cff7ab4d1bf4 28-Oct-2012 Nico Weber <nicolasweber@gmx.de> Fix crash on missing namespace name in namespace alias definition -- PR14085.

Patch from Brian Brooks <brooks.brian@gmail.com>!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166893 91177308-0d34-0410-b5e6-96231b3b80d8
amespaces.cpp
a0d5878b7e1c54551c0445354788e4259900c03c 25-Oct-2012 David Tweed <david.tweed@arm.com> Correct test inovocations to use %clang_cc1 rather than direct invocation (so that it can have additional options set when trying to debug issues causing regressions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166681 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.cpp
53aec2a2770afc242c70fd88975cd0ea389087c0 25-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> 'constexpr' and 'friend' are both declaration specifiers. Teach the parser this, for better error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166645 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.cpp
9dd686d2be3c3785a089ff12a3d3eb64e9b32dc0 24-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Update regression tests for r166617.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166619 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
87234c83831dfb18247135add2bf14198604b3b4 21-Oct-2012 Lang Hames <lhames@gmail.com> Fix typo, make test case slightly more reabable. Thanks to Dmitri Gribenko for
the suggestions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166400 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-fp-contract.c
860022ccf71b3d63acd29912af970dad655630f7 21-Oct-2012 Lang Hames <lhames@gmail.com> When used in a compound expression FP_CONTRACT should proceed all explicit
declarations and statements. Emit an error if the FP_CONTRACT is used
later in a compound statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166383 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-fp-contract.c
aa9a8ce5d31975900c7243b1508f5111baddacbe 20-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1473: Do not require a space between operator"" and the ud-suffix in a
literal-operator-id.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166373 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-user-defined-literals.cpp
8e8fb3be5bd78f0564444eca02b404566a5f3b5d 19-Oct-2012 Andy Gibbs <andyg1001@hotmail.co.uk> Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166280 91177308-0d34-0410-b5e6-96231b3b80d8
lock-block-storageclass.c
lock-pointer-decl.c
heck-objc2-syntax-1.m
ompound_literal.c
xx-attributes.cpp
xx-extern-c-array.cpp
xx0x-override-control-keywords.cpp
xx11-brace-initializers.cpp
ncode.m
nhanced-proto-1.m
f-scope-c90.c
nr_parameter_attributes.c
amelookup-bug-1.c
amelookup-bug-2.c
pencl-kernel.cl
armvardecl_conversion.c
ragma-options.cpp
ecursion-limits.cpp
elector-1.m
op-level-semi-cxx0x.cpp
ypes.c
d654f2d722d4cb6366edcb8f27e99745fcbae486 18-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> DR1528: C++11 doesn't allow repeated cv-qualifiers in declarators after all.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166152 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-decl.cpp
f4deaef8b816bd43258c30fe8e657ab041b675ad 12-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Handle a "#pragma options align" inside a class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165810 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-options.cpp
6880f492365cc4fa4c941aa83688635003ee7498 03-Oct-2012 Michael Han <Michael.Han@autodesk.com> Improve C++11 attribute parsing.

- General C++11 attributes were previously parsed and ignored. Now they are parsed and stored in AST.
- Add support to parse arguments of attributes that in 'gnu' namespace.
- Differentiate unknown attributes and known attributes that can't be applied to statements when emitting diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165082 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
xx11-stmt-attributes.cpp
bjcxx11-attributes.mm
568f785a76e0a21de20932abf09ce7653e651f92 01-Oct-2012 Richard Trieu <rtrieu@google.com> Cleaning up the self initialization checker.
-Allow Sema to do more processing on the initial Expr before checking it.
-Remove the special conditions in HandleExpr()
-Move the code so that only one call site is needed.
-Removed the function from Sema and only call it locally.
-Warn on potentially evaluated reference variables, not just casts to r-values.
-Update tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164951 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-condition.cpp
4b0824229b96d024a96f3c7dd75ab70652c05c5b 18-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> If a comma operator is followed by a token which unambiguously indicates the
start of a statement or the end of a compound-statement, diagnose the comma as
a typo for a semicolon. Patch by Ahmed Bougacha! Additional test cases and
minor refactoring by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164085 91177308-0d34-0410-b5e6-96231b3b80d8
xx-stmt.cpp
xx11-brace-initializers.cpp
tatements.c
3686c71ff92e4357a78993a16a27185f16ab6234 13-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Recover properly after a parse error in a static_assert declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163826 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-decl.cpp
69e4826edc1858d9e2cdef508b469af750ec2b09 06-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13775: When checking for a tag type being shadowed by some other declaration,
don't trample over the caller's LookupResult in the case where the check fails.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163281 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
568ba871bbac959029671b81f8e531edb7e0d7d6 04-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Revert r163083 per chandlerc's request.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163149 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
5be92de217a1940d0e109abd0f401df4480c1a4b 02-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Implemented parsing and AST support for the MS __leave exception statement. Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163083 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
17d35c36fbae764fcd68fa8b31624078a033aabc 01-Sep-2012 Joao Matos <ripzonetriton@gmail.com> Normalize line endings of r163013 (part 2).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163032 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
6666ed4ed2e2bc13da5ac5d0a4947019137d45be 31-Aug-2012 Joao Matos <ripzonetriton@gmail.com> Improved MSVC __interface support by adding first class support for it, instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163013 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
a6c66cedc022c9e5d45a937d6b8cff491a6bf81b 31-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Change the representation of builtin functions in the AST
(__builtin_* etc.) so that it isn't possible to take their address.
Specifically, introduce a new type to represent a reference to a builtin
function, and a new cast kind to convert it to a function pointer in the
operand of a call. Fixes PR13195.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162962 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin_classify_type.c
3bc22262af7b09a459b400976cfce3d9318b8ea9 30-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13652: Don't assume the parameter array on a FunctionTypeLoc for a lambda will
be filled in; they won't if the lambda's declarator has an invalid type. Instead
take the parameters from the declarator directly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162904 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
c828620a03b20835a376f6f456a72e44599f4f87 28-Aug-2012 Aaron Ballman <aaron@aaronballman.com> Splitting the duplicated decl spec extension warning into two: one is an ExtWarn and the other a vanilla warning. This addresses PR13705, where const char const * wouldn't warn unless -pedantic was specified under the right conditions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162793 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
xx0x-decl.cpp
56d7f2348a182002563700db2158da0c6fc115a5 24-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Change the -fenable-experimental-ms-inline-asm option from a
CodeGen option to a LangOpt option. In turn, hoist the guard into the parser
so that we avoid the new (and fairly unstable) Sema/AST/CodeGen logic. This
should restore the behavior of clang to that prior to r158325.
<rdar://problem/12163681>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162602 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
40b2e19cae6ab85407856c70f76278f9efbeeb7c 23-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> When disambiguating an expression-statement from a declaraton-statement, if the
statement starts with an identifier for which name lookup will fail either way,
look at later tokens to disambiguate in order to improve error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162464 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ambig-decl-expr.cpp
78fe3e05a9ea1fc670e5cb0bc54f54e064595e2c 20-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13619: Make sure we're not at EOF before looking at NextToken().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162212 91177308-0d34-0410-b5e6-96231b3b80d8
xx-casting.cpp
0576681bac125be07f77f66b02a3dba2c3a24557 18-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers and
nested names as id-expressions, using the annot_primary_expr annotation, where
possible. This removes some redundant lookups, and also allows us to
typo-correct within tentative parsing, and to carry on disambiguating past an
identifier which we can determine will fail lookup as both a type and as a
non-type, allowing us to disambiguate more declarations (and thus offer
improved error recovery for such cases).

This also introduces to the parser the notion of a tentatively-declared name,
which is an identifier which we *might* have seen a declaration for in a
tentative parse (but only if we end up disambiguating the tokens as a
declaration). This is necessary to correctly disambiguate cases where a
variable is used within its own initializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162159 91177308-0d34-0410-b5e6-96231b3b80d8
xx-casting.cpp
xx-decl.cpp
xx-template-argument.cpp
f37e4218bb40ed956f0ef1d2e5eee2b2c3aa20d2 15-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] MSVC parses multiple __asm statements on a single line as one
statement. For example,

if (x)
__asm out dx, ax __asm out dx, ax

results in a single inline asm statement (i.e., both "out dx, ax" statements are
predicated on if(x)).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161986 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
21ef7116ef308ba565b094ab32559f1eb1c277b7 14-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add a helpful assert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161890 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
950435c15e413c55859f8af78d2c6e603743b42f 09-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> In 'delete []', the '[]' never starts a lambda. Update a FIXME with a standard reference and add a test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161604 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
c3b2308f66fe8abd2c1a911b500c0b989c295819 08-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Unify the codepaths for emitting deprecation warnings. The test changes are just to account for us emitting notes more consistently.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161528 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
b9c6261d02f688d0a9a36b736ad5956fbc737854 30-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Improvements to vexing-parse warnings. Make the no-parameters case more
accurate by asking the parser whether there was an ambiguity rather than trying
to reverse-engineer it from the DeclSpec. Make the with-parameters case have
better diagnostics by using semantic information to drive the warning,
improving the diagnostics and adding a fixit.

Patch by Nikola Smiljanic. Some minor changes by me to suppress diagnostics for
declarations of the form 'T (*x)(...)', which seem to have a very high false
positive rate, and to reduce indentation in 'warnAboutAmbiguousFunction'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160998 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx11-attributes.mm
d30ec7076fef736754206ac87a4f2c67251cc4d8 26-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c parsing. Don't crash when selector name
is missing in method prototype. // rdar://11939584


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160789 91177308-0d34-0410-b5e6-96231b3b80d8
issing-selector-name.mm
42926a065572a63610f651bb1589fe1217e2e0a7 24-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> 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
xx0x-decl.cpp
5969a5f1b730775af4afb8f95f6c8c306ab08227 23-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Do not warn about a function decl / direct init ambiguity if the function has a trailing return type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160646 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-ambig.cpp
eab9d6f9065b042d39fbaf9842c9d8cc968dd6d0 23-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add diagnostics for comma at end of enum and for extra semicolon at namespace
scope to -Wc++11-extensions. Move extra semicolon after member function
definition diagnostic out of -pedantic, since C++ allows a single semicolon
there. Keep it in -Wextra-semi, though, since it's still questionable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160618 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
xx-decl.cpp
xx-extra-semi.cpp
xx0x-decl.cpp
43972898614d91c00982f10cdf7f2bfb4a9f6275 20-Jul-2012 Nico Weber <nicolasweber@gmx.de> Revert r160319, it caused PR13417. Add a test for PR13417.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160542 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-diag-width.mm
94f29f4bf5d6b49dd1b7fc16cfa1521adc0c71c0 09-Jul-2012 Jordan Rose <jordan_rose@apple.com> Better parser recovery in Objective-C containers.

Previously it was possible to get an infinite-loop-on-invalid with a namespace
decl within @interface. Since 'namespace' is normally a safe place to retry
top-level parsing, we just didn't consume the token.

This adds a flag that tracks whether we have temporarily left Objective-C
scope to parse a C-like declaration, and uses that to better recover from
parse problems by stopping at possible method declarations and at @end. To
fix the original problem, we do /not/ stop at 'namespace' when in an
Objective-C @interface or @protocol context (but still do in @implementation).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159941 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-recover.mm
139be7007eba3bd491ca50297888be507753a95d 02-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> A ':' after an enum-specifier at class scope is a bitfield, not a typo for a ';'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159549 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
f70a88612a4bc2de2872a518267b9b4891ab6431 30-Jun-2012 Jordan Rose <jordan_rose@apple.com> Add support for the C11 _Alignof keyword.

This behaves like the existing GNU __alignof and C++11 alignof keywords;
most of the patch is simply adding the third token spelling to various places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159494 91177308-0d34-0410-b5e6-96231b3b80d8
1x-alignas.c
0963017dcbc32176c79a251c3ab23bc35ac784e5 28-Jun-2012 Douglas Gregor <dgregor@apple.com> Support the use of "=delete" and "=default" with delayed template
parsing. Fixes <rdar://problem/11700604>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159380 91177308-0d34-0410-b5e6-96231b3b80d8
elayedTemplateParsing.cpp
c9f351700721150a985f21844fbfec55b04e861d 25-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Extend the "expected ';' after struct" logic to also apply to enums, and to
struct and enum forward-declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159164 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-ambig.cpp
1e12b3d777b36b80527da566192f8aeefad8f9d4 24-Jun-2012 John McCall <rjmccall@apple.com> Recognize GNU attributes after 'enum class'. Fixes the libc++ build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159089 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
2edf0a2520313cde900799b1eb9bd11c9c776afe 23-Jun-2012 Sean Hunt <scshunt@csclub.uwaterloo.ca> Clean up a large number of C++11 attribute parse issues, including parsing
attributes in more places where we didn't and catching a lot more issues.

This implements nearly every aspect of C++11 attribute parsing, except for:
- Attributes are permitted on explicit instantiations inside the declarator
(but not preceding the decl-spec)
- Attributes are permitted on friend declarations of functions.
- Multiple instances of the same attribute in an attribute-list (e.g.
[[noreturn, noreturn]], not [[noreturn]] [[noreturn]] which is conforming)
are allowed.
The first two are marked as expected-FIXME in the test file and the latter
is probably a defect and is currently untested.

Thanks to Richard Smith for providing the lion's share of the testcases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159072 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
67e8a8b00b67a903ab4916947712963942f1ef40 22-Jun-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c: improve diagnostic when collection expression is
not a pointer to a fast-enumerable object. // rdar://11488666


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158998 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-forcollection-neg.m
52e4ed949ba52958db1e938860e3b49944ce8680 20-Jun-2012 Chad Rosier <mcrosier@apple.com> [ms-style asm] Change the fatal error to an extension warning. Apparently, this
error was asserting on anything that included Windows.h. MS-style inline asm is
still dropped, but at least now we're not completely silent about it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158833 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
s-inline-asm.c
260611a32535c851237926bfcf78869b13c07d5b 20-Jun-2012 John McCall <rjmccall@apple.com> Restructure how the driver communicates information about the
target Objective-C runtime down to the frontend: break this
down into a single target runtime kind and version, and compute
all the relevant information from that. This makes it
relatively painless to add support for new runtimes to the
compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z,
available at the driver level as a better and more general
alternative to -fgnu-runtime and -fnext-runtime. This new
concept of an Objective-C runtime also encompasses what we
were previously separating out as the "Objective-C ABI", so
fragile vs. non-fragile runtimes are now really modelled as
different kinds of runtime, paving the way for better overall
differentiation.

As a sort of special case, continue to accept the -cc1 flag
-fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak.

I won't go so far as to say "no functionality change", even
ignoring the new driver flag, but subtle changes in driver
semantics are almost certainly not intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158793 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
fc685ace387734599c475426b1a8efdb491054b8 20-Jun-2012 Aaron Ballman <aaron@aaronballman.com> Reapplying the changes from r158717 as they were rolled back to avoid merge conflicts from a separate problematic patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158750 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
3532936f4f50c15fcec4d00f4cbb81a7a9dd9b7e 19-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r158700 and dependent patches r158716, r158717, and r158731.

The original r158700 caused crashes in the gcc test suite,
g++.abi/vtable3a.C among others. It also caused failures in the libc++
test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158749 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
ed35fd1c6db1680b4526ba64c94e5da6ec203be7 19-Jun-2012 Aaron Ballman <aaron@aaronballman.com> Improves parsing and semantic analysis for MS __declspec attributes. This includes support for the align (which fixes PR12631).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158717 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
19a2702042b7e3ee838cca458b35f607111a3897 18-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Extend the error recovery for a template-argument-list terminated by '>>' to
also deal with '>>>' (in CUDA), '>=', and '>>='. Fix the FixItHints logic to
deal with cases where the token is followed by an adjacent '=', '==', '>=',
'>>=', or '>>>' token, where a naive fix-it would result in a differing token
stream on a re-lex.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158652 91177308-0d34-0410-b5e6-96231b3b80d8
uda-kernel-call.cu
xx-template-argument.cpp
50dc12ad05d4a3a57e83852756498afce4307a77 16-Jun-2012 Kaelyn Uhrain <rikka@google.com> Recover when correcting an unknown type name to a keyword like "struct".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158573 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.cpp
b3b26bfe61558232ccd0053697a143a30ac1e079 12-Jun-2012 Chad Rosier <mcrosier@apple.com> [ms-inline-asm] The __asm keyword is a statement separator, so multiple asm
statements are allowed on the same line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158372 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
a01eddbd07aa7e864da14cae20ce772dfdd082fa 12-Jun-2012 Chad Rosier <mcrosier@apple.com> [ms-inline-asm] Cleanup MS style inline assembly parsing.

Specifically, improve the handling of whitespace, stop saving tokens that are
in comments and fix the case where we have a comment followed by a closing brace
on the next line.

Unfortunately, there's no easy way of testing this code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158367 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
54655be65585ed6618fdd7a19fa6c70efc321d3a 12-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> If parsing a trailing-return-type fails, don't pretend we didn't have one at
all. Suppresses follow-on errors mentioned in PR13074.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158348 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-type-specifier.cpp
8d3607bf22a6a70acce3722a758f02d4ea84fc3a 06-Jun-2012 Kaelyn Uhrain <rikka@google.com> Allow CorrectTypo to add/modify nested name qualifiers to typos that
are otherwise too short to try to correct.

The TODOs added to two of the tests are for existing deficiencies in the
typo correction code that could be exposed by using longer identifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158109 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-directive.cpp
d73ef135ba029db59c0b5649e6117845d9e39600 06-Jun-2012 Jordan Rose <jordan_rose@apple.com> Add pedantic warning -Wempty-translation-unit (C11 6.9p1).

In standard C since C89, a 'translation-unit' is syntactically defined to have
at least one "external-declaration", which is either a decl or a function
definition. In Clang the latter gives us a declaration as well.

The tricky bit about this warning is that our predefines can contain external
declarations (__builtin_va_list and the 128-bit integer types). Therefore our
AST parser now makes sure we have at least one declaration that doesn't come
from the predefines buffer.

Also, remove bogus warning about empty source files. This doesn't catch source
files that only contain comments, and never fired anyway because of our
predefines.

PR12665 and <rdar://problem/9165548>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158085 91177308-0d34-0410-b5e6-96231b3b80d8
ompletely-empty-header-file.h
mpty-translation-unit.c
pencl-pragma.cl
c052dbb2d8fe0e23e90d81236aab0f864f712b45 22-May-2012 John McCall <rjmccall@apple.com> Recognize the MS inheritance attributes and turn them into attributes
on the RecordDecl. Persist the MS portability type attributes and
ignore them in Sema rather than the parser.

Patch by João Matos!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157288 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
icrosoftExtensions.cpp
6c20222da814df4cb1ef97681f0e1e8cb5a01b40 22-May-2012 John McCall <rjmccall@apple.com> Fix line endings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157287 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
da8d8c2b5e56ba9c49de70c18d11933d67458a34 16-May-2012 Douglas Gregor <dgregor@apple.com> Add _alignof and __builtin_alignof as aliases for __alignof in
Microsoft mode, from Will Wilson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156940 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
4b0e6f1da341510c1ad83eaf4c836f3134d0156a 16-May-2012 Richard Trieu <rtrieu@google.com> Move the warnings for extra semi-colons under -Wextra-semi. Also, added
a warning for an extra semi-colon after function definitions. Added logic
so that a block of semi-colons on a line will only get one warning instead
of a warning for each semi-colon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156934 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
xx-extra-semi.cpp
827adaff666e53ae2f2db994bcd62ebe1ff5b9ce 15-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't use the implicit int rule for error recovery in C++. Instead, try to
disambiguate whether the type name was forgotten or mistyped.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156854 91177308-0d34-0410-b5e6-96231b3b80d8
xx-undeclared-identifier.cpp
23756776eadfd8bbddf5d120d4c191ef9e50d209 15-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Recover properly from a redundant 'typename' before a non-nested name. This is
permitted as a Microsoft extension. Patch by William Wilson! (Plus some minor
tweaking by me.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156786 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
a971d2410fabb093954c4119d2287ac24208ea8d 09-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Push the knowledge that we are parsing a type-id/type-name further into the
parser, and use it to emit better diagnostics in cases where an identifer
can't be looked up as a type name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156508 91177308-0d34-0410-b5e6-96231b3b80d8
xx-throw.cpp
xx11-type-specifier.cpp
f63eee78a3ed50a974d0963623a06888ecd4ef6b 09-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Stop AltiVec parsing from going down the 'implicit int' codepath as part of its
normal parse for token sequences like 'vector pixel foo'. This incidentally also
fixes a couple of wrong-parse issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156503 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
de88246a7bc57bc4995ad4e6fde8f245d70b130e 30-Apr-2012 Douglas Gregor <dgregor@apple.com> Restore paren, bracket and brace counts in parser when
TentativeParsingAction is reverted, from Pasi Parviainen! Fixes
PR12480 / <rdar://problem/11341251>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155823 91177308-0d34-0410-b5e6-96231b3b80d8
ecursion-limits.cpp
bddc7e5ed3982b5845e4fbb5d9bc7b7431c35a4f 28-Apr-2012 Chris Lattner <sabre@nondot.org> improve error recovery for extra ')'s after a if/switch/while condition. Before:

t.c:3:9: error: expected expression
if (x)) {
^

.. which isn't even true - a statement or expression is fine. After:

t.c:3:9: error: extraneous ')' after condition, expected a statement
if (x)) {
^

This is the second part of PR12595



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155762 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.c
8bb21d32e9ccc9d9c221506dff26acafa8724cca 28-Apr-2012 Chris Lattner <sabre@nondot.org> switch some uses of ExpectAndConsume(tok::semi to use ExpectAndConsumeSemi. This allows
us to improve this diagnostic (telling us to insert another ")":

t.c:2:19: error: expected ';' at end of declaration
int x = 4+(5-12));
^
;
to:
t.c:2:19: error: extraneous ')' before ';'
int x = 4+(5-12));
^

...telling us to remove the ")". This is PR12595. There are more uses of ExpectAndConsumeSemi
that could be switched over, but I don't hit them on a daily basis :)





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155759 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
392b3f5798a62fe038082df0a5e2244b08b917d8 27-Apr-2012 Kaelyn Uhrain <rikka@google.com> Imrpove the note text for when a non-type decl hides a tag type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155723 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-declaration.cpp
aec2ac67e7190bdb88abb1d427b82ae3284ea756 27-Apr-2012 Kaelyn Uhrain <rikka@google.com> Add note to help explain why a tag such as 'struct' is needed to refer
to a given type, when the reason is that there is a non-type decl with
the same name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155677 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-declaration.cpp
eb382ec1507cf2c8c12d7443d0b67c076223aec6 19-Apr-2012 Patrick Beard <pcbeard@mac.com> Implements boxed expressions for Objective-C. <rdar://problem/10194391>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155082 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-boxing.m
b2d899e9ae8a48c4057a48664213948934b877fa 17-Apr-2012 Francois Pichet <pichet2000@gmail.com> Emulate a MSVC bug where the creation of pointer-to-member to protected member of base class is allowed but only from a static function.

This fixes a regression when parsing MFC code with clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154924 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
e275a1845b9e32bd3034f2593dee1780855c8fd6 16-Apr-2012 Francois Pichet <pichet2000@gmail.com> The result of the Microsoft __uuidof operator must be considered a global lvalue during constant expression evaluation.
Otherwise we would get this error in C++11 mode (because of a recent change):
error: non-type template argument of type 'const _GUID *' is not a constant expression

For code like:
template <const GUID* g = &__uuidof(struct_with_uuid)>
class COM_CLASS { };


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154790 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
534986f2b21e6050bf00163cd6423fd92155a6ed 14-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add an AttributedStmt type to represent a statement with C++11 attributes
attached. Since we do not support any attributes which appertain to a statement
(yet), testing of this is necessarily quite minimal.

Patch by Alexander Kornienko!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154723 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-stmt-attributes.cpp
bjcxx11-attributes.mm
6a91d385618ea4d28236c496f540a26877c95525 12-Apr-2012 Erik Verbruggen <erikjv@me.com> Added a flag to the parser to skip method bodies.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154584 91177308-0d34-0410-b5e6-96231b3b80d8
kip-function-bodies.mm
994d73f8473cb2cd3ce2f69c9575c95015be788a 11-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Part of PR10101: after a parse error in a declaration, try harder to find the
right place to pick up parsing. In C++, this had a tendency to skip everything
declared within headers if the TU starts with garbage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154530 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.cpp
6ce48a70ace62eb0eaf7b2769d05c5f13b7c7b6c 11-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Support C++11 attributes at the start of a parameter-declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154476 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
bjcxx11-attributes.mm
c56298d87a9df507805a548d7d515e8b511df2c0 10-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Parsing of C++11 attributes:
* Alternative tokens (such as 'compl') are treated as identifiers in
attribute names.
* An attribute-list can start with a comma.
* An ellipsis may not be used with either of our currently-supported
C++11 attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154381 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
bjcxx11-attributes.mm
6ee326af4e77e6f05973486097884d7431f2108d 10-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Disambiguation of '[[':
* In C++11, '[[' is ill-formed unless it starts an attribute-specifier. Reject
array sizes and array indexes which begin with a lambda-expression. Recover by
parsing the lambda as a lambda.
* In Objective-C++11, either '[' could be the start of a message-send.
Fully disambiguate this case: it turns out that the grammars of message-sends,
lambdas and attributes do not actually overlap. Accept any occurrence of '[['
where either '[' starts a message send, but reject a lambda in an array index
just like in C++11 mode.

Implement a couple of changes to the attribute wording which occurred after our
attributes implementation landed:
* In a function-declaration, the attributes go after the exception specification,
not after the right paren.
* A reference type can have attributes applied.
* An 'identifier' in an attribute can also be a keyword. Support for alternative
tokens (iso646 keywords) in attributes to follow.

And some bug fixes:
* Parse attributes after declarator-ids, even if they are not simple identifiers.
* Do not accept attributes after a parenthesized declarator.
* Accept attributes after an array size in a new-type-id.
* Partially disamiguate 'delete' followed by a lambda. More work is required
here for the case where the lambda-introducer is '[]'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154369 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
bjcxx11-attributes.mm
eb52f86a62db523e3c993686b3ed92c55d59d53c 09-Apr-2012 David Blaikie <dblaikie@gmail.com> Fix bugs found by -Wconstant-conversion improvements currently under review.

Specifically, using a an integer outside [0, 1] as a boolean constant seems to
be an easy mistake to make with things like "x == a || b" where the author
intended "x == a || x == b".

The bug caused by calling SkipUntil with three token kinds was also identified
by a VC diagnostic & reported by Francois Pichet as review feedback for my
commit r154163. I've included test cases to verify the error recovery that was
broken/poorly implemented due to this bug.

The other fix (lib/Sema/SemaExpr.cpp) seems like that code was never actually
reached in any of Clang's tests & is related to Objective C features I'm not
familiar with, so I've not been able to construct a test case for it. Perhaps
someone else can.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154325 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
b031eab1c07fa2c5bd74c7e92f7c938bf3304729 07-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove "parse error" in favor of more descriptive diagnostics.

In a few cases clang emitted a rather content-free diagnostic: 'parse error'.
This change replaces two actual cases (template parameter parsing and K&R
parameter declaration parsing) with more specific diagnostics and removes a
third dead case of this in the BalancedDelimiterTracker (the ctor already
checked the invariant necessary to ensure that the diag::parse_error was never
actually used).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154224 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
eclarators.c
b2f6820773aabff3c5c9e0dbb1cbbbda0d80c41f 06-Apr-2012 Patrick Beard <pcbeard@mac.com> Added a new attribute, objc_root_class, which informs the compiler when a root class is intentionally declared.
The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger
the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154187 91177308-0d34-0410-b5e6-96231b3b80d8
issing-end-4.m
bjc-forcollection-neg-2.m
bjc-forcollection-neg.m
bjc-foreach-syntax.m
bjc-init.m
bjc-property-syntax.m
bjc-synthesized-recover.m
673720d8cfbc8c9d08faec2817f1e1452e4ecc2e 06-Apr-2012 David Blaikie <dblaikie@gmail.com> Fix diagnostic text for r154163.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154164 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
9df1b963a69dc85a271b3791267e994485e0bfe1 06-Apr-2012 David Blaikie <dblaikie@gmail.com> Restrict fixit for missing 'class' in template template parameters.

Based on Doug's feedback to r153887 this omits the FixIt if the following token
isn't syntactically valid for the context. (not a comma, '...', identifier,
'>', or '>>')

There's a bunch of work to handle the '>>' case, but it makes for a much more
pleasant diagnostic in this case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154163 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
a82354563ebf9ed03b32ff5405e312425e6c1cad 05-Apr-2012 David Blaikie <dblaikie@gmail.com> Improve & simplify diagnostic for missing 'class' in template template parameter.

Change suggested by Sebastian Redl on review feedback from r153887.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154102 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
a85cf39786fffd6860a940523be01eb02a4935c0 05-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Improve diagnostics for invalid use of non-static members / this:

* s/nonstatic/non-static/ in the diagnostics, since the latter form outvoted
the former by 28-2 in our diagnostics.
* Fix the "use of member in static member function" diagnostic to correctly
detect this situation inside a block or lambda.
* Produce a more specific "invalid use of non-static member" diagnostic for
the case where a nested class member refers to a member of a
lexically-surrounding class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154073 91177308-0d34-0410-b5e6-96231b3b80d8
xx-typeof.cpp
460ef136eb96b879f149c8703938a13c35b4bc68 02-Apr-2012 David Blaikie <dblaikie@gmail.com> Correct error recovery when missing 'class' in a template template parameter.

The diagnostic message correctly informs the user that they have omitted the
'class' keyword, but neither suggests this insertion as a fixit, nor attempts
to recover as if they had provided the keyword.

This fixes the recovery, adds the fixit, and adds a separate diagnostic and
corresponding replacement fixit for cases where the user wrote 'struct' or
'typename' instead of 'class' (suggested by Richard Smith as a possible common
mistake).

I'm not sure the diagnostic message for either the original or new cases feel
very Clang-esque, so I'm open to suggestions there. The fixit hints make it
fairly easy to see what's required, though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153887 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
52f10d5f474741d2226630f576d44f1bf946d40a 29-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Don't try to parse a malformed parameter list after a constructor or operator
name as a direct initializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153628 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
2259286fc5c1514089b17ec93e26ca56ba8ac2b6 28-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> If we see '(...' where we're expecting an abstract-declarator, that doesn't
necessarily mean we've found a function declarator. If the next token is not
a ')', this is actually a parenthesized pack expansion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153544 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-ambig.cpp
412e0cc52ea644d804dcfa87194800371f91a977 27-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> When we see 'Class(X' or 'Class::Class(X' and we suspect that it names a
constructor, but X is not a known typename, check whether the tokens could
possibly match the syntax of a declarator before concluding that it isn't
a constructor. If it's definitely ill-formed, assume it is a constructor.

Empirical evidence suggests that this pattern is much more often a
constructor with a typoed (or not-yet-declared) type name than any of the
other possibilities, so the extra cost of the check is not expected to be
problematic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153488 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
0e3c98951de30a129525c70bd4242739dcdb5ab5 15-Mar-2012 Aaron Ballman <aaron@aaronballman.com> Adding some more specific tests for enum declspec parsing, to prove that it really works.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152757 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
6f42669b7c0b81b07a15a0483aa5e897ce57cb45 12-Mar-2012 David Blaikie <dblaikie@gmail.com> Fix a crash-on-invalid found by -Wlogical-op-parentheses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152559 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-ambig.cpp
7796eb5643244f3134834253ce5ea89107ac21c1 12-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix parsing of trailing-return-type. Types are syntactically prohibited from
being defined here: [] () -> struct S {} does not define struct S.

In passing, implement DR1318 (syntactic disambiguation of 'final').


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152551 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-ambig.cpp
xx0x-decl.cpp
xx0x-lambda-expressions.cpp
69730c115c2d0fec2f20609d905d920a5a41b29b 12-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix parsing of type-specifier-seq's. Types are syntactically allowed to be
defined here, but not semantically, so

new struct S {};

is always ill-formed, even if there is a struct S in scope.

We also had a couple of bugs in ParseOptionalTypeSpecifier caused by it being
under-loved (due to it only being used in a few places) so merge it into
ParseDeclarationSpecifiers with a new DeclSpecContext. To avoid regressing, this
required improving ParseDeclarationSpecifiers' diagnostics in some cases. This
also required teaching ParseSpecifierQualifierList about constexpr... which
incidentally fixes an issue where we'd allow the constexpr specifier in other
bad places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152549 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-type-specifier.cpp
36f5cfe4df32af6c5fe01228102512996f566f9d 09-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Support for raw and template forms of numeric user-defined literals,
and lots of tidying up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152392 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-user-defined-literals.cpp
33762775706e81c17ca774102ceda36049ecc593 09-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix a couple of issues with literal-operator-id parsing, and provide recovery
for a few kinds of error. Specifically:

Since we're after translation phase 6, the "" token might be formed by multiple
source-level string literals. Checking the token width is not a correct way of
detecting empty string literals, due to escaped newlines. Diagnose and recover
from a missing space between "" and suffix, and from string literals other than
"", which are followed by a suffix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152348 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-user-defined-literals.cpp
b453ad3214d00acc51c9aa702c76c58354d84b84 08-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add support for cooked forms of user-defined-integer-literal and
user-defined-floating-literal. Support for raw forms of these literals
to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152302 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-user-defined-literals.cpp
2fb4ae36825ca3a0cbe7e845c5747062870066be 08-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 [lex.ext]p10 for string and character literals: a ud-suffix not
starting with an underscore is ill-formed.

Since this rule rejects programs that were using <inttypes.h>'s macros, recover
from this error by treating the ud-suffix as a separate preprocessing-token,
with a DefaultError ExtWarn. The approach of treating such cases as two tokens
is under discussion for standardization, but is in any case a conforming
extension and allows existing codebases to keep building while the committee
makes up its mind.

Reword the warning on the definition of literal operators not starting with
underscores (which are, strangely, legal) to more explicitly state that such
operators can't be called by literals. Remove the special-case diagnostic for
hexfloats, since it was both triggering in the wrong cases and incorrect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152287 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-literal-operators.cpp
dd66be718f23c8149d74ae8b011b002e11e8d5ba 08-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> User-defined literal support for character literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152277 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-user-defined-literals.cpp
9fcce65e7e1307b5b8da9be13e4092d6bb94dc1d 07-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> AST representation for user-defined literals, plus just enough of semantic
analysis to make the AST representation testable. They are represented by a
new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic
properties, including full CodeGen support, are achieved for free by this
representation.

UserDefinedLiterals can never be dependent, so no custom instantiation
behavior is required. They are mangled as if they were direct calls to the
underlying literal operator. This matches g++'s apparent behavior (but not its
actual mangling, which is broken for literal-operator-ids).

User-defined *string* literals are now fully-operational, but the semantic
analysis is quite hacky and needs more work. No other forms of user-defined
literal are created yet, but the AST support for them is present.

This patch committed after midnight because we had already hit the quota for
new kinds of literal yesterday.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152211 91177308-0d34-0410-b5e6-96231b3b80d8
xx11-user-defined-literals.cpp
99831e4677a7e2e051af636221694d60ba31fcdb 06-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> User-defined literals: reject string and character UDLs in all places where the
grammar requires a string-literal and not a user-defined-string-literal. The
two constructs are still represented by the same TokenKind, in order to prevent
a combinatorial explosion of different kinds of token. A flag on Token tracks
whether a ud-suffix is present, in order to prevent clients from needing to look
at the token's spelling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152098 91177308-0d34-0410-b5e6-96231b3b80d8
sm.cpp
xx11-user-defined-literals.cpp
bjcxx11-user-defined-literal.mm
6454a02e7bbda180ef3867b6ae3c1aee327a34a7 01-Mar-2012 Aaron Ballman <aaron@aaronballman.com> Added support for parsing declspecs on enumerations. Fixes PR8783

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151798 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
d8e4daca4a44d25a9c09d51def9e3d485d4f302c 27-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix decltype crash-on-invalid, if we don't find a matching ')' for an ill-formed
decltype expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151515 91177308-0d34-0410-b5e6-96231b3b80d8
racket-crash.cpp
d81e961f905e3ea57f6808e5a5686a8324270984 23-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Update parser's disambiguation to cope with braced function-style casts in
C++11, and with braced-init-list initializers in conditions. This exposed an
ambiguity with enum underlying types versus bitfields, which we resolve by
treating 'enum E : T {' as always defining an enumeration (even if it would
only successfully parse as a bitfield). This appears to be g++ compatible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151227 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-ambig.cpp
xx0x-condition.cpp
d77177a752a08abf3f5cf46d7a3fe6143325815d 22-Feb-2012 Francois Pichet <pichet2000@gmail.com> In -fdelayed-template-parsing mode, reenter every scope when late parsing a templated function; (Not just the template parameter scope as previously). Also enter the scope stack in the correct order.

Otherwise this breaks some invariant during name lookup especially when dealing with shadowed declaration

Fix PR11931.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151140 91177308-0d34-0410-b5e6-96231b3b80d8
elayedTemplateParsing.cpp
0635aa75ab48c9c3b4269d266305aba77b6ec58e 22-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Accept braced-init-lists in conditions, and, in passing, dramatically improve
the diagnostic for using a parenthesized direct-initializer in a condition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151137 91177308-0d34-0410-b5e6-96231b3b80d8
xx-condition.cpp
xx0x-condition.cpp
b3f323d6c41cb614a249dbc4af7493762786521a 17-Feb-2012 Douglas Gregor <dgregor@apple.com> Disambiguate between C++11 lambda expressions and C99 array
designators in the parser. In the worst case, this disambiguation
requires tentative parsing just past the closing ']', but for most
cases we'll be able to tell by looking ahead just one token (without
going into the heavyweight tentative parsing machinery).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150790 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
c9ecec404fe28d53aa49b3c830d8353e97bea5f2 16-Feb-2012 Douglas Gregor <dgregor@apple.com> Improve recovery for lambda expressions that have 'mutable' or a
trailing return type but not a '()'. Recover by inserting the
parentheses. Thanks to Xeo on IRC for the example.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150727 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
c24a2335677f3d1bd2cab1019ac445d650f52123 16-Feb-2012 DeLesley Hutchins <delesley@google.com> Allow thread safety attributes on function definitions.
For compatibility with gcc, clang will now parse gcc attributes on
function definitions, but issue a warning if the attribute is not a
thread safety attribute. Warning controlled by -Wgcc-compat.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150698 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.c
2d4d7fd0ca37b61406dfe58acbefa8cf20ee050a 15-Feb-2012 Kaelyn Uhrain <rikka@google.com> Improve typo correction involving nested name specifiers.

Snooping in other namespaces when the identifier being corrected is
already qualified (i.e. a valid CXXScopeSpec is passed to CorrectTypo)
and ranking synthesized namespace qualifiers relative to the existing
qualifier is now performed. Support for disambiguating the string
representation of synthesized namespace qualifers has also been added
(the change to test/Parser/cxx-using-directive.cpp is an example of an
ambiguous relative qualifier).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150622 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-directive.cpp
625bb569df0c34feec0d52c0ec5215f21ef2e054 14-Feb-2012 Dmitri Gribenko <gribozavr@gmail.com> Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)

* if, switch, range-based for: warn if semicolon is on the same line.
* for, while: warn if semicolon is on the same line and either next
statement is compound statement or next statement has more
indentation.

Replacing the semicolon with {} or moving the semicolon to the next
line will always silence the warning.

Tests from SemaCXX/if-empty-body.cpp merged into SemaCXX/warn-empty-body.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150515 91177308-0d34-0410-b5e6-96231b3b80d8
xx-condition.cpp
tatements.c
ecfcd5655758955d8958dc2a7a7b2c8eff2395b7 12-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Drive-by fix of incorrect diagnostic, and a test case for said diagnostic. The double error is unfortunate, but I really don't see an alternative whose effort is worth it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150317 91177308-0d34-0410-b5e6-96231b3b80d8
xx-default-delete.cpp
b326ca8ffbea96f9cc8a457b0f57be880304a6f5 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Remove the "unsupported" error for lambda expressions. It's annoying,
and rapidly becoming untrue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150165 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
bjcxx0x-lambda-expressions.mm
dcffcbf790b9d948a393904a5dca0a056823f927 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Fix yet one more test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150129 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx0x-lambda-expressions.mm
7f99f43b362a4a4a0f47515c88690d7291756447 09-Feb-2012 Douglas Gregor <dgregor@apple.com> Fix tests for r150123

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150126 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-lambda-expressions.cpp
bjcxx-lambda-expressions-neg.mm
282e7e66748cc6dd14d6f7f2cb52e5373c531e61 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> In C++11 mode, when an integral constant expression is desired and we have a
value of class type, look for a unique conversion operator converting to
integral or unscoped enumeration type and use that. Implements [expr.const]p5.

Sema::VerifyIntegerConstantExpression now performs the conversion and returns
the converted result. Some important callers of Expr::isIntegralConstantExpr
have been switched over to using it (including all of those required for C++11
conformance); this switch brings a side-benefit of improved diagnostics and, in
several cases, simpler code. However, some language extensions and attributes
have not been moved across and will not perform implicit conversions on
constant expressions of literal class type where an ICE is required.

In passing, fix static_assert to perform a contextual conversion to bool on its
argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149776 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
84b007fae6c0cd30fa07074d34fbe2bf61fa44f9 26-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Refactor to share code for handling return statements between lambda expressions and block literals. As it turns out, almost all the logic can be shared.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149031 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx0x-lambda-expressions.mm
65ba94814f667e6ea1fcbf0896ad496bb7010335 21-Jan-2012 Richard Trieu <rtrieu@google.com> Fix code so that a SkipUntil will ignore semicolons when skipping a
function body. This keeps the brace count accurate to prevent
additional errors. Also, moved the caret from the brace to the function
name.

Code:
class F{ int Foo{ return 1; } };

Fixed error:
parameters.cc:1:14: error: function definition does not declare parameters
class F{ int Foo{ return 1; } };
^
1 error generated.

Old errors:
parameters.cc:1:17: error: function definition does not declare parameters
class F{ int Foo{ return 1; } };
^
parameters.cc:1:30: error: expected ';' after class
class F{ int Foo{ return 1; } };
^
;
parameters.cc:1:31: error: expected external declaration
class F{ int Foo{ return 1; } };
^
3 errors generated.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148621 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
883692ebd421c40b44e2c2665e5f54dade5621bc 17-Jan-2012 Nico Weber <nicolasweber@gmx.de> Improve diagnostics for dangling '}'.

Fixes PR6484. Patch from Jason Switzer!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148270 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-quirks.m
ecovery.c
72899c34e3d1abfffa241ad0ce5c4bf175e5ea51 07-Jan-2012 Eli Friedman <eli.friedman@gmail.com> More lambda work: semantic analysis of capturing 'this'. It's a bit complicated, but we have to be careful about when exactly captures are marked given PotentiallyPotentiallyEvaluated contexts. (Actually, it's not 100% correct yet, but it's close enough for the moment.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147723 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx0x-lambda-expressions.mm
ec9ea7200718478e8a976529defbe21942a11c9c 05-Jan-2012 Eli Friedman <eli.friedman@gmail.com> More lambda work. Tweak the Sema interface slightly. Start adding the pieces to build the lambda class and its call operator. Create an actual scope for the lambda body.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147595 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx0x-lambda-expressions.mm
dc3b723d35067e5d13474247b94a10c869cc7e58 04-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Stub out the Sema interface for lambda expressions, and change the parser to use it. Unconditionally error on lambda expressions because they don't work in any meaningful way yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147515 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
xx0x-lambda-expressions.cpp
bjcxx0x-lambda-expressions.mm
d7c56e1114bfe7d461786903bb720d2c6efc05a1 29-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Change the diagnostics which said 'accepted as an extension' to instead say
'is an extension'. The former is inappropriate and confusing when building with
-Werror/-pedantic-errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147357 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ext-delete-default.cpp
xx0x-in-cxx98.cpp
5cb94a78202ccb1007df0be86884297761f4a53a 23-Dec-2011 Nico Weber <nicolasweber@gmx.de> Add -Wdangling-else.

This works like described in http://drdobbs.com/blogs/cpp/231602010
Fixes http://llvm.org/PR11609



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147202 91177308-0d34-0410-b5e6-96231b3b80d8
arn-dangling-else.cpp
a44854a23b3f090729d82f447aa88df4f6563263 20-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11297: Provide a better diagnostic for code which contains a
reasonable-looking but ill-formed for-range statement of the form:

for (expression : expression)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147006 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-for-range.cpp
0db9f4dad563a335641f5b9d4a42504d638b6c85 17-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> In Parser::SkipUntil do not stop at '@' unconditionally.

Stopping at '@' was originally intended to avoid skipping an '@' at the @interface context
when doing parser recovery, but we should not stop at all '@' tokens because they may be part
of expressions (e.g. in @"string", @selector(), etc.), so in most cases we will want to skip them.

This commit caused 'test/Parser/method-def-in-class.m' to fail for the cases where we tried to
recover from unmatched angle bracket but IMO it is not a big deal to not have good recovery
from such broken code and the way we did recovery would not always work anyway (e.g. if there was '@'
in an expression).

The case that rdar://7029784 is about still passes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146815 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-def-in-class.m
2fe9b7fb07dff15dd15dd8755a9a9e6de0fe46fc 15-Dec-2011 Richard Trieu <rtrieu@google.com> Modify how the -verify flag works. Currently, the verification string and
diagnostic message are compared. If either is a substring of the other, then
no error is given. This gives rise to an unexpected case:

// expect-error{{candidate function has different number of parameters}}

will match the following error messages from Clang:

candidate function has different number of parameters (expected 1 but has 2)
candidate function has different number of parameters

It will also match these other error messages:

candidate function
function has different number of parameters
number of parameters

This patch will change so that the verification string must be a substring of
the diagnostic message before accepting. Also, all the failing tests from this
change have been corrected. Some stats from this cleanup:

87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146619 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
heck-syntax-1.m
xx-altivec.cpp
xx-typeid.cpp
xx0x-lambda-expressions.cpp
bjc-category-neg-1.m
bjc-forcollection-neg-2.m
bjc-init.m
ecovery.c
7209646add692c50503435bcffb13187a3349552 13-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> objc: diagnose duplicate declaration of methods
in classes. // rdar://10535349


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146504 91177308-0d34-0410-b5e6-96231b3b80d8
nhanced-proto-1.m
9d24a8be93b28488dbfb9bbe8aa6fe35b21a5b0c 13-Dec-2011 Francois Pichet <pichet2000@gmail.com> Implement the Microsoft __if_exists/if_not_exists extension in initializer-list.
Necessary to parse Microsoft ATL code.

Example:
int array[] = {
0,
__if_exists(CLASS::Type) {2, }
3
};

will declare an array of 2 or 3 elements depending on if CLASS::Type exists or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146447 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
006e42f0c8b65b783d565ef10b938a9e82fc02e3 10-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> Add ability to supply additional message to availability macros,
// rdar://10095131


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146304 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
90ec96f3026480fa41057b05d58f338aed585f62 08-Dec-2011 Erik Verbruggen <erikjv@me.com> Fix: allow @protocol forward declarations inside @implementation-s.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146147 91177308-0d34-0410-b5e6-96231b3b80d8
issing-end-4.m
d64251fd56577dd5c78903454632361e094c6dc1 06-Dec-2011 Erik Verbruggen <erikjv@me.com> Extend warnings for missing '@end'.
Fixes PR2709.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145928 91177308-0d34-0410-b5e6-96231b3b80d8
issing-end-2.m
issing-end-3.m
issing-end.m
bjc-missing-impl.m
bjc-quirks.m
7f422287a2ee7e515beb715f1f8915e9331469ee 02-Dec-2011 Ted Kremenek <kremenek@apple.com> Diagnose use of wide string literal in 'asm' instead of crashing. Fixes <rdar://problem/10465079>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145656 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
2aba7115f9df1676d5c1811324cceff1b4c4a356 01-Dec-2011 Francois Pichet <pichet2000@gmail.com> Change the Microsoft __interface keyword to be an alias for struct (not class) since members are public by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145580 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
9d38dbc9a16017fff3e34b7876a6590413a7d56b 19-Nov-2011 Francois Pichet <pichet2000@gmail.com> Enable delayed template parsing for friend functions declared at template class scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144980 91177308-0d34-0410-b5e6-96231b3b80d8
elayedTemplateParsing.cpp
c430ef4f92eedea7d3378f05a2b05982ed3713dc 10-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11148: Fix crash-on-invalid if an invalid member declaration is marked as
defaulted or deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144270 91177308-0d34-0410-b5e6-96231b3b80d8
xx-default-delete.cpp
0706df40064d4d7559b4304af79d519033414b84 19-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Improve the diagnostic when a comma ends up at the end of a declarator group
instead of a semicolon (as sometimes happens during refactorings). When such a
comma is seen at the end of a line, and is followed by something which can't
possibly be a declarator (or even something which might be a plausible typo for
a declarator), suggest that a semicolon was intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142544 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
xx0x-decl.cpp
fe0a0fb65f18a8495d97a700ca62fe639ffd85e9 17-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Refactor __attribute__ parsing, and add a diagnostic if the r_paren at the end
of an attrib is missing. gcc does not allow the closing parenthesis to be omitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142255 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.c
95fa252f180296c911d855660dcafd6bfee22180 15-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Testcase for half of r142048.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142053 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-in-cxx98.cpp
d60feeb90a4278dfb875fece6587e4c5c1198a60 15-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Use of override keywords in C++98 should produce a warning by default.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142050 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-in-cxx98.cpp
762bb9d0ad20320b9f97a841dce57ba5e8e48b07 14-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Update all tests other than Driver/std.cpp to use -std=c++11 rather than
-std=c++0x. Patch by Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141900 91177308-0d34-0410-b5e6-96231b3b80d8
R11000.cpp
har-literal-printing.c
xx-default-delete.cpp
xx0x-attributes.cpp
xx0x-lambda-expressions.cpp
xx0x-literal-operators.cpp
xx0x-member-initializers.cpp
xx0x-override-control-keywords.cpp
xx0x-rvalue-reference.cpp
bjcxx0x-lambda-expressions.mm
op-level-semi-cxx0x.cpp
5f1c822def3efffe1d8f7299fbbbc3b1cdd4833d 13-Oct-2011 Erik Verbruggen <erikjv@me.com> Allow for annotate attributes after access specifiers. When such
attributes are found, propagate them to subsequent declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141861 91177308-0d34-0410-b5e6-96231b3b80d8
ccess-spec-attrs.cpp
13f8daf70637f8f295134ac8e089dd7721e09085 13-Oct-2011 David Blaikie <dblaikie@gmail.com> Fix crash-on-invalid, improve error recovery, and test coverage for missing colon after access specifiers in C++


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141852 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
b3df1386680b3830d2f4d300d4d7eaba134135fc 12-Oct-2011 Douglas Gregor <dgregor@apple.com> Switch diagnostic text from "C++0x" over to "C++11".

We'd also like for "C++11" or "c++11" to be used for the warning
groups, but without removing the old warning flags. Patches welcome;
I've run out of time to work on this today.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141801 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ext-delete-default.cpp
xx-reference.cpp
xx0x-in-cxx98.cpp
4a8dfb511e8f84b2e38b7a86d8ddf05ac1e1a41b 12-Oct-2011 Douglas Gregor <dgregor@apple.com> Introduce BalancedDelimiterTracker, to better track open/close
delimiter pairs and detect when we exceed the implementation limit for
nesting depth, from Aaron Ballman!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141782 91177308-0d34-0410-b5e6-96231b3b80d8
arser_overflow.c
b8b0e75aeec85a7a268fdba311de4f1cd527fae1 06-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: add a non-standard extension, cl_clang_storage_class_specifiers,
which enables support for C99 storage-class specifiers.

This extension is intended to be used by implementations to implement
OpenCL C built-in functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141271 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-storage-class.cl
41c8d6fe09624ea31f5641dd53b6f0b6368ffcdd 06-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: disallow '#pragma OPENCL EXTENSION all : enable', per OpenCL 1.1 9.1

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141270 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-pragma.cl
d1e40d5389a4382cbebc97d54792f41ee0414af4 02-Oct-2011 John McCall <rjmccall@apple.com> Make -fobjc-nonfragile-abi the -cc1 default, since it's the
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.

This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.

Most, though, it involved a perl script to translate a ton
of test cases.

Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140957 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
e82247a71a1a76e78f3b979b64d5f6412ab40266 01-Oct-2011 John McCall <rjmccall@apple.com> Hey, maybe we shouldn't silently ignore decl attributes
on declarators written as types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140931 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
a891a32d3762ee641a29c091d286f2a7432671a5 30-Sep-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a bug in the token caching for inline constructors in C++11, and improve error recovery in both dialects. This should fix the GCC test suite failures as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140847 91177308-0d34-0410-b5e6-96231b3b80d8
xx-member-initializers.cpp
xx0x-member-initializers.cpp
3fedbe1f71c18fba01d39109d606f421a0103a2a 30-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Some fixes for MS-style asm parsing: specifically, add some error checking, and handle asm comments using semicolons correctly. (The comments are actually surprisingly tricky.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140837 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
1991b7139a92d73420336690a870f049e88cfad6 29-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11000: Fix crash on invalid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140802 91177308-0d34-0410-b5e6-96231b3b80d8
R11000.cpp
82d0b0aab9088e977c2a44c4a5a90479c63149fe 29-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for alignment-specifiers in C1X and C++11, remove
support for the C++0x draft [[align]] attribute and add the C1X
standard header file stdalign.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140796 91177308-0d34-0410-b5e6-96231b3b80d8
1x-alignas.c
xx0x-attributes.cpp
3497fdfdb742f55d7b7ec8e22779fb08962b8441 29-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for parsing an attribute-specifier-seq containing multiple
attribute-specifiers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140794 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
f19076848566cb52a40ddbdb2555c53d12e9a003 29-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for parsing the optional attribute-specifier-seq at the
end of a decl-specifier-seq

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140793 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
10904527359605a76561a49769a2199351a072d8 24-Sep-2011 Matt Beaumont-Gay <matthewbg@google.com> Fix a crash-on-invalid.

The token stream was not getting properly reset when leaving
ParseLexedMethodDef in some error cases. In the testcase, that caused later
accesses to the token stream to touch memory which had been freed as we
finished parsing the class definition. Major hat-tip to AddressSanitizer for
helping pinpoint the use-after-free, including the allocation and deallocation
points:

==21510== ERROR: AddressSanitizer heap-use-after-free on address 0x7feb3de87848 at pc 0x249f4e2 bp 0x7fff15a89df0 sp 0x7fff15a89ce0
READ of size 1 at 0x7feb3de87848 thread T0
#0 0x249f4e2 clang::TokenLexer::Lex()
#1 0x1c834a0 clang::Parser::ConsumeToken()
#2 0x1c7dc0f clang::Parser::ParseDeclarationOrFunctionDefinition()
#3 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
0x7feb3de87848 is located 1992 bytes inside of 3816-byte region [0x7feb3de87080,0x7feb3de87f68)
freed by thread T0 here:
#0 0x3a22c19 free
#1 0x1d136a1 clang::Parser::LexedMethod::~LexedMethod()
#2 0x1cef528 clang::Parser::DeallocateParsedClasses()
#3 0x1cef676 clang::Parser::PopParsingClass()
#4 0x1cea094 clang::Parser::ParseCXXMemberSpecification()
#5 0x1ce7ae5 clang::Parser::ParseClassSpecifier()
#6 0x1cfe588 clang::Parser::ParseDeclarationSpecifiers()
#7 0x1c7dbe8 clang::Parser::ParseDeclarationOrFunctionDefinition()
#8 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
previously allocated by thread T0 here:
#0 0x3a2302d realloc
#1 0x39d7c97 llvm::SmallVectorBase::grow_pod()
#2 0x1ac588e llvm::SmallVectorImpl<>::push_back()
#3 0x1d12d8b clang::Parser::ConsumeAndStoreUntil()
#4 0x1c9c24d clang::Parser::ConsumeAndStoreUntil()
#5 0x1d12c1e clang::Parser::ConsumeAndStoreUntil()
#6 0x1c9c24d clang::Parser::ConsumeAndStoreUntil()
#7 0x1d10042 clang::Parser::ParseCXXInlineMethodDef()
#8 0x1cec51a clang::Parser::ParseCXXClassMemberDeclaration()
#9 0x1ce9de5 clang::Parser::ParseCXXMemberSpecification()
#10 0x1ce7ae5 clang::Parser::ParseClassSpecifier()
#11 0x1cfe588 clang::Parser::ParseDeclarationSpecifiers()
#12 0x1c7dbe8 clang::Parser::ParseDeclarationOrFunctionDefinition()
#13 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140427 91177308-0d34-0410-b5e6-96231b3b80d8
xx-member-init-missing-paren-crash.cpp
fdde47061d8ff0b481414ccf69ebdc47c2216274 23-Sep-2011 Francois Pichet <pichet2000@gmail.com> [microsoft] Fix a bug in -fdelayed-template-parsing mode where we were not reentering the delayed function context correctly. The problem was that all template params were reintroduced inside the same scope. So if we had a situation where we had 2 template params with the same name at different scope then clang would generate an error about ambiguous name.

The solution is to create a new ParseScope(Scope::TemplateParamScope) for each template scope that we want to reenter. (from the outmost to the innermost scope)

This fixes some errors when parsing MFC code with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140344 91177308-0d34-0410-b5e6-96231b3b80d8
elayedTemplateParsing.cpp
c11030ea936f6952deb5a1423ce1648173cd417e 20-Sep-2011 Richard Trieu <rtrieu@google.com> Fix a problem in digraph handling where "[:" might be treated as "<::" and
erronously trigger the digraph correction fix-it. Include a new test to catch
this in the future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140175 91177308-0d34-0410-b5e6-96231b3b80d8
xx-casting.cpp
950be71c745409e373ae8a834490f9026c8ac222 19-Sep-2011 Richard Trieu <rtrieu@google.com> Changes to the name lookup have caused a regression in the digraph fix-it hint.
For instance:

template <class T> void E() {};
class F {};

void test() {
::E<::F>();
E<::F>();
}

Gives the following error messages:

error: found '<::' after a template name which forms the
digraph '<:' (aka '[') and a ':', did you mean '< ::'?
::E<::F>();
^~~
< ::
error: expected expression
E<::F>();
^
error: expected ']'
note: to match this '['
E<::F>();

This patch adds the digraph fix-it check right before the name lookup,
moves the shared checking code to a new function, and adds new
tests to catch future regressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140039 91177308-0d34-0410-b5e6-96231b3b80d8
xx-casting.cpp
1155c42e7b1b4e401bb0a331a6d715d637958c75 31-Aug-2011 Douglas Gregor <dgregor@apple.com> Allow C99 hexfloats in C++0x mode. This change resolves the standards
collision between C99 hexfloats and C++0x user-defined literals by
giving C99 hexfloats precedence. Also, warning about user-defined
literals that conflict with hexfloats and those that have names that
are reserved by the implementation. Fixes <rdar://problem/9940194>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138839 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-literal-operators.cpp
58fd97a6f4f7c909aeef46b501ab46f3d6eac671 25-Aug-2011 Francois Pichet <pichet2000@gmail.com> Add support for Microsoft __ptr32 keyword.
Patch by Chris Cudmore!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138533 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
5440bfaff6aec058b60bc6da75bb4f13b7a76491 18-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Remove the last FIXMEs on -Wunused-comparison since it got moved to
entirely use the existing -Wunused-value infrastructure. This also fixes
a few missed cases for -Wunused in general.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137916 91177308-0d34-0410-b5e6-96231b3b80d8
witch-recovery.cpp
ae7902c4293d9de8b9591759513f0d075f45022a 04-Aug-2011 Douglas Gregor <dgregor@apple.com> Parsing of C++0x lambda expressions, from John Freeman with help from
David Blaikie!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136876 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
xx0x-lambda-expressions.cpp
bjc-messaging-neg-1.m
bjcxx-lambda-expressions-neg.mm
bjcxx0x-lambda-expressions.mm
53afad5ebbfd47e932405af5b93177ea0d68e3f4 29-Jul-2011 Douglas Gregor <dgregor@apple.com> This patch makes the string/character literal tests run in C,
C++98/03, and C++0x mode, from Craig Topper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136443 91177308-0d34-0410-b5e6-96231b3b80d8
har-literal-printing.c
5cee1195584fa8672253139c86e922daeda69b9e 27-Jul-2011 Douglas Gregor <dgregor@apple.com> Add support for C++0x unicode string and character literals, from Craig Topper!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136210 91177308-0d34-0410-b5e6-96231b3b80d8
har-literal-printing.c
e23af2a86ed22c2a11d820820b78353b095e7ae7 20-Jul-2011 Joerg Sonnenberger <joerg@bec.de> PR10392: "#pragma GCC visibility" must not expand macros in its
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135552 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-visibility2.c
699f9b1effc8fd891637797ef3dc58d7b80d476a 10-Jul-2011 Francois Pichet <pichet2000@gmail.com> Change __debugbreak signature to void __debugbreak(void); MSVC compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134869 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
b73377eeb3eff76be134203aebb6068244b177f3 07-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make the Preprocessor more memory efficient and improve macro instantiation diagnostics.

When a macro instantiation occurs, reserve a SLocEntry chunk with length the
full length of the macro definition source. Set the spelling location of this chunk
to point to the start of the macro definition and any tokens that are lexed directly
from the macro definition will get a location from this chunk with the appropriate offset.

For any tokens that come from argument expansion, '##' paste operator, etc. have their
instantiation location point at the appropriate place in the instantiated macro definition
(the argument identifier and the '##' token respectively).
This improves macro instantiation diagnostics:

Before:

t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int')
int y = M(/);
^~~~
t.c:5:11: note: instantiated from:
int y = M(/);
^

After:

t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int')
int y = M(/);
^~~~
t.c:3:20: note: instantiated from:
\#define M(op) (foo op 3);
~~~ ^ ~
t.c:5:11: note: instantiated from:
int y = M(/);
^

The memory savings for a candidate boost library that abuses the preprocessor are:

- 32% less SLocEntries (37M -> 25M)
- 30% reduction in PCH file size (900M -> 635M)
- 50% reduction in memory usage for the SLocEntry table (1.6G -> 800M)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134587 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.c
31fd2b7881efc6b7b1e466823c10c64ba5ddffe3 01-Jul-2011 Richard Trieu <rtrieu@google.com> For code such as:

int f(int x) {
if (int foo = f(bar)) {}
return 0;
}

Clang produces the following error messages:

paren_imbalance.cc:2:19: error: use of undeclared identifier 'bar'
if (int foo = f(bar)) {}
^
paren_imbalance.cc:2:26: error: expected ')'
if (int foo = f(bar)) {}
^
paren_imbalance.cc:2:6: note: to match this '('
if (int foo = f(bar)) {}
^

The second error is incorrect. This patch will stop Clang from producing an error on parenthesis imbalance during error recovery when there isn't one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134258 91177308-0d34-0410-b5e6-96231b3b80d8
arenthesis-balance.cpp
7ddf6b2d77ac4cb27f78d817d7884e6ce17afd0c 24-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow Lexer::getLocForEndOfToken to return the location just passed the macro instantiation
if the location given points at the last token of the macro instantiation.

Fixes rdar://9045701.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133804 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.c
0e1e69ca1b30df7692f302a5388377f507bc4567 13-Jun-2011 David Majnemer <david.majnemer@gmail.com> Improve the diagnostics generated for switch statements missing expressions

- Move the diagnostic to the case statement instead of at the end of the switch
- Add a fix-it hint as to how to fix the compilation error


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132903 91177308-0d34-0410-b5e6-96231b3b80d8
witch-recovery.cpp
7a614d8380297fcd2bc23986241905d97222948c 11-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for C++11 in-class initialization of non-static data members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132878 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-member-initializers.cpp
af9cddfda10802f948e9d4b44ebded1ec749de21 08-Jun-2011 Peter Collingbourne <peter@pcc.me.uk> Modify a diagnostic introduced in r132612 to emit QualTypes directly

This fixes a memory error on FreeBSD (and is the right thing to do
in any case).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132750 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-astype.cl
61eee0ca33b29e102f11bab77c8b74cc00e2392b 04-Jun-2011 Tanya Lattner <tonic@nondot.org> Add support for builtin astype:
__builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types.
Added test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132612 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-astype.cl
f858bd817e8d6eac58ae496fa96a2f508fbb286f 26-May-2011 Richard Trieu <rtrieu@google.com> Add a fix-it and better error recovery for improperly nested namespaces. This will give a better error message for cases such as "namespace foo::bar::baz {}" and a suggested fix-it of "namespace foo { namespace bar { namespace baz {} } }"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132138 91177308-0d34-0410-b5e6-96231b3b80d8
ested-namespaces-recovery.cpp
563a645de82231a55e221fe655b7188bf8369662 25-May-2011 Francois Pichet <pichet2000@gmail.com> Add support for Microsoft __if_exists, __if_not_exists extension at class scope.

Example:

typedef int TYPE;
class C {
__if_exists(TYPE) {
TYPE a;
}
__if_not_exists(TYPE) {
this will never be parsed.
}
};


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132052 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
7880bc34fd5818d8f1eb827fdce136c1de643ab5 13-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a few basic tests for defaulted and deleted functions.

More comprehensive testing once copy {constructors,assignment operators}
can be defaulted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131275 91177308-0d34-0410-b5e6-96231b3b80d8
xx-default-delete.cpp
xx-ext-delete-default.cpp
6a24747beed797b2f1184c66ca45beb4db20eb08 11-May-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, allow pure specifier (=0) on inline functions declared at class scope.
This removes 2 errors when parsing MFC code with clang

Example:
class A {
virtual void f() = 0 { }
}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131175 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
44054452c416a622b8f19a6d157a0affc05b9aa8 10-May-2011 Douglas Gregor <dgregor@apple.com> Tweak the diagnostics for the C++0x extensions to friend types to note
that they are C++0x extensions, and put them in the appropriate
group. We already support most of the semantics. Addresses
<rdar://problem/9407525>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131153 91177308-0d34-0410-b5e6-96231b3b80d8
xx-friend.cpp
20e3c9ed21b47c3b6d1d82df84db357600bacc06 10-May-2011 Francois Pichet <pichet2000@gmail.com> Add a __uuidof test where the uuid attribute is on the second declaration.
Also some -fdelayed-template-parsing test refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131113 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
a23ae3f45789f40cdfd939117284f977d2dc17a6 07-May-2011 Francois Pichet <pichet2000@gmail.com> Temporary preprocessor hack to get around the Microsoft __identifier(x) extension.
http://msdn.microsoft.com/en-us/library/hzc8ytsz(v=VS.100).aspx

Microsoft doc claims this is a C++/CLI feature but it is really always enabled.
This removes 2 error when parsing MFC code with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131051 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
f986038beed360c031de8654cfba43a5d3184605 07-May-2011 Francois Pichet <pichet2000@gmail.com> Add support for _if_exists and __if_not_exists at namespace/global scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131050 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
1e862693c63067ae467b0b3884c44f753cd6e821 06-May-2011 Francois Pichet <pichet2000@gmail.com> Add support for Microsoft __if_exists and __if_not_exists construct inside function definition.
Allow to include or exclude code depending on if a symbol exists or not. Just like a #ifdef but for C/C++ symbols.

More doc: http://msdn.microsoft.com/en-us/library/x7wy9xh3(v=VS.100).aspx

Support at class and namespace scopes will be added later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131014 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
a343a415035aba553a5c21fad8fba6a6db83e0f9 29-Apr-2011 Francois Pichet <pichet2000@gmail.com> r130381 follow up: accept __uuidof expression for template argument reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130491 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
a97d24f2ca50f318f62a6cf2a621e7842dd63b4a 28-Apr-2011 Francois Pichet <pichet2000@gmail.com> Support &__uuidof(type) as a non type template argument.
This idiom is used everywhere in MFC/COM code and as such this patch removes hundreds of errors when parsing MFC code with clang.

Example:
template <class T, const GUID* g = &__uuidof(T)>
class ComTemplate { };

typedef ComTemplate<struct_with_uuid, &__uuidof(struct_with_uuid)> COM_TYPE;

Of course this is just parsing support. Trying to use this in CodeGen will generate:
error: cannot yet mangle expression type CXXUuidofExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130381 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
338d7f7362d18fa9c39c6bb5282b4e20574a9309 28-Apr-2011 Francois Pichet <pichet2000@gmail.com> Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin defines to real types.

Otherwise statements like:
__int64 var = __int64(0);

would be expanded to:
long long var = long long(0);

and fail to compile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130369 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
0047012d99e9f80e242f9dbbc374049d478ffc6f 27-Apr-2011 Francois Pichet <pichet2000@gmail.com> Add support for Microsoft __interface keyword. An __interface class is basically a normal class containing just pure virtual functions. No urgency to enforce that restriction in clang for now, so make __interface an "class" alias.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130290 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
81542fd91bd5e7e65ebae3eaad117bdaeaf7d737 25-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Remove some more hard CR-LF lines. These were particularly weird as they were
only a few lines of the file. Also set their properties to have explicitly
native eol sytle.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130124 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
ltivec.c
62395c9666b84bcb0cb322d5f5183472712685f6 25-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Remove hard coded dos line endings, let subversion translate them on
update.

Despite the diff, nothing but line endings changed here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130121 91177308-0d34-0410-b5e6-96231b3b80d8
elayedTemplateParsing.cpp
a5d318ad4ad3a110b3abb34f765e69b76f7c0bcd 24-Apr-2011 Francois Pichet <pichet2000@gmail.com> Downgrade unnecessary "typename" from error to warning in Microsoft mode.
This fixes 1 error when parsing MSVC 2008 headers with clang.

Must "return true;" even if it is a warning because the rest of the code path assumes that SS is set to something. The parser will get back on its feet and continue parsing the rest of the declaration correctly so it is not a problem.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130088 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
d4a0caf78e7c18e7aca65fbfd799a6c024ff51fb 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Correctly emit a diagnostic for multiple templated function definitions in -flate-template-parsing mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130030 91177308-0d34-0410-b5e6-96231b3b80d8
elayedTemplateParsing.cpp
8387e2a41eef6fa17fb140a18c29b6eee9dd2b8a 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.

Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130022 91177308-0d34-0410-b5e6-96231b3b80d8
elayedTemplateParsing.cpp
64089cece350472c04b420c497ae391443353325 23-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Fixes an instance method meta-data generation bug in
ObjC NeXt runtime where method pointer registered in
metadata belongs to an unrelated method. Ast part of this fix,
I turned at @end missing warning (for class
implementations) into an error as we can never
be sure that meta-data being generated is correct.
// rdar://9072317


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130019 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-missing-impl.m
bb9b80c308d7d3f758886243c7145404a50c66cf 21-Apr-2011 Richard Trieu <rtrieu@google.com> Add a fixit suggest for missing case keywords inside a switch scope. For instance, in the following code, 'case ' will be suggested before the '1:'

switch (x) {
1: return 0;
default: return 1;
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129943 91177308-0d34-0410-b5e6-96231b3b80d8
witch-recovery.cpp
e106a0bfac30a8a215a68cc28aeb46b054dcb91f 19-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Avoid superfluous warning after an error is detcted and reported.
// rdar://9132143


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129822 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
f111d935722ed488144600cea5ed03a6b5069e8f 15-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> C1X: implement generic selections

As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129554 91177308-0d34-0410-b5e6-96231b3b80d8
1x-generic-selection.c
87f106462ce49a4a9b812b9de92aadd4e54567bd 15-Apr-2011 Douglas Gregor <dgregor@apple.com> If the declaration of a C++ member function with an inline definition
is so broken that Sema can't form a declaration for it, don't bother
trying to parse the definition later. Fixes <rdar://problem/9221993>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129547 91177308-0d34-0410-b5e6-96231b3b80d8
xx-member-crash.cpp
ea698b3f6cad84f7f583282dce3e03e24fe80e98 14-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Detect when the string "<::" is found in code after a cast or template name and is interpreted as "[:" because of the digraph "<:". When found, give an error with a fix-it to add whitespace between the "<" and "::".

Patch by Richard Trieu! Plus a small tweak from me to deal with one of the tokens coming from a macro.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129540 91177308-0d34-0410-b5e6-96231b3b80d8
xx-casting.cpp
8a9013d24864272cf5b18c908a267bd7a2bda4c4 14-Apr-2011 Douglas Gregor <dgregor@apple.com> Parse an '@' in an Objective-C++ class member specification,
diagnosing it as an error rather than looping infinitely. Also,
explicitly disallow @defs in Objective-C++. Fixes <rdar://problem/9260136>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129521 91177308-0d34-0410-b5e6-96231b3b80d8
bjcxx-at.mm
b3c4906aa62ebe72836f95c9d8306280a5bc6ad0 06-Apr-2011 John McCall <rjmccall@apple.com> Diagnose a missing ')' on what looks like a statement expression.
A situation where we can get an invalid ExprResult without an error.
Fixes PR8394. Patch by Justin Bogner!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128979 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.c
4147d307086cf024a40a080e2bf379e9725f6f41 27-Mar-2011 Francois Pichet <pichet2000@gmail.com> Improve recovery (error + fix-it) when parsing type dependent template name without the "template" keyword.

For example:
typename C1<T>:: /*template*/ Iterator<0> pos;

Also the error is downgraded to an ExtWarn in Microsoft mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128387 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
3b3e1a9e79703da067d23756e5624a4f487d6278 26-Mar-2011 Chris Lattner <sabre@nondot.org> fix the second part of rdar://8366474 - clang fails to parse ObjC selectors with '::', when :: isn't the first part of the selector.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128344 91177308-0d34-0410-b5e6-96231b3b80d8
elector-1.m
dceb53180ae145915673913a9398ba4a00b05584 26-Mar-2011 Douglas Gregor <dgregor@apple.com> Add a __has_feature check for the 'availability' attribute

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128337 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
b53e417ba487f4193ef3b0485b420e0fdae643a2 26-Mar-2011 Douglas Gregor <dgregor@apple.com> Extend the new 'availability' attribute with support for an
'unavailable' argument, which specifies that the declaration to which
the attribute appertains is unavailable on that platform.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128329 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
7da19ea50d4161fcda40d135735bcf450cabeb50 26-Mar-2011 John McCall <rjmccall@apple.com> Fix the recovery from missing semis on @property declarations to not consume
the following '@'. Conceivably, we could skip tokens until something that
can validly start an @interface declaration here, but it's not clear that
it matters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128325 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.m
b1f39680a2e3bce508dba0600665860e5ba5fb70 25-Mar-2011 Anders Carlsson <andersca@mac.com> Remove 'new' from virt-specifier since it's going to be removed in the next C++0x draft

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128271 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-override-control-keywords.cpp
0a0d2b179085a52c10402feebeb6db8b4d96a140 23-Mar-2011 Douglas Gregor <dgregor@apple.com> Implement a new 'availability' attribute, that allows one to specify
which versions of an OS provide a certain facility. For example,

void foo()
__attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));

says that the function "foo" was introduced in 10.2, deprecated in
10.4, and completely obsoleted in 10.6. This attribute ties in with
the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that
we want to deploy back to Mac OS X 10.1). There are several concrete
behaviors that this attribute enables, as illustrated with the
function foo() above:

- If we choose a deployment target >= Mac OS X 10.4, uses of "foo"
will result in a deprecation warning, as if we had placed
attribute((deprecated)) on it (but with a better diagnostic)
- If we choose a deployment target >= Mac OS X 10.6, uses of "foo"
will result in an "unavailable" warning (in C)/error (in C++), as
if we had placed attribute((unavailable)) on it
- If we choose a deployment target prior to 10.2, foo() is
weak-imported (if it is a kind of entity that can be weak
imported), as if we had placed the weak_import attribute on it.

Naturally, there can be multiple availability attributes on a
declaration, for different platforms; only the current platform
matters when checking availability attributes.

The only platforms this attribute currently works for are "ios" and
"macosx", since we already have -mxxxx-version-min flags for them and we
have experience there with macro tricks translating down to the
deprecated/unavailable/weak_import attributes. The end goal is to open
this up to other platforms, and even extension to other "platforms"
that are really libraries (say, through a #pragma clang
define_system), but that hasn't yet been designed and we may want to
shake out more issues with this narrower problem first.

Addresses <rdar://problem/6690412>.

As a drive-by bug-fix, if an entity is both deprecated and
unavailable, we only emit the "unavailable" diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128127 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
207f4d8543529221932af82836016a2ef066c917 18-Mar-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for language-specific address spaces. On top of that,
add support for the OpenCL __private, __local, __constant and
__global address spaces, as well as the __read_only, _read_write and
__write_only image access specifiers. Patch originally by ARM;
language-specific address space support by myself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127915 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-image-access.cl
7acafd032e145dbdbbed9274ca57ec2c86b912bc 05-Mar-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Parser support for noexcept specifications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127086 91177308-0d34-0410-b5e6-96231b3b80d8
xx-exception-spec.cpp
abea951c34876a5374d0e3678c7989b225c5c895 28-Feb-2011 Anders Carlsson <andersca@mac.com> Add -fcxx-exceptions to all tests that use C++ exceptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126599 91177308-0d34-0410-b5e6-96231b3b80d8
xx-stmt.cpp
xx-throw.cpp
xx0x-attributes.cpp
55edca9d7d6a50cbda6f036b05a0cb8d42f5a010 23-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Better parser recovery when method is
errornously defined inside an objc class.
// rdar://7029784


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126269 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-def-in-class.m
e9b801f7633b11b18d357a71442bd003435784e8 22-Feb-2011 Anders Carlsson <andersca@mac.com> Make clang -cc1 disable Objective-C exceptions by default, and add a -fobjc-exceptions flag to turn them on.

Update all tests accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126177 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
e41721e7dfabcc15cb50be9075a4153f1ad648ea 19-Feb-2011 Anders Carlsson <andersca@mac.com> Pass -fexceptions to all tests that use try/catch/throw.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126037 91177308-0d34-0410-b5e6-96231b3b80d8
xx-stmt.cpp
xx-throw.cpp
xx0x-attributes.cpp
4ae493cccbfbf122ec6ebac0e330232c22fa8489 18-Feb-2011 Chris Lattner <sabre@nondot.org> implement basic support for __label__. I wouldn't be shocked if there are
bugs from other clients that don't expect to see a LabelDecl in a DeclStmt,
but if so they should be easy to fix.

This implements most of PR3429 and rdar://8287027



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125817 91177308-0d34-0410-b5e6-96231b3b80d8
oto.c
87152f783602f7548ffa28c56412d0a919cc0415 18-Feb-2011 Chris Lattner <sabre@nondot.org> rename test



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125816 91177308-0d34-0410-b5e6-96231b3b80d8
oto-ident.c
oto.c
35001ca261f895817916b468379b696d6d45959d 17-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Enhance the array bounds checking to work for several other constructs,
especially C++ code, and generally expand the test coverage.

Logic adapted from a patch by Kaelyn Uhrain <rikka@google.com> and
another Googler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125775 91177308-0d34-0410-b5e6-96231b3b80d8
ncode.m
b72c77855473379c4c47e701005f7818946f659b 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Improve parser recovery in "for" statements, from Richard Smith!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125722 91177308-0d34-0410-b5e6-96231b3b80d8
or.cpp
db27d82dee4b66d1d3571bb3a308484ba4bb8294 15-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: standardise naming of test cases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125590 91177308-0d34-0410-b5e6-96231b3b80d8
l_storage_class.cl
pencl-storage-class.cl
f315fa81eef1977b3457fd7a7d4639e060fe7278 14-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: add support for __kernel, kernel keywords and EXTENSION,
FP_CONTRACT pragmas. Patch originally by ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125475 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-kernel.cl
pencl-pragma.cl
e2f82f71385051ce5abfba317d2f592aa332c588 11-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125399 91177308-0d34-0410-b5e6-96231b3b80d8
l_storage_class.cl
7f53253223b29d77f1e9c5c0ce93a19932761b77 09-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Fix scoping of method declarations and issue
warning when same parameter name used multiple times.
// rdar://8877730


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125229 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-forcollection-neg-2.m
bjc-forcollection-neg.m
bjc-foreach-syntax.m
bf36e25224b959595af84337339103ebc542ff8c 09-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Parse: add support for parsing CUDA kernel calls

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125219 91177308-0d34-0410-b5e6-96231b3b80d8
uda-kernel-call.cu
022915baa2aa0f7c026d22591ece0c914254b6b4 04-Feb-2011 Douglas Gregor <dgregor@apple.com> Fix test for previous commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124861 91177308-0d34-0410-b5e6-96231b3b80d8
xx-in-c.c
758afbcc86ef15f8d433f5f87db1495e50effeb3 04-Feb-2011 Douglas Gregor <dgregor@apple.com> Fix a crash-on-invalid where we were trying to parse C++ constructs in
C, then hitting an assertion because C code shouldn't try to parse
optional nested-name-specifiers. Fixes PR9137.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124860 91177308-0d34-0410-b5e6-96231b3b80d8
xx-in-c.c
dfaa5fb15da115315513ce356169450a5963977f 31-Jan-2011 Francois Pichet <pichet2000@gmail.com> Allow Microsoft attributes in a constructor's parameter list.
This fixes a few compile errors when parsing <regex> from MSVC 2008 with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124573 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
1f3810623fc7adbff149585a49a3f174dafdea81 26-Jan-2011 Douglas Gregor <dgregor@apple.com> Improve the extension warning for the use of ref-qualifiers, to
distinguish them from rvalue references. Using the rvalue-references
warning was weird when the ref-qualifier was '&'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124316 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-in-cxx98.cpp
16cf8f5b6f582876b64e132715280fc473f876b9 25-Jan-2011 Douglas Gregor <dgregor@apple.com> Downgrade the error about rvalue references to an extension warning
and turn on __has_feature(cxx_rvalue_references). The core rvalue
references proposal seems to be fully implemented now, pending lots
more testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124169 91177308-0d34-0410-b5e6-96231b3b80d8
xx-reference.cpp
f89e0424b8903438179f4a2f16dddd5e5bdc814e 23-Jan-2011 Anders Carlsson <andersca@mac.com> Get rid of the [[final]] C++0x attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124083 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
f6a3ab0f167f23d0669eae77280c7ff660e7ad98 22-Jan-2011 John McCall <rjmccall@apple.com> Improve our parse recovery on 'case blah;' and 'default;'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124025 91177308-0d34-0410-b5e6-96231b3b80d8
witch-recovery.cpp
c7119a871df4d2d79db3e48fc9d0ab421be54a3d 20-Jan-2011 Anders Carlsson <andersca@mac.com> Fix tests to be valid.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123887 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-override-control-keywords.cpp
37ea6c461897bcfc8865eb130cddd5c1853c3c22 20-Jan-2011 Anders Carlsson <andersca@mac.com> Add silly test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123880 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-override-control-keywords.cpp
aa031fd7cbba511404a26b733138e392d4f9f17a 20-Jan-2011 Anders Carlsson <andersca@mac.com> Add more parser tests for the override control keywords.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123875 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-override-control-keywords.cpp
9ea416e598fa3cb09d67d514c4519c99abb81321 19-Jan-2011 Douglas Gregor <dgregor@apple.com> Parse the optional semicolon after a C++ in-class member function
definition, rather than complaining about it. Problem reported by
Marshall Clow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123835 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
dbee3411a22b0dbb03267f5445f7b796104991bb 18-Jan-2011 Francois Pichet <pichet2000@gmail.com> Add support for explicit constructor calls in Microsoft mode.
For example:

class A{
public:
A& operator=(const A& that) {
if (this != &that) {
this->A::~A();
this->A::A(that); // <=== explicit constructor call.
}
return *this;
}
};

More work will be needed to support an explicit call to a template constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123735 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
1f3b6fdabbb10779a473d6315154d7325ce20aea 17-Jan-2011 Anders Carlsson <andersca@mac.com> Begin work on supporting "N3206: Override control: Eliminating Attributes", from

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm

This lands support for parsing virt-specifier-seq after member functions, including the
contextual keywords 'final', and 'override'. The keywords are not yet used for anything.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123606 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-override-control-keywords.cpp
bc61bd8109d9accf8f966b59e3f16a1497e72adf 11-Jan-2011 Douglas Gregor <dgregor@apple.com> When we're inside a functional cast, '>' is an operator. Fixes PR8912.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123201 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-argument.cpp
e6bf90aec0044342ffccd13201b8a3a31a985a4b 05-Jan-2011 Douglas Gregor <dgregor@apple.com> Use Parser::ExpectAndConsume() uniformly to eat semicolons after
Objective-C declarations and statements. Fixes
<rdar://problem/8814576> (wrong source line for diagnostics about
missing ';'), and now we actually consume the ';' at the end of a
@compatibility_alias directive!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122855 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-syntax.m
bjc-quirks.m
6915c529dbb43073dad148c2e83a1c56bfcc05c8 27-Dec-2010 Francois Pichet <pichet2000@gmail.com> More __uuidof validation:
1. Do not validate for uuid attribute if the type is template dependent.
2. Search every class declaration and definition for the uuid attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122578 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
662a4822ee7c8696434b054303c5076a606ab175 23-Dec-2010 Douglas Gregor <dgregor@apple.com> Improve the diagnostic and recovery for missing colons after 'case'
and 'default' statements, including a Fix-It to add the colon:

test/Parser/switch-recovery.cpp:13:12: error: expected ':' after 'case'
case 17 // expected-error{{expected ':' after 'case'}}
^
:
test/Parser/switch-recovery.cpp:16:12: error: expected ':' after 'default'
default // expected-error{{expected ':' after 'default'}}
^
:



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122522 91177308-0d34-0410-b5e6-96231b3b80d8
witch-recovery.cpp
913b7bf8c40454641588611b7bbad981dc53c882 20-Dec-2010 Francois Pichet <pichet2000@gmail.com> Emit an error if operator __uuidof() is called on a type with no associated GUID.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122226 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
icrosoftExtensions.cpp
d3d3be9bc717b37366324e9711f1ea22dea42caa 20-Dec-2010 Francois Pichet <pichet2000@gmail.com> Validate Microsoft's uuid attribute string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122220 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
ecea19f00a911c50dc20fe94e548f488ded47adb 17-Dec-2010 Francois Pichet <pichet2000@gmail.com> Microsoft's __uuidof operator returns a lvalue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122021 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
46f936e055d763437accd1e5a1bc49e7e5dbc0a3 19-Nov-2010 Douglas Gregor <dgregor@apple.com> When parsing something that looks like an ill-formed
protocol-qualifier list without a leading type (e.g., <#blah#>), don't
complain about it being an archaic protocol-qualifier list unless it
actually parses as one.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119805 91177308-0d34-0410-b5e6-96231b3b80d8
laceholder-recovery.m
aa4fe05939ffbfd746b8f0065cc0b5e06ea94fe2 18-Nov-2010 Anton Yartsev <anton.yartsev@gmail.com> comparison of AltiVec vectors now gives bool result (fix for 7533)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119678 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
xx-altivec.cpp
4383e18fc3d79fd536c6992432e180a11bcb657d 16-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Emit a specific diagnostic when typedefing C++ bool, mirroring gcc.
Fixes rdar://8365458

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119359 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
df81c2c6ce37f4ae3c45dd01093b6274fa0b6692 09-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Issues good diagnostic when @end is missing.
// rdar://8283484


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118629 91177308-0d34-0410-b5e6-96231b3b80d8
issing-end-3.m
729ad83035f4e62eaec403fbdc7c1c843fa30f59 09-Nov-2010 Chris Lattner <sabre@nondot.org> fix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange being constructed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118625 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
46d545e355a4fea2a201652c3c8bbf22a13187a6 02-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Diagnose a coherant message when @interface
does not terminate with @end.
// rdar: //7824372


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117991 91177308-0d34-0410-b5e6-96231b3b80d8
issing-end-2.m
b9eb35ced8369c8c8479efc17712faaf34e16c56 15-Oct-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Treat __extension__ like ParenExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116569 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.c
99ea7343ce6d23157427a59eaf969596e8ed609f 15-Oct-2010 Douglas Gregor <dgregor@apple.com> When we are missing the ',' or '>' to terminate a template parameter
list, complain about it! Fixes PR7053.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116551 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
141ecfeeb54948159facce6aeb586e2f6c406f78 12-Oct-2010 Nick Lewycky <nicholas@mxc.ca> Replace \r\n with \n in this file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116312 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
334d47e92e9f241576fdeb7477b69a03136ba854 11-Oct-2010 Francois Pichet <pichet2000@gmail.com> Add parsing support for Microsoft attributes. MS attributes will just be skipped and not inserted into the AST for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116203 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
icrosoftExtensions.cpp
b2419466892e5445fec6ce30f97784ae8b99f134 11-Oct-2010 Francois Pichet <pichet2000@gmail.com> Add 2 Microsoft compiler intrinsics that don't require prototypes:
__assume
__noop

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116202 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
229ca4a04cd1f94ca5ce907638c699fd024a6347 06-Oct-2010 Francois Pichet <pichet2000@gmail.com> _inline is an alias for inline in MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115785 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
6229c8e7ecccbc6b661df0b4399eb205587c61b4 29-Sep-2010 Chris Lattner <sabre@nondot.org> enhance tentative parsing to handle ms extensions, patch by Martin Vejnar!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115004 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
1b2ad2fd9e2d5352144481aa1fd995d333d9adc9 20-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r114316, -Wunused-value enabled by default was intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114318 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.m
bjc-messaging-1.m
bjc-try-catch-1.m
6dff2288a8054bdbc97217568e5831bcce809db8 19-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make -Wunused-value off by default, matching GCC. Fixes rdar://7126194.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114316 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.m
bjc-messaging-1.m
bjc-try-catch-1.m
2f474ea9ef7505df5d092287c48c19974222293b 18-Sep-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Added '|' delimiter to separate inline asm multiple alternative constraints for Clang side of support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114253 91177308-0d34-0410-b5e6-96231b3b80d8
sm-constraints-pr7869.c
01add59bc8fd178960ad61169bc01566b0d6614c 18-Sep-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Add more error checking to attribute vecreturn

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114251 91177308-0d34-0410-b5e6-96231b3b80d8
xx-altivec.cpp
01b7c3028da5bbcb9f8e52ba67e4613070de0e60 08-Sep-2010 Francois Pichet <pichet2000@gmail.com> Microsoft's __uuidof operator implementation part 1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113356 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
837b1a37116cf4e64f8bb7db34982dee1fba7647 07-Sep-2010 John McCall <rjmccall@apple.com> Improve error recovery when we see ':' and expect a ';'.
I, at least, make this typo all the time.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113243 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-interfaces.m
ecovery.c
6cf750298d3621d8a10a6dd07fcee8e274b9d94d 30-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Revert my user-defined literal commits - r1124{58,60,67} pending
some issues being sorted out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112493 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-literal-operators.cpp
e425368eb59687b66620a2c6adc3e426c997d796 30-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Fix some test-breaking that snuck into my previous commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112460 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-literal-operators.cpp
0016d519b831859526b79405cdae4c64c73731c8 29-Aug-2010 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement C++0x user-defined string literals.

The extra data stored on user-defined literal Tokens is stored in extra
allocated memory, which is managed by the PreprocessorLexer because there isn't
a better place to put it that makes sure it gets deallocated, but only after
it's used up. My testing has shown no significant slowdown as a result, but
independent testing would be appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112458 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-literal-operators.cpp
cebc3769077bb22003dc47bd22868d0b4c6ce106 26-Aug-2010 John McCall <rjmccall@apple.com> ...I forgot to check my new test after adding it, and lo, there's slightly different
behavior in C than in C++ (which is what the original test case was).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112199 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
9e46b8cfb3e6c6feab5664744f52f06a40f9566b 26-Aug-2010 John McCall <rjmccall@apple.com> Make sure we clear TypeSpecOwned when setting TypeSpecType to something when
it might previously have been a tag TST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112196 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
124300e428d4e987430e5e79c42f4a760e60d8d3 25-Aug-2010 John McCall <rjmccall@apple.com> Preserve invalidity of typeof operands in C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111999 91177308-0d34-0410-b5e6-96231b3b80d8
xx-typeof.cpp
d6577428627bd4b7f8cd87e213151ebe6a587a9f 16-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a crash when parsing malformed out-of-line member function
definition. radar 8307865.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111163 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
6f158034915a112d6082a6b238a56337d1528328 11-Aug-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Fix for pr7869, inline asm mult-alt constraints.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110764 91177308-0d34-0410-b5e6-96231b3b80d8
sm-constraints-pr7869.c
35cc9627340b15232139b3c43fcde5973e7fad30 09-Aug-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Added vecreturn attribute parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110609 91177308-0d34-0410-b5e6-96231b3b80d8
xx-altivec.cpp
219cffcad343aef5939ca34d5abb59fbc7da1c36 09-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change warning about incomplete parsing of C++ default arg to error and provide a test case; thanks Doug!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110603 91177308-0d34-0410-b5e6-96231b3b80d8
xx-default-args.cpp
2b602adf9798eaf13850efaf8ed41c69d3cf7da6 06-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce a new token kind 'cxx_defaultarg_end' to mark the end of C++ default arguments that were part of
lexed method declarations.

This avoid interference with tokens coming after the point where the default arg tokens were 'injected', e.g. for

typedef struct Inst {
void m(int x=0);
} *InstPtr;

when parsing '0' the next token would be '*' and things would be messed up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110436 91177308-0d34-0410-b5e6-96231b3b80d8
xx-default-args.cpp
b1d397c23e1f8fd8b404d5731d531e7500f7140d 05-Aug-2010 John McCall <rjmccall@apple.com> Allow multiple __declspec attributes after a class-key.
Patch by Francois Pichet!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110344 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
62e22ee7a17bbba427367ec2f9c8c4f60d778ac5 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Tests for #pragma GCC visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110316 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-visibility.c
b15be0d10216abdc83c48cc60bcb3e2a73a962cd 05-Aug-2010 Chandler Carruth <chandlerc@gmail.com> Convert this file to not have Windows line endings -- likely committed from
Windows without svn:eol-style=native.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110308 91177308-0d34-0410-b5e6-96231b3b80d8
xx-attributes.cpp
cbb98edd530787c2ac019e437e7c599df8004ba7 31-Jul-2010 Daniel Dunbar <daniel@zuster.org> Parser: Add support for #pragma align, which is just another spelling of #pragma
options align.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109952 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-options.c
2a3a1bd20e62205260eb2ba3f91a2b6b2db3ffb8 28-Jul-2010 Douglas Gregor <dgregor@apple.com> The grammar for GNU typeof in C requires an expression to be
parenthesized, unlike in C++, e.g.,

C has: typeof ( expression)
C++ has: typeof unary-expression

So, once we've parsed a parenthesized expression after typeof, we
should only go on to parse the postfix expression suffix if we're in
C++. Fixes <rdar://problem/8237491>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109606 91177308-0d34-0410-b5e6-96231b3b80d8
ypeof.c
87c300738174924453648c3b2d6f366c8284fac4 26-Jul-2010 Douglas Gregor <dgregor@apple.com> Eliminate the "minimal" and printing parser actions, which only ever
worked for C anyway. Also kills the -cc1 options -parse-noop and
-parse-print-callbacks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109392 91177308-0d34-0410-b5e6-96231b3b80d8
008-10-31-parse-noop-failure.c
lock-block-storageclass.c
lock-pointer-decl.c
xx-condition.cpp
xx-namespace-alias.cpp
xpressions.c
xpressions.m
ethod-prototype-1.m
bjc-messaging-1.m
elector-1.m
ypes.c
102e1b6a4753b0bd3662ad1bd119f6efa04b8763 22-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Fix PR7673 by allowing an empty clobbers section in an ASM statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109087 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
a0ebd60bfda56c161a87adb01f1b9a1d0e7ae32f 16-Jul-2010 Douglas Gregor <dgregor@apple.com> Revert Microsoft-specific override of the "typedef requires a name"
diagnostic. Instead, put it and the "declaration does not declare
anything" warning into -Wmissing-declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108527 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
0c99ec6d229b49085ec3c364d5c6090b33438a93 16-Jul-2010 Douglas Gregor <dgregor@apple.com> Suppress the "typedef requires a name" warning in Microsoft-extensions mode

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108526 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
06b7080b04ba799379469c03471558e4222921ce 15-Jul-2010 Douglas Gregor <dgregor@apple.com> When we're performing tentative parsing to determine whether the
parser is looking at a declaration or an expression, use a '=' to
conclude that we are parsing a declaration.

This is wrong. However, our previous approach of finding a comma after
the '=' is also wrong, because the ',' could be part of a
template-argument-list. So, for now we're going to use the same wrong
heuristic as GCC and Visual C++, because less real-world code is
likely to be broken this way. I've opened PR7655 to keep track of our
wrongness; note also the XFAIL'd test.

Fixes <rdar://problem/8193163>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108459 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ambig-decl-expr-xfail.cpp
xx-ambig-decl-expr.cpp
a131d0fc0af9f79c90e7654231041b2495d355a9 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Complain when an unnamed enumeration has no enumerations (in
C++). Fixes PR7466.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108231 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
63dae6e5ad23cab32f5e556c1b0dc3e4576edc83 12-Jul-2010 Chris Lattner <sabre@nondot.org> we do in fact have to cache the EOF token returned by the preprocessor.
In the case of backtracking, the cached token lexer will be the only
lexer on the stack, without this the token stack will be empty and EOF
won't be returned.

This fixes PR7072.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108124 91177308-0d34-0410-b5e6-96231b3b80d8
acktrack-crash.cpp
9fc1873a3da0af8ef91e4f1927f3540f9af2038f 12-Jul-2010 Chris Lattner <sabre@nondot.org> revert a hunk of code that Argiris added in r106213, which is the
root cause of PR7481 and probably more, and has no apparent
testcases. I don't understand the logic here so I can't repair it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108119 91177308-0d34-0410-b5e6-96231b3b80d8
racket-crash.cpp
9b3215d5aba6c687a3ee46b0f36367f416ac34cc 12-Jul-2010 Chris Lattner <sabre@nondot.org> change the 'invalid token after top level declarator' message to be
'expected ';' after top level declarator' which is much less vague.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108106 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
004659a56916f2f81ede507c12516c146d6c0df3 12-Jul-2010 Chris Lattner <sabre@nondot.org> Fix PR7617 by not entering ParseFunctionDefinition when
a function prototype is followed by a declarator if we
aren't parsing a K&R style identifier list.

Also, avoid skipping randomly after a declaration if a
semicolon is missing. Before we'd get:

t.c:3:1: error: expected function body after function declarator
void bar();
^

Now we get:

t.c:1:11: error: invalid token after top level declarator
void foo()
^
;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108105 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
8bb59a828ef21d0b2ed2b0efab60e4eddcb81c62 01-Jul-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Fix vector literal/cast confusion - bug 6895.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107347 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
xx-altivec.cpp
25973455aed1cdc9c40b208c792b5db4f8f1297d 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix rdar://8139785 "implement warning on dead expression in comma operator"

As a bonus, fix the warning for || and && operators; it was emitted even if one of the operands had side effects, e.g:

x || test_logical_foo1();

emitted a bogus "expression result unused" for 'x'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107274 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
788b0fd67e1992f23555454efcdb16a19dfefac3 23-Jun-2010 Chris Lattner <sabre@nondot.org> improve altivec vector bool/pixel support, patch by Anton Yartsev
with several tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106619 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
xx-altivec.cpp
661c36b057d07c76c16fee95c01d96f3956265be 22-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix PR7180.

For

void f( a::b::c );

we would cache the tokens "a::b::" but then we would try to annotate them using the range "a::".
Before annotating them with the (invalid) C++ scope spec, set it to the range of "a::b::".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106536 91177308-0d34-0410-b5e6-96231b3b80d8
xx-undeclared-identifier.cpp
e6563256a4b3b9fee70ce3335d28406607c1faaf 13-Jun-2010 Chris Lattner <sabre@nondot.org> Allow an asm label specifier on C++ methods, like GCC does.
Patch by David Majnemer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105909 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
5ee3734c0b5222a7c445591a1f14102c1b3a289b 31-May-2010 Douglas Gregor <dgregor@apple.com> Don't try to parse class template specializations in C. It can only
lead to heartache. Fixes <rdar://problem/8044088>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105178 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
450f79340808e54cd4b39738f943217f6fc0c2be 28-May-2010 Daniel Dunbar <daniel@zuster.org> Sema: Just ignore '#pragma options align=power' for now, this is no worse than
what we used to be doing, and makes sure that paired '#pragma options
align=reset' won't fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104998 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-options.c
c6082fe347a414a2e19f2ad8fe41720f10733296 27-May-2010 Daniel Dunbar <daniel@zuster.org> Sema: Add initial support for '#pragma options align=mac68k'.
- Docs are fairly sketchy, if someone wants to pore through gcc to look for
holes I'd appreciate any failing test cases!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104809 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-options.c
613fd67e575ff1c038535b18dafebca070f3ed91 27-May-2010 Daniel Dunbar <daniel@zuster.org> Sema: Reject '#pragma options align=mac68k' everywhere except i386-apple-darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104789 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-options.c
ea75a8286fb87ce7549e08d9dcb597f91479f54d 27-May-2010 Daniel Dunbar <daniel@zuster.org> Sema: Support for #pragma options align={reset,natural}. '#pragma options align'
shares the stack with '#pragma pack', who knew!?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104786 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-options.c
4186ff4fc4102f63b7485c2bf89155d3b0899d32 21-May-2010 Douglas Gregor <dgregor@apple.com> Improve parser recovery when a switch condition is invalid; fixes
<rdar://problem/7971948>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104291 91177308-0d34-0410-b5e6-96231b3b80d8
witch-recovery.cpp
4fb20533baff585c27531fe90c9bf7b004e07bb7 14-May-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to fix a crash on incomplete class declaration.
Radar 7923673.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103812 91177308-0d34-0410-b5e6-96231b3b80d8
xx-undeclared-identifier.cpp
9a65b8110595b10f7017173db3d69b3371c8e685 14-May-2010 Chris Lattner <sabre@nondot.org> Improve error recovery in C/ObjC when the first argument of a function
declarator is incorrect. Not being a typename causes the parser to
dive down into the K&R identifier list handling stuff, which is almost
never the right thing to do.

Before:

r.c:3:17: error: expected ')'
void bar(intptr y);
^
r.c:3:9: note: to match this '('
void bar(intptr y);
^
r.c:3:10: error: a parameter list without types is only allowed in a function definition
void bar(intptr y);
^

After:

r.c:3:10: error: unknown type name 'intptr'; did you mean 'intptr_t'?
void bar(intptr y);
^~~~~~
intptr_t
r.c:1:13: note: 'intptr_t' declared here
typedef int intptr_t;
^

This fixes rdar://7980651 - poor recovery for bad type in the first arg of a C function



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103783 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.c
95f1b15ce1b281c8517d77792abe540753fbcc12 14-May-2010 Douglas Gregor <dgregor@apple.com> Namespaces can only be defined at global or namespace scope. Fixes PR6596.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103767 91177308-0d34-0410-b5e6-96231b3b80d8
amespaces.cpp
51e2a5d45d321c53355fe038b3a3e7a2f502afa4 30-Apr-2010 John McCall <rjmccall@apple.com> Fix a tentative-parse error with unqualified template ids in cast expressions.
Also resolve a long-working FIXME in the test case I modified.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102688 91177308-0d34-0410-b5e6-96231b3b80d8
xx-casting.cpp
5512ba538f3f6b0576623f680fa7d930fa085ccd 26-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Cleanup error recovery for a missing '-'|'+'
on a method declaration (radar 7822196).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102383 91177308-0d34-0410-b5e6-96231b3b80d8
heck-syntax-1.m
6aa14d832704ae176c92d4e0f22dfb3f3d83a70a 22-Apr-2010 Douglas Gregor <dgregor@apple.com> Implement parsing for message sends in Objective-C++. Message sends in
Objective-C++ have a more complex grammar than in Objective-C
(surprise!), because

(1) The receiver of an instance message can be a qualified name such
as ::I or identity<I>::type.
(2) Expressions in C++ can start with a type.

The receiver grammar isn't actually ambiguous; it just takes a bit of
work to parse past the type before deciding whether we have a type or
expression. We do this in two places within the grammar: once for
message sends and once when we're determining whether a []'d clause in
an initializer list is a message send or a C99 designated initializer.

This implementation of Objective-C++ message sends contains one known
extension beyond GCC's implementation, which is to permit a
typename-specifier as the receiver type for a class message, e.g.,

[typename compute_receiver_type<T>::type method];

Note that the same effect can be achieved in GCC by way of a typedef,
e.g.,

typedef typename computed_receiver_type<T>::type Computed;
[Computed method];

so this is merely a convenience.

Note also that message sends still cannot involve dependent types or
values.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102031 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
e12a779bbecb46b7287a87e0ff441e32147d10bb 20-Apr-2010 Chris Lattner <sabre@nondot.org> reapply john's patch, he broke mainline again by changing the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101871 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
xx-altivec.cpp
56f3cc6a5ffff81f20d89796b9fbd6710aede8c3 20-Apr-2010 Chris Lattner <sabre@nondot.org> revert r101863, whcih is causing Sema/altivec-init.c to fail on a ton
of buildbots with:

error: 'error' diagnostics expected but not seen:
Line 9: too few elements in vector initialization (expected 8 elements, have 2)
1 warning and 1 error generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101864 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
xx-altivec.cpp
820cbbb668ff6a38a8724dbe6f20242e14f1900a 20-Apr-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Altivec vector literal initializer count mismatch error removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101863 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
xx-altivec.cpp
ab866b46f3f626ac2da42d2b16ec3b5c04105e38 14-Apr-2010 Chris Lattner <sabre@nondot.org> improve altivec c++ support by adding casts, patch by
Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101281 91177308-0d34-0410-b5e6-96231b3b80d8
xx-altivec.cpp
dd17394d225b06376e9ae1d23f36cec463fdef01 14-Apr-2010 Chris Lattner <sabre@nondot.org> implement altivec.h and a bunch of support code, patch by Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101215 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
xx-altivec.cpp
e8551e4abd314053b45f10f22fa69fb6f8e8b449 12-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6287 by accepting and ignoring the returns_twice attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101005 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.c
eb483eb3ee80300f15d6d13573d82493c2194461 11-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6811 by not parsing 'super' as a magic expression in
LookupInObjCMethod. Doing so allows all sorts of invalid code
to slip through to codegen. This patch does not change the
AST representation of super, though that would now be a natural
thing to do since it can only be in the receiver position and
in the base of a ObjCPropertyRefExpr.

There are still several ugly areas handling super in the parser,
but this is definitely a step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100959 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-quirks.m
d4eea8362605807327735727a9098abe1eb23b19 09-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostics when we fail to convert from a source type to a
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as

t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
expected 'char *' [-pedantic]
char *name = __func__;
^ ~~~~~~~~

We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:

t.c:2:9: warning: initializing 'char *' from an expression of type
'char const [2]' discards qualifiers [-pedantic]
char *name = __func__;
^ ~~~~~~~~

Fixes <rdar://problem/7447179>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100832 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
uiltin_types_compatible.c
xx-altivec.cpp
eclarators.c
mplicit-casts.c
cb821d045f5e445384f34d05a526955036073c4a 08-Apr-2010 Douglas Gregor <dgregor@apple.com> Downgrade the "declaration does not declare anything" error to a
warning. It's not harmful to have such pointless declarations, and GCC
does not diagnose this issue consistently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100814 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
xx-template-decl.cpp
06245bfb3ae40bb24a8bfb17eafeb266a4daf5ca 07-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve handling of friend types in several ways:
- When instantiating a friend type template, perform semantic
analysis on the resulting type.
- Downgrade the errors concerning friend type declarations that do
not refer to classes to ExtWarns in C++98/03. C++0x allows
practically any type to be befriended, and ignores the friend
declaration if the type is not a class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100635 91177308-0d34-0410-b5e6-96231b3b80d8
xx-friend.cpp
e9f5581ad479e2c53703d5799828399249a4be65 07-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Improve on diagnostics when an objc class is used as
a stand-alone type declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100588 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
5c5db553b5c256d0a6f55dde7325c1c829b88e8e 05-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6782, an accept invalid. We weren't emitting the diagnostic
returned by SetTypeSpecType.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100443 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
05511fa6349ef0820a778f8c840d0b64e05e9aee 03-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Improve diagnosing when a method type does not start with '-'|'+'
when parsing. Fixes radar 7822196.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100248 91177308-0d34-0410-b5e6-96231b3b80d8
heck-syntax-1.m
809872eca7f6c024e2ab41ddffbbeeae807bf5dc 31-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Issue better syntax error when objc's messaging
ares are not separated by ':' (radar 7030268).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100040 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-messaging-neg-1.m
b57c757a80532a610d949c2eeb9d9e05c76f543f 31-Mar-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't skip past the '}' if an expression has error and is not followed by ';'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99972 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
7fd3a6456a88cdd225b92ae1606144f24c7f51d4 31-Mar-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When "delayed parsing" C++ default arguments, if there is an error, there may be tokens left in the token stream
that will interfere (they will be parsed as if they are after the class' '}') and a crash will occur because
the CachedTokens that holds them will be deleted while the lexer is still using them.

Make sure that the tokens of default args are removed from the token stream.
Fixes PR6647.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99939 91177308-0d34-0410-b5e6-96231b3b80d8
xx-default-args.cpp
c3d43b783dfb1a1502aa8b31ab1985cf237b1f77 16-Mar-2010 Douglas Gregor <dgregor@apple.com> Don't consume tokens past the end-of-file in an @interface. Fixes
<rdar://problem/7735566>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98613 91177308-0d34-0410-b5e6-96231b3b80d8
issing-end.m
ffaf4c5eb68718841399fc4396f6d53fedad24e2 07-Mar-2010 Chris Lattner <sabre@nondot.org> implement support for -Wno-deprecated, PR6534. While
I'm in there, change the altivec diagnostics to use 'double'
instead of "double" for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97919 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
xx-altivec.cpp
2e0a715595a21adeb7172995df59317741301aa3 01-Mar-2010 John McCall <rjmccall@apple.com> Don't infinite-loop if TryAnnotateCXXScopeToken fails to annotate but doesn't
signal an error. This can happen even when the current token is '::' if
this is a ::new or ::delete expression.

This was an oversight in my recent parser refactor; fixes PR 5825.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97462 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
9ba6166f4a78722e7df8ffbd64eb788bfdf2764a 26-Feb-2010 John McCall <rjmccall@apple.com> Fix an assertion-on-error during tentative constructor parsing by
propagating error conditions out of the various annotate-me-a-snowflake
routines. Generally (but not universally) removes redundant diagnostics
as well as, you know, not crashing on bad code. On the other hand,
I have just signed myself up to fix fiddly parser errors for the next
week. Again.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97221 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-argument.cpp
33efe2f088ae40b5129fe4ab021912e80129e155 23-Feb-2010 Richard Pennington <rich@pennware.com> Retain attributes for K&R style parameter declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96941 91177308-0d34-0410-b5e6-96231b3b80d8
nr_parameter_attributes.c
f0122fe49329cb439d55a6712bfcaad9a6570428 16-Feb-2010 Charles Davis <cdavis@mines.edu> dllimport and dllexport are declspec attributes, too. They're also
Win32-specific.

Also, fix a test to use FileCheck instead of grepping LLVM IR.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96364 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
e0097db2848c463a534c18c235c6d3e53f2f1b87 15-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Issue a bettter diagnostics for incorrect property setter name.
(radar 7647953).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96284 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-syntax.m
23e907ab9119ccfdff17b3808a770c5a6707fb95 14-Feb-2010 John McCall <rjmccall@apple.com> Improve the diagnostic given when referring to a tag type without a tag (in C)
or that's been hidden by a non-type (in C++).

The ideal C++ diagnostic here would note the hiding declaration, but this
is a good start.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96141 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
1df0ee91a9d55b5c2eb0d96e7590f1c8b8fe8734 05-Feb-2010 Douglas Gregor <dgregor@apple.com> Teach C++ name lookup that it's okay to look in a scope without a
context. This happens fairly rarely (which is why we got away with
this bug). Fixes PR6184, where we skipped over the template parameter
scope while tentatively parsing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95376 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
82287d19ded35248c4ce6a425ce74116a13ce44e 05-Feb-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> First stage of adding AltiVec support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95335 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec.c
xx-altivec.cpp
c2e1c1af8ffe750b827284f207b9207112c7cc4e 03-Feb-2010 Chris Lattner <sabre@nondot.org> Declarators can have grouping parens. This fixes rdar://7608537.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95246 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
16acfee729e00536af827935ccfcf69be721e462 03-Feb-2010 Chris Lattner <sabre@nondot.org> fix PR6216


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95185 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
99c952046600f6bfccf315aa7ad5b1be2d242cc3 02-Feb-2010 Chris Lattner <sabre@nondot.org> the declspec of a declaration can have storage-class specifiers,
type qualifiers and type specifiers in any order. For example,
this is valid: struct x {...} typedef y;

This fixes PR6208.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95094 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
ae50d501f463d7032320ec31840f60ae68df3a55 02-Feb-2010 Chris Lattner <sabre@nondot.org> improve diagnostics for C++ struct ; issues. Before:

t.cc:4:3: error: expected ';' at end of declaration list
int y;
^
t.cc:6:1: error: expected ';' at end of declaration list
};
^

After:

t.cc:3:8: error: expected ';' at end of declaration list
int x
^
;
t.cc:5:8: error: expected ';' at end of declaration list
int z
^
;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95039 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
3e156ad9adc7332e626eedbc86aa4e3b03f17ca5 02-Feb-2010 Chris Lattner <sabre@nondot.org> improve diagnostics on missing ; in a struct. Before:

t.c:4:3: error: expected ';' at end of declaration list
int y;
^
t.c:4:8: warning: extra ';' inside a struct or union
int y;
^
t.c:6:1: warning: expected ';' at end of declaration list
};
^

After:

t.c:3:8: error: expected ';' at end of declaration list
int x // expected-error {{expected ';' at end of declaration list}}
^
;
t.c:5:8: warning: expected ';' at end of declaration list
int z
^
;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95038 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
46171917dc87caf0c7a741a7301f36db2e20b132 23-Jan-2010 Mike Stump <mrs@apple.com> Insulate these from changes to the default for -Wunreachable-code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94326 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
a6c058dd75c5563cced821fc16766a7cc179e00c 13-Jan-2010 Sean Hunt <rideau3@gmail.com> Implement semantic checking for C++ literal operators.
This now rejects literal operators that don't meet the requirements.
Templates are not yet checked for.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93315 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-literal-operators.cpp
64a4eb277f70be8b50f33f25918747bcf51ef24c 27-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Make sure to give an error for template argument lists followed by junk.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92177 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-argument.cpp
6633522aaea663ebb18044a997b963bf92cd1a74 23-Dec-2009 Chris Lattner <sabre@nondot.org> fix the microsoft "charify" extension to return the charified token
as a character literal, not a string literal. This might fix
rdar://7486575


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92025 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
6405646cb649e4b4c6768b92d1fc83c175722f62 21-Dec-2009 Chris Lattner <sabre@nondot.org> fix PR5500: clang fails to parse inline asm with :: in C++ mode


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91802 91177308-0d34-0410-b5e6-96231b3b80d8
xx-stmt.cpp
ae03cb5a84d13c7a0d4b21865bd63aabd18120d2 19-Dec-2009 John McCall <rjmccall@apple.com> Teach TryAnnotateTypeOrScopeToken to deal with already-annotated
scope specifiers. Fix a tentative parsing bug that came up in LLVM.
Incidentally fixes some random FIXMEs in an existing testcase.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91734 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ambig-paren-expr.cpp
a5728872c7702ddd09537c95bc3cbd20e1f2fb09 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
008-10-31-parse-noop-failure.c
ompoundStmtScope.c
icrosoftExtensions.c
rgument_qualified.c
rgument_redef.c
rgument_scope.c
sm.c
ttributes.c
ad-control.c
lock-block-storageclass.c
lock-pointer-decl.c
uiltin_classify_type.c
uiltin_types_compatible.c
-namespace.c
har-literal-printing.c
heck-objc2-syntax-1.m
heck-syntax-1.m
heck_cast.c
ompound_literal.c
ontrol-scope.c
xx-ambig-paren-expr.cpp
xx-attributes.cpp
xx-bool.cpp
xx-casting.cpp
xx-class.cpp
xx-condition.cpp
xx-decl.cpp
xx-exception-spec.cpp
xx-extern-c-array.cpp
xx-friend.cpp
xx-member-initializers.cpp
xx-namespace-alias.cpp
xx-reference.cpp
xx-stmt.cpp
xx-template-decl.cpp
xx-throw.cpp
xx-typeid.cpp
xx-typeof.cpp
xx-using-declaration.cpp
xx-using-directive.cpp
xx-variadic-func.cpp
xx0x-attributes.cpp
xx0x-literal-operators.cpp
xx0x-rvalue-reference.cpp
eclarators.c
esignator.c
ncode.m
nhanced-proto-1.m
xpressions.c
xpressions.m
xtension.c
unction-decls.c
oto-ident.c
f-scope-c90.c
f-scope-c99.c
mplicit-casts.c
ethod-prototype-1.m
amelookup-bug-1.c
amelookup-bug-2.c
amespace-alias-attr.cpp
bjc-alias-printing.m
bjc-category-neg-1.m
bjc-forcollection-1.m
bjc-forcollection-neg-2.m
bjc-forcollection-neg.m
bjc-foreach-syntax.m
bjc-init.m
bjc-interfaces.m
bjc-messaging-1.m
bjc-messaging-neg-1.m
bjc-missing-impl.m
bjc-property-syntax.m
bjc-quirks.m
bjc-synthesized-recover.m
bjc-try-catch-1.m
bjc-type-printing.m
ffsetof.c
armvardecl_conversion.c
ointer-arithmetic.c
ointer_promotion.c
ragma-pack.c
ragma-weak.c
refix-attributes.m
romote_types_in_proto.c
ecovery.c
elector-1.m
tatements.c
truct-recursion.c
op-level-semi-cxx0x.cpp
raditional_arg_scope.c
ypeof.c
ypes.c
ca6180f06901dfedf2b8e4e115db2682078e22c0 14-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Make tests use the new clang cc1 flag.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91300 91177308-0d34-0410-b5e6-96231b3b80d8
heck-objc2-syntax-1.m
heck-syntax-1.m
ncode.m
nhanced-proto-1.m
xpressions.m
ethod-prototype-1.m
bjc-alias-printing.m
bjc-category-neg-1.m
bjc-forcollection-1.m
bjc-forcollection-neg-2.m
bjc-forcollection-neg.m
bjc-foreach-syntax.m
bjc-init.m
bjc-interfaces.m
bjc-messaging-1.m
bjc-messaging-neg-1.m
bjc-missing-impl.m
bjc-property-syntax.m
bjc-quirks.m
bjc-synthesized-recover.m
bjc-try-catch-1.m
bjc-type-printing.m
refix-attributes.m
elector-1.m
932dff777d58a23e3a26967a61bb52697c542fd4 10-Dec-2009 Chris Lattner <sabre@nondot.org> If we enter parens, colons can become un-sacred, allowing us to emit
a better diagnostic in the second example.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91040 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
a69d0ed3ab66e96393586664a103e9482ec59e6f 10-Dec-2009 Chris Lattner <sabre@nondot.org> fix a more evil case of : / :: confusion arising in ?:.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91039 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
a1efc8c8c6460d860d6509b05b341e77ed9bfe87 10-Dec-2009 Chris Lattner <sabre@nondot.org> fix incorrect parsing of bitfields pointed out by Doug. I chose
to use ColonProtectionRAIIObject in the C codepath even though it
won't matter for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91037 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
6fb09c8acc1336a9508cd6223d9fcf87cf31e476 10-Dec-2009 Chris Lattner <sabre@nondot.org> fix PR5740: a colon is sacred when parsing case statement expressions!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91016 91177308-0d34-0410-b5e6-96231b3b80d8
xx-stmt.cpp
3c46a66de812238ca3c32bccfe6c3326cf96819a 10-Dec-2009 Chris Lattner <sabre@nondot.org> rename testcase


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91015 91177308-0d34-0410-b5e6-96231b3b80d8
xx-stmt.cpp
xx-try.cpp
3acd9aaa4ddd14afecb4f1c02ca6f585a6d51849 09-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Fixes a bogus error when declaring an extern "C" array.
(fixes radar 7457109).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90986 91177308-0d34-0410-b5e6-96231b3b80d8
xx-extern-c-array.cpp
46646491834cd8faabb22482dfe93b24ce28a6c1 07-Dec-2009 Chris Lattner <sabre@nondot.org> reapply my patch for PR4451, which improves diagnostics for :: vs : confusion.
This time with a fix to bail out when in a dependent context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90730 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
bd87c0bd2358498eae71c6cb24e57d2c884c74aa 07-Dec-2009 Chris Lattner <sabre@nondot.org> fix a crash on invalid I found when working on something unrelated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90729 91177308-0d34-0410-b5e6-96231b3b80d8
xx-friend.cpp
1ade4ca0aa9331c2388cca9becad1357a154ae34 06-Dec-2009 Chris Lattner <sabre@nondot.org> revert my previous patch, it is breaking something and I don't have time
to fix it ATM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90717 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
a564b17dcc7daf298ffa72cde94630343bf9c31a 06-Dec-2009 Chris Lattner <sabre@nondot.org> implement PR4451, improving error recovery for a mistaken : where a :: was
intended. On the first testcase in the bug, we now produce:

cxx-decl.cpp:12:2: error: unexpected ':' in nested name specifier
y:a a2;
^
::

instead of:

t.cc:8:1: error: C++ requires a type specifier for all declarations
x:a a2;
^
t.cc:8:2: error: invalid token after top level declarator
x:a a2;
^
;
t.cc:9:11: error: use of undeclared identifier 'a2'
x::a a3 = a2;
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90713 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
701c89e02cde6e0fb9673cbe7c97eadc74b50358 03-Dec-2009 John McCall <rjmccall@apple.com> Honor using declarations in overload resolution. Most of the code for
overloaded-operator resolution is wildly untested, but the parallel code for
methods seems to satisfy some trivial tests.

Also change some overload-resolution APIs to take a type instead of an expression,
which lets us avoid creating a spurious CXXThisExpr when resolving implicit
member accesses.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90410 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-declaration.cpp
8a90ac0e85e8c5758b585fe486ee7db01c53fb98 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Normalize options to use '-FOO' instead of '--FOO'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90071 91177308-0d34-0410-b5e6-96231b3b80d8
f-scope-c90.c
f-scope-c99.c
682899db9ac82d3ecc9a0a45f51f81704b935005 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Use '-x' 'foo' instead of '-x=foo'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90069 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
a75a92dfffee2b34a43f1d0e9f8d1949feb190ad 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove unnecessary -fms-extensions=0 from tests (this command line syntax is going away).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90066 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
3e518bda00d710754ca077cf9be8dd821e16a854 29-Nov-2009 Sean Hunt <rideau3@gmail.com> Add DeclarationName support for C++0x operator literals. They should now work as
function names outside of templates - they'll probably cause some damage there as
they're largely untested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90064 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-literal-operators.cpp
e6252d1587f98dbac704178e7b2ce53116048310 28-Nov-2009 Sean Hunt <rideau3@gmail.com> Fix test and handle IK_LiteralOperatorId in a few more places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90030 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-literal-operators.cpp
0486d746019f8310589b1f0d92edcc4bb3916b33 28-Nov-2009 Sean Hunt <rideau3@gmail.com> Add Parser support for C++0x literal operators ('operator "" i').
DeclarationName can't handle them yet, so right now Parser just errors out on them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90027 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-literal-operators.cpp
1b2fc0f3e181d99fb34f60e711066fb11628ecd0 25-Nov-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Fix attribute between function decl ')' and '{' or '=0'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89894 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.c
xx-attributes.cpp
67f44b178bf117a252594535468ed1f42ab434c1 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Tweak expected error to match what should happen, once using declarations work

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89876 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-declaration.cpp
51ffb0c9d43b2d3fd210e51ecdd67ba5d1790d70 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Implement support for default template arguments of function templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89874 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
bbd37c62e34db3f5a95c899723484a76c71d7757 21-Nov-2009 Sean Hunt <rideau3@gmail.com> Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
- align() - semantics believed to be conformant to n3000, except for
redeclarations and what entities it may apply to
- final - semantics believed to be conformant to CWG issue 817's proposed
wording, except for redeclarations
- noreturn - semantics believed to be conformant to n3000, except for
redeclarations
- carries_dependency - currently ignored (this is an optimization hint)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89543 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-attributes.cpp
0da2adbd3a0cdb18305ebd492a817e985f74ead7 18-Nov-2009 Douglas Gregor <dgregor@apple.com> Test case for parsing-recovery change to @synthesized

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89260 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-synthesized-recover.m
05ebda9490e15f900edb2e5c690e067abcb37b2e 18-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> This patch fixes a bug in misdiagnosing correct
use of pointer to data member.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89251 91177308-0d34-0410-b5e6-96231b3b80d8
xx-parse-member-pointer-op.cpp
23afaad895486d4a9ea672f497b63ebc4c588955 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Don't #include <stdio.h> when tests don't need it, or use clang instead of clang-cc when they do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89070 91177308-0d34-0410-b5e6-96231b3b80d8
lock-block-storageclass.c
ba69b3c1050447db3c91a41ff25ce8cd29d9b021 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Fix broken tests, exposed by improved -verify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88749 91177308-0d34-0410-b5e6-96231b3b80d8
008-10-31-parse-noop-failure.c
2475d76920b43014e661690836642ca3c9967179 08-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove RUN: true lines.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86432 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-declaration.cpp
4fcfde4d5c8f25e40720972a5543d538a0dcb220 08-Nov-2009 Daniel Dunbar <daniel@zuster.org> Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
ontrol-scope.c
bjc-try-catch-1.m
8a389b630d8dce716c036b6e8bf7703726f75548 06-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Make fragile-abi test run happy.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86293 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
d3fdcb5a1bf6bd5e54e18579c054ea3c292a0e28 06-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a bogus objective-c warning with -pedantic.
(radar 7370882).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86291 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
45aa4557fe4210034e85f4a807ff637a9dd146d6 05-Nov-2009 John McCall <rjmccall@apple.com> Implement -Wsign-compare, or at least the actual comparison part of it.
Conditional operands are next.

Fixes part of rdar://problem/7289584.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86083 91177308-0d34-0410-b5e6-96231b3b80d8
f-scope-c90.c
f-scope-c99.c
2cc782f7932f1069d9fa8bb5c518165802aad68d 30-Oct-2009 Douglas Gregor <dgregor@apple.com> Improve diagnostics when parsing something like

template<> struct foo<int> { ... };

where "foo" does not refer to a template. Fixes PR3844.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85616 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
b3eca29e2b1f11d2daa06feb23e006f69be759c7 27-Oct-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Disabling some MS extensions which cause these tests to fail

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85236 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
f071e9b173dbaf97b00849c309a97c5aa3c49ae9 23-Oct-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose misuse of '.*' and '->*' operators during parse
instead of crashing in code gen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84968 91177308-0d34-0410-b5e6-96231b3b80d8
xx-parse-member-pointer-op.cpp
59cbea9df80273de959261401d30758ded025255 13-Oct-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> test commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83945 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-declaration.cpp
f6b1185f0a8a209c06dfc1efdb6a59cc851e970c 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Improve checking for specializations of member classes of class
templates, and keep track of how those member classes were
instantiated or specialized.

Make sure that we don't try to instantiate an explicitly-specialized
member class of a class template, when that explicit specialization
was a declaration rather than a definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83547 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
d85bea2affdd59d83d1be7d24b97f436484c3625 26-Sep-2009 Douglas Gregor <dgregor@apple.com> Rework the Parse-Sema interaction for friends to better support friend
class templates. We now treat friend class templates much more like
normal class templates, except that they still get special name lookup
rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in
<iostream>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82848 91177308-0d34-0410-b5e6-96231b3b80d8
xx-friend.cpp
d5a423b279e787e9fdd8309fe52cb515388c54ea 25-Sep-2009 Douglas Gregor <dgregor@apple.com> WIP implementation of explicit instantiation of function templates,
member functions of class template specializations, and static data
members. The mechanics are (mostly) present, but the semantic analysis
is very weak.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82789 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
9aa78d53bd407d0769130641e650343a5852cf40 13-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add RUN line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81654 91177308-0d34-0410-b5e6-96231b3b80d8
xx-member-initializers.cpp
8a1d229ac0c1d0860afcc5342c654b61ed0eed2d 12-Sep-2009 Anders Carlsson <andersca@mac.com> Add a test for PR3733.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81622 91177308-0d34-0410-b5e6-96231b3b80d8
xx-member-initializers.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
xx-friend.cpp
xx-template-decl.cpp
1bba242c85038a27865259ef8a50643e19b2079e 24-Aug-2009 Douglas Gregor <dgregor@apple.com> Improve top-level-semicolon test a bit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79913 91177308-0d34-0410-b5e6-96231b3b80d8
op-level-semi-cxx0x.cpp
a1d71aea847a50b3acbd187d2ae9e5c1ead0f4e2 24-Aug-2009 Douglas Gregor <dgregor@apple.com> Top-level semicolons are allowed in C++0x. Fixes PR4755.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79912 91177308-0d34-0410-b5e6-96231b3b80d8
op-level-semi-cxx0x.cpp
67d1a67f3db2f1aa69083c5c94164d6e0ee05b32 06-Aug-2009 John McCall <rjmccall@apple.com> First pass at friend semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78274 91177308-0d34-0410-b5e6-96231b3b80d8
xx-friend.cpp
4dabe96fc9c5333bbcb6e36114bca95160967e26 01-Aug-2009 Daniel Dunbar <daniel@zuster.org> Ok, ok, I give in. Fix tests for unused result warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77780 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
e25ff83fb7eee9eeda89b6f2371bc33a37bf1028 30-Jul-2009 Ryan Flynn <pizza@parseerror.com> PR3679 - handle #pragma weak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77573 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-weak.c
9cc11e70031365972424b43f439021d88096b146 25-Jul-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++ semantics for C-style and functional-style casts. This regresses Clang extension conversions, like vectors, but allows conversions via constructors and conversion operators.
Add custom conversions to static_cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77076 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ambig-paren-expr.cpp
9f9fbd66fa5fded23bb243142313633788cb2a8c 25-Jul-2009 Daniel Dunbar <daniel@zuster.org> Disable this test: cxx-using-declaration.cpp

Something strange is going on here; this test randomly started failing after
unrelated changes to TestRunner.py (even though it runs the same
script).

Argiris or Doug, can one of you investigate?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77063 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-declaration.cpp
527e5429989782aef5411a18bf01cc9b4170fde1 23-Jul-2009 Daniel Dunbar <daniel@zuster.org> Fix test case, which has a control-reaches-end-of-non-void warning that was
being masked by previous bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76858 91177308-0d34-0410-b5e6-96231b3b80d8
ointer_promotion.c
7cdbc5832084f45721693dfb1d93284c3e08efee 23-Jul-2009 Douglas Gregor <dgregor@apple.com> Implement support for out-of-line definitions of the class members of class
templates, e.g.,

template<typename T>
struct Outer {
struct Inner;
};

template<typename T>
struct Outer<T>::Inner {
// ...
};

Implementing this feature required some extensions to ActOnTag, which
now takes a set of template parameter lists, and is the precursor to
removing the ActOnClassTemplate function from the parser Action
interface. The reason for this approach is simple: the parser cannot
tell the difference between a class template definition and the
definition of a member of a class template; both have template
parameter lists, and semantic analysis determines what that template
parameter list means.

There is still some cleanup to do with ActOnTag and
ActOnClassTemplate. This commit provides the basic functionality we
need, however.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76820 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
dfe3f2d8ba49f03d01f42570e640d9a6755e6c08 22-Jul-2009 Douglas Gregor <dgregor@apple.com> Implement parsing and semantic analysis for out-of-line definitions of static
data members of class templates. We don't instantiate the definitions yet,
however.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76756 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
d1969d803cfcc65f1c334df4cc89c7fdd33ee4c9 22-Jul-2009 Mike Stump <mrs@apple.com> Prep for new warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76709 91177308-0d34-0410-b5e6-96231b3b80d8
ompoundStmtScope.c
icrosoftExtensions.c
rgument_redef.c
ad-control.c
eclarators.c
mplicit-casts.c
bjc-messaging-neg-1.m
ecovery.c
tatements.c
309fe0d8e696f61eaa4b1de9fb1cc49c4b5cda7f 27-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Fix the parser error hanlding for __builtin_offsetof to actually print
out an error for a malformed __builtin_offsetof.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74388 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
e53060fa78ad7e98352049f72787bdb7543e2a48 26-Jun-2009 Douglas Gregor <dgregor@apple.com> Improved semantic analysis and AST respresentation for function
templates.

For example, this now type-checks (but does not instantiate the body
of deref<int>):

template<typename T> T& deref(T* t) { return *t; }

void test(int *ip) {
int &ir = deref(ip);
}

Specific changes/additions:
* Template argument deduction from a call to a function template.
* Instantiation of a function template specializations (just the
declarations) from the template arguments deduced from a call.
* FunctionTemplateDecls are stored directly in declaration contexts
and found via name lookup (all forms), rather than finding the
FunctionDecl and then realizing it is a template. This is
responsible for most of the churn, since some of the core
declaration matching and lookup code assumes that all functions are
FunctionDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74213 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
3688fc679389d67b6755e62406998f9ea84d886a 24-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a clang crash caused by incorrect user code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74080 91177308-0d34-0410-b5e6-96231b3b80d8
heck-syntax-1.m
52591bf224b2c43e2b00e265bb8599a620081925 24-Jun-2009 Douglas Gregor <dgregor@apple.com> Make sure that the template parameter lists get from the parser down to ActOnFunctionDeclarator for function template definitions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74040 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
9cfbe48a7a20a217fdb2920b29b67ae7941cb116 20-Jun-2009 Douglas Gregor <dgregor@apple.com> Parsing and AST support for using declarations, from John Thompson!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73812 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-declaration.cpp
xx-using-directive.cpp
c19ee3eb08ce1d77504d5fc27f7c44b94543221b 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Diagnose class members that shadow a template parameter. Fixes
<rdar://problem/6952203>.

To do this, we actually remove a not-quite-correct optimization in the
C++ name lookup routines. We'll revisit this optimization for the
general case once more C++ is working.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73659 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
6a588dd230c14a364d222d6057bbcf11afbd9ffd 17-Jun-2009 Douglas Gregor <dgregor@apple.com> Diagnose the use of attributes on namespace aliases, from Anis Ahmad

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73626 91177308-0d34-0410-b5e6-96231b3b80d8
amespace-alias-attr.cpp
7b3684afffa2d5eda3dd6930f01faaa673686c16 14-Jun-2009 Chris Lattner <sabre@nondot.org> change ParseStatementOrDeclaration to emit the 'missing ;' with
ExpectAndConsume instead of custom diag logic. This gets us an
insertion hint and positions the ; at the end of the line
instead of on the next token. Before:

t.c:5:1: error: expected ';' after return statement
}
^

after:

t.c:4:11: error: expected ';' after return statement
return 4
^
;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73315 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
1dbe36ad5c916ddc51bfdae9831099bcd91ec64c 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Update test to work with the limited Sema for #pragma weak.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72914 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-weak.c
29b1d07a87a2038ae5b4128a0b534badd728707d 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Test for parsing #pragma weak.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72908 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-weak.c
7c94c4bb7b875dc1a2b23f77f1ed8013cf94abdb 03-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use "()" instead of "(void)" when pretty-printing a parameter-less function type for C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72747 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ambig-paren-expr.cpp
b53f08ac87f1e1f4bc2fbfa4560c2183a82020ee 25-May-2009 Eli Friedman <eli.friedman@gmail.com> PR4122: Tweak the ambiguity handling to handle (S())() correctly. I've
left out handling for stuff like (S())++ for the moment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72394 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ambig-paren-expr.cpp
f303e8a0b13a5059a0a8fb3de8609b2f45a40562 23-May-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a test case to make sure that an ambiguous paren expression is only parsed once.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72298 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ambig-paren-expr.cpp
f58f45e6d76792df8c643ce1c6d364dce5db4826 22-May-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Handle correctly a very ugly part of the C++ syntax. We cannot disambiguate between a parenthesized type-id and
a paren expression without considering the context past the parentheses.

Behold:
(T())x; - type-id
(T())*x; - type-id
(T())/x; - expression
(T()); - expression

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72260 91177308-0d34-0410-b5e6-96231b3b80d8
xx-ambig-paren-expr.cpp
6409625011e4a11ff07956ff46a44d6ca4473992 22-May-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Parse typeof-specifier the same way as sizeof/alignof are parsed.

-Makes typeof consistent with sizeof/alignof
-Fixes a bug when '>' is in a typeof expression, inside a template type param:
A<typeof(x>1)> a;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72255 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
ypeof.c
bc6c848f3e0ec2dc44f6e3d59ef85e884cc9b7be 17-May-2009 Eli Friedman <eli.friedman@gmail.com> Make the RAII extension warning silencing for __extension__ a bit
narrower, so it doesn't catch expresions that aren't sub-expressions of
__extension__ operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71967 91177308-0d34-0410-b5e6-96231b3b80d8
xtension.c
8d28663db18fb42d2b2cb5137c5b8cf247cd9e3b 16-May-2009 Mike Stump <mrs@apple.com> Fixup __extension__ i = 1 parsing. Thanks Eli!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71927 91177308-0d34-0410-b5e6-96231b3b80d8
xx-throw.cpp
6ce0c3981eb2f6000e440f7ea9ad8bb0cd148d0a 15-May-2009 Mike Stump <mrs@apple.com> Fixup parsing for (throw,throw) and __extension__ throw 1.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71897 91177308-0d34-0410-b5e6-96231b3b80d8
xx-throw.cpp
1426e534b4fca6a05b1120d634aae46be79ca17c 12-May-2009 Douglas Gregor <dgregor@apple.com> Refactor the parsing of declarations so that template declarations can
parse just a single declaration and provide a reasonable diagnostic
when the "only one declarator per template declaration" rule is
violated. This eliminates some ugly, ugly hackery where we used to
require thatn the layout of a DeclGroup of a single element be the
same as the layout of a single declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71596 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
5dc2af12bdb8c71c01556f7d5780c5ef94af0306 12-May-2009 Anders Carlsson <andersca@mac.com> For friend class decls, always use TK_Reference so we'll try to look up existing class decls first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71481 91177308-0d34-0410-b5e6-96231b3b80d8
xx-friend.cpp
f47f7a1c4082b42b21f1c7dc211ff90f4b38258a 06-May-2009 Anders Carlsson <andersca@mac.com> Add parsing of friend specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71067 91177308-0d34-0410-b5e6-96231b3b80d8
xx-friend.cpp
7dc813462dd9fd3f6f4296f896a12de14264fef8 29-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Have the parser communicate the exception specification to the action.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70389 91177308-0d34-0410-b5e6-96231b3b80d8
xx-exception-spec.cpp
eb32fde032a250091134db56a3aeaea6b09f6594 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Simplify the scheme used for keywords, and change the classification
scheme to be more useful.

The new scheme introduces a set of categories that should be more
readable, and also reflects what we want to consider as an extension
more accurately. Specifically, it makes the "what is a keyword"
determination accurately reflect whether the keyword is a GNU or
Microsoft extension.

I also introduced separate flags for keyword aliases; this is useful
because the classification of the aliases is mostly unrelated to the
classification of the original keyword.

This patch treats anything that's in the implementation
namespace (prefixed with "__", or "_X" where "X" is any upper-case
letter) as a keyword without marking it as an extension. This is
consistent with the standards in that an implementation is allowed to define
arbitrary extensions in the implementation namespace without violating
the standard. This gets rid of all the nasty "extension used" warnings
for stuff like __attribute__ in -pedantic mode. We still warn for
extensions outside of the the implementation namespace, like typeof.
If someone wants to implement -Wextensions or something like that, we
could add additional information to the keyword table.

This also removes processing for the unused "Boolean" language option;
such an extension isn't supported on any other C implementation, so I
don't see any point to adding it.

The changes to test/CodeGen/inline.c are required because previously, we
weren't actually disabling the "inline" keyword in -std=c89 mode.

I'll remove Boolean and NoExtensions from LangOptions in a follow-up
commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70281 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.c
eclarators.c
ecovery.c
de1b60a9868f80f0872ed05d78df3b40a10ba5ca 26-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> The mysterious bug turns out to be an incredibly bone-headed mistake.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70160 91177308-0d34-0410-b5e6-96231b3b80d8
xx-try.cpp
d3a413d3b8eb39bcee5944bc545d9997c1abe492 26-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement function-try-blocks. However, there's a very subtle bug that I can't track down.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70155 91177308-0d34-0410-b5e6-96231b3b80d8
xx-try.cpp
a868a203a18571d091e5d226f5f100d4440f3d94 21-Apr-2009 Chris Lattner <sabre@nondot.org> implement semantic analysis for @synchronized, fixing a crash on invalid
rdar://6810940 - @synchronized has no sema checks


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69670 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
dbb4f21125699f207ce7accfc52fdd99f47ce352 15-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add warning when a tentative array definition is assumed to have one element.
- Also, fixed one to actually be one (instead of zero). :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69226 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.c
1721a2dfc05d081e76d6dd4755d52c96e093dabc 13-Apr-2009 Chris Lattner <sabre@nondot.org> Improve error recovery for calls, fixing:
PR3972: Poor diagnostic with missing ')'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68932 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.c
8129edbb576c297df8631c3db4ac1339f4a9e8ad 13-Apr-2009 Chris Lattner <sabre@nondot.org> Fix some C++ error recovery problems in init declarator parsing
that I noticed working on other things.

Instead of emitting:

t2.cc:1:8: error: use of undeclared identifier 'g'
int x(*g);
^
t2.cc:1:10: error: expected ')'
int x(*g);
^
t2.cc:1:6: note: to match this '('
int x(*g);
^

We now only emit:

t2.cc:1:7: warning: type specifier missing, defaults to 'int'
int x(*g);
^


Note that the example in SemaCXX/nested-name-spec.cpp:f4 is still
not great, we now produce both of:

void f4(undef::C); // expected-error {{use of undeclared identifier 'undef'}} \
expected-error {{variable has incomplete type 'void'}}

The second diagnostic should be silenced by something getting marked invalid.
I don't plan to fix this though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68919 91177308-0d34-0410-b5e6-96231b3b80d8
xx-decl.cpp
6491f47670661c7c9e546cbc3ca7bae2f9850f21 13-Apr-2009 Chris Lattner <sabre@nondot.org> fix another case that assumed that GetTypeForDeclarator would never return null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68918 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
33c6ebef6f9acad6eb667fff77ff78f0c169332c 13-Apr-2009 Chris Lattner <sabre@nondot.org> mark the declspec as invalid when we recover instead of forcing to int,
this allows downstream diags to be properly silenced.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68917 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
4c97d762d8c5a84f6554e5bfb31d28c90df64158 12-Apr-2009 Chris Lattner <sabre@nondot.org> Diagnose invalid uses of tagged types with a missing tag. For example, in:

struct xyz { int y; };
enum abc { ZZZ };

static xyz b;
abc c;

we used to produce:

t2.c:4:8: error: unknown type name 'xyz'
static xyz b;
^
t2.c:5:1: error: unknown type name 'abc'
abc c;
^

we now produce:

t2.c:4:8: error: use of tagged type 'xyz' without 'struct' tag
static xyz b;
^
struct
t2.c:5:1: error: use of tagged type 'abc' without 'enum' tag
abc c;
^
enum

GCC produces the normal:
t2.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘b’
t2.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’

rdar://6783347


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68914 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
c199ab3ea1381e8e9cdd720eb87bb4f65cdf5086 12-Apr-2009 Chris Lattner <sabre@nondot.org> Implement the first set of changes for PR3963 and rdar://6759604,
which tries to do better error recovery when it is "obvious" that an
identifier is a mis-typed typename. In this case, we try to parse
it as a typename instead of as the identifier in a declarator, which
gives us several options for better error recovery and immediately
makes diagnostics more useful. For example, we now produce:

t.c:4:8: error: unknown type name 'foo_t'
static foo_t a = 4;
^

instead of:

t.c:4:14: error: invalid token after top level declarator
static foo_t a = 4;
^

Also, since we now parse "a" correctly, we make a decl for it,
preventing later uses of 'a' from emitting things like:

t.c:12:20: error: use of undeclared identifier 'a'
int bar() { return a + b; }
^

I'd really appreciate any scrutiny possible on this, it
is a tricky area.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68911 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
bjc-foreach-syntax.m
2dd979fbd59938babbed76e2376116511b403c93 11-Apr-2009 Chris Lattner <sabre@nondot.org> Improve the 'cannot pass objc interface by value' diagnostic:
1) improve localizability by not passing english strings in.
2) improve location for arguments.
3) print the objc type being passed.

Before:
method-bad-param.m:15:1: error: Objective-C type cannot be passed by value
-(void) my_method:(foo) my_param
^

after:
method-bad-param.m:15:25: error: Objective-C interface type 'foo' cannot be passed by value
-(void) my_method:(foo) my_param
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68872 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
cd1477562e7cf03279850885583d615e1f631dd4 29-Mar-2009 Chris Lattner <sabre@nondot.org> hoist some code for handling objc foreach construct out of Declaration processing
into ParseForStatement. Merge two tests into one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68010 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-foreach-error-1.m
bjc-foreach-syntax.m
23c4b1883b13dc17484b7214091b73f3ba29096e 29-Mar-2009 Chris Lattner <sabre@nondot.org> hoist checks for ; and in out of ParseInitDeclaratorListAfterFirstDeclarator
into ParseSimpleDeclaration, and improve a diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68009 91177308-0d34-0410-b5e6-96231b3b80d8
ypeof.c
f67606ae2febe3bb0718f05040c6c4bc2c2c3276 28-Mar-2009 Anders Carlsson <andersca@mac.com> Parse namespace aliases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67908 91177308-0d34-0410-b5e6-96231b3b80d8
xx-namespace-alias.cpp
f26d510f49ddcd1a35e4e9af8978c5b6cb7099c2 24-Mar-2009 Chris Lattner <sabre@nondot.org> fix "Comment#1" from PR3872


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67625 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
d7d5f0223bd30dfd618762349c6209dd1d5ea3e6 24-Mar-2009 Daniel Dunbar <daniel@zuster.org> Rename clang to clang-cc.

Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
008-10-31-parse-noop-failure.c
ompoundStmtScope.c
icrosoftExtensions.c
rgument_qualified.c
rgument_redef.c
rgument_scope.c
sm.c
ttributes.c
ad-control.c
lock-block-storageclass.c
lock-pointer-decl.c
uiltin_classify_type.c
uiltin_types_compatible.c
-namespace.c
har-literal-printing.c
heck-objc2-syntax-1.m
heck-syntax-1.m
heck_cast.c
ompound_literal.c
ontrol-scope.c
xx-bool.cpp
xx-casting.cpp
xx-class.cpp
xx-condition.cpp
xx-exception-spec.cpp
xx-reference.cpp
xx-template-decl.cpp
xx-try.cpp
xx-typeid.cpp
xx-typeof.cpp
xx-using-directive.cpp
xx-variadic-func.cpp
xx0x-rvalue-reference.cpp
eclarators.c
esignator.c
ncode.m
nhanced-proto-1.m
xpressions.c
xpressions.m
xtension.c
unction-decls.c
oto-ident.c
f-scope-c90.c
f-scope-c99.c
mplicit-casts.c
ethod-prototype-1.m
amelookup-bug-1.c
amelookup-bug-2.c
bjc-alias-printing.m
bjc-category-neg-1.m
bjc-forcollection-1.m
bjc-forcollection-neg-2.m
bjc-forcollection-neg.m
bjc-foreach-error-1.m
bjc-foreach-syntax.m
bjc-init.m
bjc-interfaces.m
bjc-messaging-1.m
bjc-messaging-neg-1.m
bjc-missing-impl.m
bjc-property-syntax.m
bjc-quirks.m
bjc-try-catch-1.m
bjc-type-printing.m
armvardecl_conversion.c
ointer-arithmetic.c
ointer_promotion.c
ragma-pack.c
refix-attributes.m
romote_types_in_proto.c
ecovery.c
elector-1.m
tatements.c
truct-recursion.c
raditional_arg_scope.c
ypeof.c
ypes.c
743de1f671ee0ef213c7404cfdc85579dd12c56e 23-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Recognize rvalue references in C++03, but complain about them. This leads to far better error recovery.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67495 91177308-0d34-0410-b5e6-96231b3b80d8
xx-reference.cpp
2ff44784d180bb96953c22de4a0b2efb5d50263a 20-Mar-2009 Douglas Gregor <dgregor@apple.com> Some minor tweaks and additional tests for rvalue references

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67397 91177308-0d34-0410-b5e6-96231b3b80d8
xx0x-rvalue-reference.cpp
7c80bd64032e610c0dbd74fc0ef6ea334447f2fd 17-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Almost complete implementation of rvalue references. One bug, and a few unclear areas. Maybe Doug can shed some light on some of the fixmes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67059 91177308-0d34-0410-b5e6-96231b3b80d8
xx-reference.cpp
xx0x-rvalue-reference.cpp
05532f2a88161eb6d9b796614f1b82dca541ff22 15-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Parser support for rvalue references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67033 91177308-0d34-0410-b5e6-96231b3b80d8
xx-reference.cpp
61f72cbd037e58f12cfe90cd442373f44092f030 09-Mar-2009 Steve Naroff <snaroff@apple.com> Implement property '.' notation on Factory/Class objects. Parser changes aren't very pretty:-(

This fixes <rdar://problem/6496506> Implement class setter/getter for properties.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66465 91177308-0d34-0410-b5e6-96231b3b80d8
heck-objc2-syntax-1.m
e950d4bbb7c785c7a7abdd0ad98f372b8c7980b8 07-Mar-2009 Douglas Gregor <dgregor@apple.com> Clean up some error messages with anonymous structs/unions and member declaration parsing. Fixes PR3680

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66305 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-directive.cpp
f306f86d2b85e820f5d1f397e4441d52373823d6 28-Feb-2009 Chris Lattner <sabre@nondot.org> Fix a crash in test/Parser/control-scope.c that testrunner didn't
notice because it was a negative test with a fix suggested by
Jean-Daniel Dupas. Convert the test from a negative to a positive
test to catch stuff like this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65708 91177308-0d34-0410-b5e6-96231b3b80d8
ontrol-scope.c
35d276f443462249b436951c1c663820569e1768 27-Feb-2009 Chris Lattner <sabre@nondot.org> upgrade various 'implicit int' warnings from an ext-warn to warning when not
in C89 mode. This makes it enabled by default instead of only enabled with
-pedantic. Clang defaults to c99 mode, so people will see this more often
than with GCC, but they can always use -std=c89 if they really want c89.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65647 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
bjc-forcollection-neg-2.m
raditional_arg_scope.c
ypeof.c
51a75d0cc7651753399efdc3176feaee6214c3ca 27-Feb-2009 Chris Lattner <sabre@nondot.org> change a diagnostic message from something pedantically correct but
useless to something more vague but hopefully more clear.
rdar://6624173


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65639 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-foreach-error-1.m
4b2d3f7bcc4df31157df443af1b80bcaa9b58bba 26-Feb-2009 Douglas Gregor <dgregor@apple.com> Introduce code modification hints into the diagnostics system. When we
know how to recover from an error, we can attach a hint to the
diagnostic that states how to modify the code, which can be one of:

- Insert some new code (a text string) at a particular source
location
- Remove the code within a given range
- Replace the code within a given range with some new code (a text
string)

Right now, we use these hints to annotate diagnostic information. For
example, if one uses the '>>' in a template argument in C++98, as in
this code:

template<int I> class B { };
B<1000 >> 2> *b1;

we'll warn that the behavior will change in C++0x. The fix is to
insert parenthese, so we use code insertion annotations to illustrate
where the parentheses go:

test.cpp:10:10: warning: use of right-shift operator ('>>') in template
argument will require parentheses in C++0x
B<1000 >> 2> *b1;
^
( )


Use of these annotations is partially implemented for HTML
diagnostics, but it's not (yet) producing valid HTML, which may be
related to PR2386, so it has been #if 0'd out.

In this future, we could consider hooking this mechanism up to the
rewriter to actually try to fix these problems during compilation (or,
after a compilation whose only errors have fixes). For now, however, I
suggest that we use these code modification hints whenever we can, so
that we get better diagnostics now and will have better coverage when
we find better ways to use this information.

This also fixes PR3410 by placing the complaint about missing tokens
just after the previous token (rather than at the location of the next
token).




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65570 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-directive.cpp
ecovery.c
ccef371a67756233aa97770e4fccdfa868b3e2d0 20-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6500554> missing objc error message.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65198 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
4310f4ee260e6c7ceeaf299e240f4d789ecc730d 16-Feb-2009 Douglas Gregor <dgregor@apple.com> Make "implicit int" an error in C++ (unless we're allowing Microsoft
extensions). This caught a couple bugs in our test suite :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64686 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
b6d74a158a9c002e3c0fcbda8ad8d0ccbb2e5088 15-Feb-2009 Chris Lattner <sabre@nondot.org> implement gcc/testsuite/objc.dg/method-attribute-3.m, by improving error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64609 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-interfaces.m
3d658640abc128dcc84a5a5201456395c86c4fa6 14-Feb-2009 Cedric Venet <cedric.venet@laposte.net> Add svn:eol-style=native to some files
Correct two files with inconsistent lines endings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64564 91177308-0d34-0410-b5e6-96231b3b80d8
xx-condition.cpp
xx-variadic-func.cpp
c1ced28c0262698de9877afa74589038c7aad0df 13-Feb-2009 Douglas Gregor <dgregor@apple.com> Fix capitalization in a diagnostic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64472 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-forcollection-neg-2.m
3dcfe10a6801eb52f4c20f1242bea0a3a98aa146 12-Feb-2009 Steve Naroff <snaroff@apple.com> Turn warning into error. Minor incompatibility with GCC (for scalar types, GCC only produces a warning).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64375 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
7151bbb55c8a437073e42f74348c3fd5f1d5b410 11-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6206858> [sema] type check @throw statements.

Added a FIXME to handle 'rethrow' check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64308 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
d684b0027e16163c4bdba3e2f8bfadda7d62a0d3 10-Feb-2009 Douglas Gregor <dgregor@apple.com> Implement parsing, semantic analysis and ASTs for default template
arguments. This commit covers checking and merging default template
arguments from previous declarations, but it does not cover the actual
use of default template arguments when naming class template
specializations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64229 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
ddc29e116db3c3f4144355e67a0137b38b6bb6d1 06-Feb-2009 Douglas Gregor <dgregor@apple.com> Semantic checking for class template declarations and
redeclarations. For example, checks that a class template
redeclaration has the same template parameters as previous
declarations.

Detangled class-template checking from ActOnTag, whose logic was
getting rather convoluted because it tried to handle C, C++, and C++
template semantics in one shot.

Made some inroads toward eliminating extraneous "declaration does not
declare anything" errors by adding an "error" type specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63973 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
aaba5e346dffdbad5d1c42765a89e4a7afb0da67 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Basic representation of C++ class templates, from Andrew Sutton.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63750 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
adf077f46ba5cddcd801a647a5e9a3eb97060df4 27-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3418: make sure to handle the RHS of expressions starting with
__extension__. This sort of construct shows up in the gcc source code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63100 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.c
4ec339f43c0cae2678334850c90926bea10999c7 19-Jan-2009 Douglas Gregor <dgregor@apple.com> Centralize error reporting of improper uses of incomplete types in the
new DiagnoseIncompleteType. It provides additional information about
struct/class/union/enum types when possible, either by pointing to the
forward declaration of that type or by pointing to the definition (if
we're in the process of defining that type).
Fixes <rdar://problem/6500531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62521 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.c
353417af9d254d4fd0eb7d0a3ff71c4d8594ac58 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Update support for vector component access on ExtVectors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62440 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_components.c
573acde1db5cb3e216e3d63fee173230834093d8 18-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose that property name cannot be a bitfield


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62432 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-syntax.m
41f2b32df5faff10c305ef1892fcb02846e4f489 17-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Catch a foreach parse error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62382 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-foreach-syntax.m
eb11cd078ba8682bbb9b082f8f6ead8be5c98581 14-Jan-2009 Douglas Gregor <dgregor@apple.com> Refactor name lookup.

This change refactors and cleans up our handling of name lookup with
LookupDecl. There are several aspects to this refactoring:

- The criteria for name lookup is now encapsulated into the class
LookupCriteria, which replaces the hideous set of boolean values
that LookupDecl currently has.

- The results of name lookup are returned in a new class
LookupResult, which can lazily build OverloadedFunctionDecls for
overloaded function sets (and, eventually, eliminate the need to
allocate member for OverloadedFunctionDecls) and contains a
placeholder for handling ambiguous name lookup (for C++).

- The primary entry points for name lookup are now LookupName (for
unqualified name lookup) and LookupQualifiedName (for qualified
name lookup). There is also a convenience function
LookupParsedName that handles qualified/unqualified name lookup
when given a scope specifier. Together, these routines are meant
to gradually replace the kludgy LookupDecl, but this won't happen
until after we have base class lookup (which forces us to cope
with ambiguities).

- Documented the heck out of name lookup. Experimenting a little
with using Doxygen's member groups to make some sense of the Sema
class. Feedback welcome!

- Fixes some lingering issues with name lookup for
nested-name-specifiers, which now goes through
LookupName/LookupQualifiedName.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62245 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-directive.cpp
4920f1ffb62b13b88e579476803c093f97f3e17f 12-Jan-2009 Douglas Gregor <dgregor@apple.com> Implement support for anonymous structs and unions in C. Both C and
C++ handle anonymous structs/unions in the same way. Addresses several
bugs:

<rdar://problem/6259534>
<rdar://problem/6481130>
<rdar://problem/6483159>

The test case in PR clang/1750 now passes with -fsyntax-only, but
CodeGen for inline assembler still fails.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62112 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
5a2f5d304897220f16e00c05cf122dd95e859aa9 10-Jan-2009 Douglas Gregor <dgregor@apple.com> Allow multiple Microsoft calling-convention keywords. Fixes rdar://problem/6486133

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62018 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
1fd80116b49782c367ff5d5f50a8b76dd8a5d7f7 09-Jan-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6480479 - [parser] infinite loop on invalid input


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61975 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-quirks.m
47f5209a80c7c75592e87eb296d2b51e03208ae0 06-Jan-2009 Steve Naroff <snaroff@apple.com> Another tweak to handle the MS extensions (<rdar://problem/5956221>).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61821 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
7ec5658f92fd5b65f682b6e942b95210426fc6e2 06-Jan-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5956221> clang ObjC rewriter: Microsoft-specific __fastcall keyword unrecognized.

This fix is C++ specific.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61816 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
823c44e6d73141f642e207980b4021ddcf09897b 06-Jan-2009 Chris Lattner <sabre@nondot.org> - Various comment typo fixes in Sema.h
- Simplify ParseDeclCXX to use early exit on error instead of nesting.
- Change ParseDeclCXX to using the 'skip on error' form of ExpectAndConsume.
- If we don't see the ; in a using directive, still call the action, for
hopefully better error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61801 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-directive.cpp
48eb4613c6a367f187e2f8ca816c8b2dd01a95ae 06-Jan-2009 Chris Lattner <sabre@nondot.org> rename these tests to match the attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61770 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_components.c
cu_vector_components.c
f780abc21c39cd4731b9e38f2d2d9f7d1510bd7b 30-Dec-2008 Douglas Gregor <dgregor@apple.com> Parser support for C++ using directives, from Piotr Rak

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61486 91177308-0d34-0410-b5e6-96231b3b80d8
xx-using-directive.cpp
a4ed0d8d75212dc01b4438829a4b0c846d99458d 28-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Diagnose declarations that don't declare anything, and fix PR3020.
Examples:
int;
typedef int;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61454 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
86bc6cf05ad3ff7198671c394ba5157974e8a39c 25-Dec-2008 Steve Naroff <snaroff@apple.com> Add parser support for __forceinline, __w64, __ptr64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61431 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
239f07384fe5e7194e780d98a17553084efeeb44 25-Dec-2008 Steve Naroff <snaroff@apple.com> Add parser support for __cdecl, __stdcall, and __fastcall.
Change preprocessor implementation of _cdecl to reference __cdecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61430 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
c4b4e7b8f6ca9b036824e048af49cd2a52b57cdf 24-Dec-2008 Douglas Gregor <dgregor@apple.com> Keep track of template arguments when we parse them. Right now, we don't actually do anything with the template arguments, but they'll be used to create template declarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61413 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
a0fd8652f3302d0f39ed9849b521ee5b76597b0a 21-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Parser support for C++ try-catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61312 91177308-0d34-0410-b5e6-96231b3b80d8
xx-try.cpp
65ce04bef06696379682410f399f37b43996d824 18-Dec-2008 Chris Lattner <sabre@nondot.org> Merge function-return.c into function.c

Fix PR2790 by making a warning an EXTWARN instead of EXTENSION.
Add a new EXTENSION warning for "return (some void expression);"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61187 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
bc8d56496a6ecdba14769df03d75c001184f8c54 18-Dec-2008 Chris Lattner <sabre@nondot.org> implement PR3177 - "__extension__ union" not supported in C++ mode


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61180 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
5f76494cbcb8334043aa3805d853a016e0e71d01 17-Dec-2008 Eli Friedman <eli.friedman@gmail.com> Oops, accidentally commited the wrong version of the test (original
commit r61160).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61162 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.c
2342ef75797a2ad6c9d7a784cfff220fd1a66008 17-Dec-2008 Eli Friedman <eli.friedman@gmail.com> Do proper recovery from an invalid switch condiition. Fixes PR3229.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61160 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.c
777f07b6cd595bb0922e05768e5703fbc92b5695 17-Dec-2008 Chris Lattner <sabre@nondot.org> diagnose C99 6.9.1p5, C arguments in definitions that are lacking
a name. This implements PR3208.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61127 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.c
fdb548e8224446e2b974fd974d86a60688402a85 12-Dec-2008 Chris Lattner <sabre@nondot.org> fix a buggy fall through that caused a crash-on-invalid. rdar://6248081


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60961 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery.c
a9053e02ce56d89369c607573f9b71e8122e2921 12-Dec-2008 Chris Lattner <sabre@nondot.org> rename recovery-3 to recovery.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60931 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery-3.c
ecovery.c
0ba0dd699108afd6a7dfe55b54b23cecdae53c0e 12-Dec-2008 Chris Lattner <sabre@nondot.org> merge recovery-1 into recovery-3.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60930 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery-1.c
ecovery-3.c
18914bcb22774137ba720e5fcb377150bf2f6de3 12-Dec-2008 Chris Lattner <sabre@nondot.org> merge recovery-2.c into recovery-3.c.

Substantially improve error recovery after broken if conditions by
parsing the full if when we have a semantic error instead of using
parser recovery techniques to recover from a semantic error.

This fixes rdar://6094870 - spurious error after invalid 'if' condition


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60929 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery-2.c
ecovery-3.c
90b93d6f6961edd8f17e089253d655892adc1ef7 08-Dec-2008 Chris Lattner <sabre@nondot.org> Fix PR3172: if we see an eof or } at the top level, reject it.
This is important because ParseDeclarationOrFunctionDefinition
skips to, but does not consume, an } on error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60719 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery-3.c
96e05bc09070aaa7c18d3dd3ff13125a43532f69 07-Dec-2008 Anders Carlsson <andersca@mac.com> Improve VLA diagnostics/sema checking. Fixes PR2361 and PR2352.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60638 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin_classify_type.c
72c3f314d92d65c050ee1c07b7753623c044d6c7 05-Dec-2008 Douglas Gregor <dgregor@apple.com> Representation of template type parameters and non-type template
parameters, with some semantic analysis:
- Template parameters are introduced into template parameter scope
- Complain about template parameter shadowing (except in Microsoft mode)

Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates.

Next up: dependent types and value-dependent/type-dependent
expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60597 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
ae0ee03fd9d36446ee70e502fdaf5ed5acec269f 05-Dec-2008 Chris Lattner <sabre@nondot.org> instead of forcing blocks on by default, make them default to off, but let
specific targets default them to on. Default blocks to on on 10.6 and later.
Add a -fblocks option that allows the user to override the target's default.
Use -fblocks in the various testcases that use blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60563 91177308-0d34-0410-b5e6-96231b3b80d8
lock-pointer-decl.c
26236e8b7507017fded05da3474d842e802a1679 02-Dec-2008 Douglas Gregor <dgregor@apple.com> A little more scaffolding for parsing templates:
- Template parameter scope to hold the template parameters
- Template parameter context for parsing declarators
- Actions for template type parameters and non-type template
parameters



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60387 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
adcac8824a9cff13f1ef61a69e38c1041cba12ee 02-Dec-2008 Douglas Gregor <dgregor@apple.com> Basic support for parsing templates, from Andrew Sutton

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60384 91177308-0d34-0410-b5e6-96231b3b80d8
xx-template-decl.cpp
bec1c9d6f3feeec112cc8eeae90c1be29c6aaf13 01-Dec-2008 Douglas Gregor <dgregor@apple.com> Objective-C keywords are not always identifiers. Some are also C++ keywords

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60373 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
0fe7bea6fca9737c6c145aaa4a2ad3abe595782a 25-Nov-2008 Douglas Gregor <dgregor@apple.com> Simple parsing of exception specifications, with no semantic analysis yet

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60005 91177308-0d34-0410-b5e6-96231b3b80d8
xx-exception-spec.cpp
d162584991885ab004a02573a73ce06422b921fc 24-Nov-2008 Chris Lattner <sabre@nondot.org> Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first. This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59948 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-forcollection-neg-2.m
bjc-forcollection-neg.m
28eb7e992b9a266abb300da25b6d3c1557cec361 24-Nov-2008 Chris Lattner <sabre@nondot.org> make the 'to match this' diagnostic a note.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59921 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery-1.c
ypeof.c
5f4a6829dc58cab2f76e2b98492859aa3b91e3f2 24-Nov-2008 Chris Lattner <sabre@nondot.org> Make all the 'redefinition' diagnostics more consistent, and make the
"previously defined here" diagnostics all notes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59920 91177308-0d34-0410-b5e6-96231b3b80d8
rgument_redef.c
08631c5fa053867146b5ee8be658c229f6bf127c 23-Nov-2008 Chris Lattner <sabre@nondot.org> Convert IdentifierInfo's to be printed the same as DeclarationNames
with implicit quotes around them. This has a bunch of follow-on
effects and requires tweaking to a whole lot of code. This causes
a regression in two tests (xfailed) by causing it to emit things like:

Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')

instead of:

Line 10: duplicate interface declaration for category 'MyClass1(Category1)'

I will fix this in a follow-up commit.

As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency. This is good, but I was planning to do this
as an independent patch. There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59917 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack.c
669d5d74b880a8497b92a3ec159145713f4d6519 15-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement parsing and semantic checking of the 'mutable' keyword.
Thanks to Doug for the review. Actual effects of mutable to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59331 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
195044028b76133e2a1f245b094468fe07db7330 13-Nov-2008 Chris Lattner <sabre@nondot.org> Fix a couple of suboptimalities in error recovery.

1. In the top level of ParseStatementOrDeclaration, don't eat a } if we
just parsed a statement if it list there. Also, don't even bother
emitting an error about a missing semicolon if the statement had a
bug (an rbrace is fine).
2. In do/while parsing, don't require a 'while' to be present if the do
body didn't parse.

This allows us to generate a clean diagnostic for this code:

t.c:1:22: error: expected expression
void foo (void) { do . while (0); }
^

Thanks to Neil for pointing this out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59256 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
a668e8ec3b3c93626147b25be4f5484da809bced 13-Nov-2008 Chris Lattner <sabre@nondot.org> implement a fixme :), switch to -verify mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59253 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
c42e1183846228a7fa5143ad76507d6d60f5c6f3 11-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++ 'typeid' parsing and sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59042 91177308-0d34-0410-b5e6-96231b3b80d8
xx-typeid.cpp
1f6f54be86a514d531ec231fd837858a43cfe72e 11-Nov-2008 Chris Lattner <sabre@nondot.org> Fix PR3031 by silencing follow-on errors in invalid declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59027 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
ab963c6221ac088fad73a47bc7a0a0b266b030da 08-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Update C++ status to reflect parser capabilities for chapter 9 (classes). Slightly extend the class parser test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58909 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
e10b0f236bc8487445bc99b8d14bd40666b1998d 31-Oct-2008 Daniel Dunbar <daniel@zuster.org> "One" line fix for -parse-noop failure, "id" and several other things
were being treated as type names for non-Objective-C files.
- Other lines are just because MinimalAction didn't have access to
the LangOptions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58498 91177308-0d34-0410-b5e6-96231b3b80d8
008-10-31-parse-noop-failure.c
27c8dc06f65d7abcf6a7e7f64a7960c9a150ca01 29-Oct-2008 Douglas Gregor <dgregor@apple.com> Implement initialization of a reference (C++ [dcl.init.ref]) as part
of copy initialization. Other pieces of the puzzle:

- Try/Perform-ImplicitConversion now handles implicit conversions
that don't involve references.
- Try/Perform-CopyInitialization uses
CheckSingleAssignmentConstraints for C. PerformCopyInitialization
is now used for all argument passing and returning values from a
function.
- Diagnose errors with declaring references and const values without
an initializer. (Uses a new Action callback, ActOnUninitializedDecl).

We do not yet have implicit conversion sequences for reference
binding, which means that we don't have any overloading support for
reference parameters yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58353 91177308-0d34-0410-b5e6-96231b3b80d8
xx-reference.cpp
0fc73f722fd76a9cc9932e5d21eebfe5a3c81080 27-Oct-2008 Chris Lattner <sabre@nondot.org> implement some more FIXMEs, by rejecting more bogus stuff in
objc mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58216 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
79ed6b5902ed92175b70ed3c4d7b3f239af847ce 27-Oct-2008 Chris Lattner <sabre@nondot.org> add some simple designator testcases. Reject things like this:

struct foo Y[10] = {
[4] .arr [2] 4 // expected-error {{expected '=' or another designator}}
};

because the "missing equals" extension only is valid if there
is exactly one array designator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58215 91177308-0d34-0410-b5e6-96231b3b80d8
esignator.c
aab740af64daaa8d94d34789a6ea7e2d2fc5ab39 20-Oct-2008 Chris Lattner <sabre@nondot.org> Support attributes in *yet another* place. Is there any place you
can't stick an attributes?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57795 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.c
7399ee0aa6ffaeab0a8f83408b1c5127fb2bf5b8 20-Oct-2008 Chris Lattner <sabre@nondot.org> Fix a parser bug where we let attributes interfere with our disambiguation
of whether a '(' was a grouping paren or the start of a function declarator.
This is PR2796.

Now we eat the attribute before deciding whether the paren is grouping or
not, then apply it to the resultant decl or to the first argument as needed.

One somewhat surprising aspect of this is that attributes interact with
implicit int in cases like this:

void a(x, y) // k&r style function
void b(__attribute__(()) x, y); // function with two implicit int arguments
void c(x, __attribute__(()) y); // error, can't have attr in identifier list.

Fun stuff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57790 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.c
e25d270b4d8e1d348bf74710c19b3c58d00933cb 06-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow variadic arguments without named ones for C++, e.g. "void(...);"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57143 91177308-0d34-0410-b5e6-96231b3b80d8
xx-variadic-func.cpp
f7a726b5f220c0ea924c47b4b1f59b99eb2e5712 04-Oct-2008 Daniel Dunbar <daniel@zuster.org> De-XFAIL test/Parser/pragma-pack.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57069 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack.c
4f2670d827bec492519eaf0be33638f8c7f6b3c1 04-Oct-2008 Chris Lattner <sabre@nondot.org> Move the expected-warning lines to a place that clang -verify will pick them
up. Speculatularly hacktastic, but strangely beautiful?
Daniel, lines 20/21 are rejected, please investigate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57067 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack.c
fcdd8fe26de3eee44927600bf1853e21bd90dd84 04-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add Parser support for #pragma pack
- Uses Action::ActOnPragmaPack
- Test case is XFAIL pending verifier fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57066 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack.c
246e70f69cb8aeb67225c54690f1c6b25abd5a86 26-Sep-2008 Daniel Dunbar <daniel@zuster.org> Parser support for prefix __attribute__ on @protocol.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56642 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-quirks.m
refix-attributes.m
69d349a8743f156b965141cda80520bddda84601 19-Sep-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6222856: the receiver of a message expr is an
arbitrary expr, not just a assign expr. The grammar comment
was right, the code was just wrong.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56353 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-messaging-1.m
8592b1d9a0f0acfcc1adbbcbf860a6f4fd429674 09-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56012 91177308-0d34-0410-b5e6-96231b3b80d8
xx-condition.cpp
71b914b999d9c4b6df11068fc5a3291ac4770492 09-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement parser support for the 'condition' part of C++ selection-statements and iteration-statements (if/switch/while/for).
Add new 'ActOnCXXConditionDeclarationExpr' action, called when the 'condition' is a declaration instead of an expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56007 91177308-0d34-0410-b5e6-96231b3b80d8
xx-condition.cpp
0f072032931fec955c6c022d38f692deff707744 05-Sep-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support "typeof unary-expression" (GNU C++ extension).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55833 91177308-0d34-0410-b5e6-96231b3b80d8
xx-typeof.cpp
c9a4eea59228bd06072927059979a1c9ccab45b5 02-Sep-2008 Steve Naroff <snaroff@apple.com> Pull code from last commit. will put back soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55637 91177308-0d34-0410-b5e6-96231b3b80d8
lock-block-storageclass.c
042f955a20e67cd8c8cdfede96bc6ec5a7234294 02-Sep-2008 Steve Naroff <snaroff@apple.com> Implement block pseudo-storage class modifiers (__block, __byref).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55635 91177308-0d34-0410-b5e6-96231b3b80d8
lock-block-storageclass.c
296e8d5fdcf9946f51e866adc8d281379e51efe9 28-Aug-2008 Steve Naroff <snaroff@apple.com> Add parser/action support for block literal expressions.
Parser support for blocks is almost complete...just need to add support for the __block() storage class qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55495 91177308-0d34-0410-b5e6-96231b3b80d8
lock-pointer-decl.c
5618bd4a52c45fbbb605e3ba885663b2164db8a3 27-Aug-2008 Steve Naroff <snaroff@apple.com> First wave of changes to support "blocks" (an extension to C).
This commit adds the declaration syntax (and associated type).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55417 91177308-0d34-0410-b5e6-96231b3b80d8
lock-pointer-decl.c
0976278aff6adfe191e7d580f7042ffab296548c 21-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Fix a minor crash-on-invalid.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55082 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery-3.c
b348b810e788c6c16129d99b99408a06e4639e0c 16-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> C++ casts, (static_cast. dynamic_cast, etc.) can have postfix-expression pieces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54850 91177308-0d34-0410-b5e6-96231b3b80d8
xx-casting.cpp
2b1cc8be4dda4cd122485be0168b3c43d7dff15f 21-Jul-2008 Chris Lattner <sabre@nondot.org> continue cleaning up code, and disable sending a message directly to an
interface. This fixes a bug where we used to accept:

void test2(NSNumber x) {
[x METH];
}

which doesn't make sense and GCC rejects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53841 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
3a9fdb4742b21c0a3c27f18c5e4e94bab6f9e64c 28-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Handle unnamed bitfields when parsing C++ classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52855 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
4cc18a4d5222e04bd568b1e3e4d86127dbbcdf3f 25-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add parsing support for C++ classes.

Note that Parser::ParseCXXMemberSpecification is temporarily disabled until the Sema support is in place.
Once ParseCXXMemberSpecification is enabled, the Parser/cxx-class.cpp test will pass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52694 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
13fd7e5111032f54b538dd66d035b0ccc1f82467 21-Jun-2008 Chris Lattner <sabre@nondot.org> "this patch adds code generation hooks for Objective-C constant strings. It also modifies Sema so that Objective-C constant strings are treated as untyped objects if the interface for the constant string class can not be found. This is consistent with Apple GCC. I thought it was consistent with GNU GCC, since this was causing failures when trying to compile GNUstep with (GNU) GCC, but it appears that this is not the case when attempting to produce a simple test case to demonstrate it. Possibly there is a way of making the error go away, but I haven't found out what it is yet."

Patch by David Chisnall!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52599 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-foreach-error-1.m
c577a0e9bf5812719d08c002a57b263681938aea 12-Jun-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Multiple tests in a single test file must be linked with '&&'.
Otherwise, failing tests other than the last one will not be reported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52231 91177308-0d34-0410-b5e6-96231b3b80d8
ontrol-scope.c
ecovery-1.c
b93fb495660665c17c7f43172ae155d6a8c32ce8 02-Jun-2008 Chris Lattner <sabre@nondot.org> handle the full assignment-expression grammar when using an
objc message send in an initializer expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51882 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
aec3a1eb215445e63ba5702f8d6b1e0f2e8c27b9 28-May-2008 Chris Lattner <sabre@nondot.org> Fix a couple crashes on invalid input.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51622 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
1f3105e1eeece9ffdc14d7262c7af486ac76600a 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Change diagnostic per suggestion, to make it a bit clearer what is
happening.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51574 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin_classify_type.c
1b76779233b23f8c64f2e1be9fa1f9a99ea694bd 23-May-2008 Gabor Greif <ggreif@gmail.com> fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51479 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
33701a61674753db0c9de7a294137e7dc4dd2d9b 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Test from PR2332; bug already fixed by r51311.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51316 91177308-0d34-0410-b5e6-96231b3b80d8
raditional_arg_scope.c
6e33dd5b5cbaddadd54bebe07c8397844365d885 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix the scope of K&R-style argument declarations so that they don't
extend beyond the end of the function.

I'm not completely sure this is the right way to fix this bug, so
someone familiar with the parser should double-check.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51311 91177308-0d34-0410-b5e6-96231b3b80d8
raditional_arg_scope.c
8a99764f9b778a54e7440b1ee06a1e48f25d76d8 09-May-2008 Nate Begeman <natebegeman@mac.com> Extend vector member references to include {.hi, .lo, .e, .o} which return a
vector of the same element type and half the width, with the high, low, even,
and odd elements respectively.

Allow member references to member references, so that .hi.hi gives you the high
quarter of a vector. This is fairly convenient syntax for some insert/extract
operations.

Remove some unnecessary methods/types in the ExtVectorElementExpr class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50892 91177308-0d34-0410-b5e6-96231b3b80d8
cu_vector_components.c
65bb89c3825406bdeeab6b2d8408b72deac8bbb2 20-Apr-2008 Chris Lattner <sabre@nondot.org> Two improvements to initializer parsing:
1. If we hit a semantic error, try harder to recover to emit
diagnostics for later initializer errors (PR2241).
2. Don't leak parsed initializers on an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49998 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery-2.c
213541a68a3e137d11d2cefb612c6cdb410d7e8e 19-Apr-2008 Nate Begeman <natebegeman@mac.com> OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49942 91177308-0d34-0410-b5e6-96231b3b80d8
cu_vector_components.c
3825c2eb00f108854942533a4993327889c081c3 06-Apr-2008 Chris Lattner <sabre@nondot.org> reject 'int test(x, x) int x; {}'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49271 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
aaf9ddbeab08a43203cf6b9ca4986c8c6fe6fdc6 06-Apr-2008 Chris Lattner <sabre@nondot.org> reject 'typedef int y; int test(x, y)'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49270 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
d658b562e80d6ef7a1118e34ff12802c6e2fcced 05-Apr-2008 Chris Lattner <sabre@nondot.org> Fix handling of implicit int, resolving PR2012 and reverting (and
subsuming) my patch for PR1999.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49251 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
6b884508c3bc97cc9df9516adb92fbf88dd0a2e4 10-Mar-2008 Chris Lattner <sabre@nondot.org> implement simple support for arbitrary token lookahead. Change the
objc @try parser to use it, fixing a FIXME. Update the
objc-try-catch-1.m file to pass now that we get more reasonable
errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48129 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
42e6737f2efb113563140ad794c21c7709250402 05-Mar-2008 Chris Lattner <sabre@nondot.org> Remove the first layer of support for "portability" warnings. This is
theoretically useful, but not useful in practice. It adds a bunch of
complexity, and not much value. It's best to nuke it. One big advantage
is that it means the target interfaces will soon lose their SLoc arguments
and target queries can never emit diagnostics anymore (yay). Removing this
also simplifies some of the core preprocessor which should make it slightly
faster.

Ted, I didn't simplify TripleProcessor, which can now have at most one
triple, and can probably just be removed. Please poke at it when you have
time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47930 91177308-0d34-0410-b5e6-96231b3b80d8
ortability.c
5280408ab323a213ac63d5b557475ea5037aa553 17-Feb-2008 Chris Lattner <sabre@nondot.org> Fix PR2042. One remaining issue: we don't currently diagnose

int foobar(int);
int foobar() {}

which requires ifdef'ing out a testcase in predefined-function.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47236 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-casts.c
99d724f6a31b5521ded95adf10ef7f3c62a0b18e 11-Feb-2008 Chris Lattner <sabre@nondot.org> Fix PR1999, by emitting a hard error only if an argument declarator is completely
missing. Otherwise, it is an implicit int case, which is valid in c90 and invalid
elsewhere, but accepted as an extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46938 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
8bd36fcb4427519f41197d88b9121e2bbe9e3fc3 09-Feb-2008 Anders Carlsson <andersca@mac.com> Behave correctly if a constraint expression is invalid.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46910 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
64515f31850024a263e8f55f81e9ea4b39925cfa 05-Feb-2008 Steve Naroff <snaroff@apple.com> Fix Parser::ParseObjCTryStmt() to allow for trailing @-keyword statements/expressions.

This bug fix is the result of not having 2-token lookahead to recognize specific @-keywords.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46768 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
6e10a08fe0427ab34c463dd59d9c0997d4f72170 01-Feb-2008 Chris Lattner <sabre@nondot.org> make some diagnostics more terse, update testcases.

Fix Sema::ActOnInstanceMessage to correctly do things in terms of canonical
types, fixing bogus errors like:

NSDistantObject.m:10383:120: error: bad receiver type 'typeof((id<NSMutableCopying>)self)'
id mess = ({ id __inv__ = ((void *)0); id __mb__ = _NSMessageBuilder((id <NSMutableCopying>)self, &__inv__); (void)[(__typeof__((id <NSMutableCopying>)self))__mb__ mutableCopyWithZone:((void *)0)]; if (!objc_collecting_enabled()) object_dispose(__mb__); __inv__; });



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46633 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-forcollection-neg-2.m
bjc-forcollection-neg.m
e0e713b661ed07b7e012147344220583a91ab1bf 31-Jan-2008 Chris Lattner <sabre@nondot.org> Fix PR1965: missing diagnostics for parameters that are missing
type specifiers. This required updating some (buggy) tests, and the
testcase was previously accidentally committed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46603 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
5c749428a9938d5e2e9564b1c9b7a9252c30ee27 25-Jan-2008 Chris Lattner <sabre@nondot.org> Add support for dispatching an objc message to a variable
in an initializer list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46367 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
da46f3b5dacd300ec95a7baa3fb24d5ca2cdf920 25-Jan-2008 Chris Lattner <sabre@nondot.org> First half of a fix for the "objc message send in initializer" bug. This only
handles message sends with typenames to start with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46366 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-init.m
7c453b3ded5dc9bff05e6e66eb725a0938303d73 17-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Don't ICE on missing interface declaration when declaring one of its protocols.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46141 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-category-neg-1.m
20552d2842245692b649e0d25380670922f954a2 10-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Recover from user typo not having proper @interface decl and a bad foreach decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45839 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-foreach-error-1.m
a12a75faa61d7298ea27d8606a7d8f8f3584f9fa 10-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Remove non-ascii chaaracter from diagnostic


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45836 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-missing-impl.m
94cdb25a49bd3716ab56ef6de0ea57d29e686bf2 10-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Warn (as gcc does) when @end does not close anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45834 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-missing-impl.m
540fc539b9adecc38eec5af3ca59e34be2d12ae1 07-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Limit type of foreach's element and collection to be a pointer to
objc object type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45709 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-forcollection-neg-2.m
8ce5da30642cd23968daf5bc2af5f6cd658c9c16 07-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Issue diagnostics if more than one declaration in objectove-c's foreach-stmt header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45708 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-forcollection-neg-2.m
b7b61159325e002998ff950fdc70a6425a6b13b3 04-Jan-2008 Chris Lattner <sabre@nondot.org> add comments for the various AssignConvertType's, and split int->pointer from pointer->int.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45591 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-casts.c
5cf216b7fa64b933b60743b0b26053e8e7aa87be 04-Jan-2008 Chris Lattner <sabre@nondot.org> Merge all the 'assignment' diagnostic code into one routine, decloning
it from several places. This merges the diagnostics, making them more
uniform and fewer in number. This also simplifies and cleans up the code.

Some highlights:
1. This removes a bunch of very-similar diagnostics.
2. This renames AssignmentCheckResult -> AssignConvertType
3. This merges PointerFromInt + IntFromPointer which were always treated the same.
4. This updates a bunch of test cases that have minor changes to the produced diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45589 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin_types_compatible.c
mplicit-casts.c
ypeof.c
1f990d67c2d24cb330434f42dd62a3a0cc4aa6e9 04-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to add semantics check for ObjC2's foreacn statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45561 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-forcollection-1.m
bjc-forcollection-neg.m
0de2ae28c603322f05e2d9200c7d457c8b928983 02-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Issue diagnostic when objective-c's @interface is preceeded by a type specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45491 91177308-0d34-0410-b5e6-96231b3b80d8
heck-syntax-1.m
0ba0aa1460ae234423609c09da1b6ad11fae24f3 02-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Prevent crash on incorrect objc messaging expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45489 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-messaging-neg-1.m
1e571444b98c493ad1684dd177cf5041518882f5 27-Dec-2007 Chris Lattner <sabre@nondot.org> add a file I forgot to svn add.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45374 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-quirks.m
516bd467c25071b677bf2ec98c84f27294f56801 27-Dec-2007 Chris Lattner <sabre@nondot.org> Fix a crash on a top-level objc string, patch by Nico Weber


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45370 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.m
cb53b361bce341c8591333c6997f62e480acc0b4 27-Dec-2007 Chris Lattner <sabre@nondot.org> - Use Tok.isObjCAtKeyword instead of Tok.getIdentifierInfo()->getObjCKeywordID().
The later fails if the token is not an identifier.
- Replace tabs with spaces.
- Various other cleanups.

Patch by Nico Weber!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45368 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
68cfd49ea35d9101da9e6d4d5642263c9e95f1a4 19-Dec-2007 Chris Lattner <sabre@nondot.org> reenable this code, fix the testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45205 91177308-0d34-0410-b5e6-96231b3b80d8
eclarators.c
f366b4c84485b646c30d6891a249ad6f65abef7c 11-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed a parsing bug whereby @optional/@required keyword is not followed by
a method declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44870 91177308-0d34-0410-b5e6-96231b3b80d8
nhanced-proto-1.m
5ef404f08b42c58fd8d4c93d1672ab28f61befa6 05-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to prevent crash on use of objc2 syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44617 91177308-0d34-0410-b5e6-96231b3b80d8
heck-objc2-syntax-1.m
ae3607684c5978dc2d877141015056c9d24f17ea 03-Dec-2007 Ted Kremenek <kremenek@apple.com> Implemented initial support for "-triple" option to the clang driver. This
replaces the functionality previously provided by just "-arch" (which is still
supported but has different semantics).

The new behavior is as follows:

(1) If the user does not specify -triple:

(a) If no -arch options are specified, the target triple used is the host
triple (in llvm/Config/config.h).

(b) If one or more -arch's are specified (and no -triple), then there is
one triple for each -arch, where the specified arch is substituted
for the arch in the host triple. Example:
host triple = i686-apple-darwin9
command: clang -arch ppc -arch ppc64 ...
triples used: ppc-apple-darwin9 ppc64-apple-darwin9

(2) The user does specify a -triple (only one allowed):

(a) If no -arch options are specified, the triple specified by -triple
is used. E.g clang -triple i686-apple-darwin9

(b) If one or more -arch options are specified, then the triple specified
by -triple is used as the primary target, and the arch's specified
by -arch are used to create secondary targets. For example:

clang -triple i686-apple-darwin9 -arch ppc -arch ppc64

has the following targets:
i686-apple-darwin9 (primary target)
ppc-apple-darwin9
ppc64-apple-darwin9


Other changes related to the changes to the driver:

- TargetInfoImpl now includes the triple string.

- TargetInfo::getTargetTriple returns the triple for its primary target.

- test case test/Parser/portability.c has been updated because "-arch linux" is
no longer valid ("linux" is an OS, not an arch); instead we use a bogus
architecture "bogusW16W16" where WCharWidth=16 and WCharAlign=16.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44551 91177308-0d34-0410-b5e6-96231b3b80d8
ortability.c
eecf847d1e46f4e1f7386ba3e624e2c8f31fa953 22-Nov-2007 Anders Carlsson <andersca@mac.com> GCC fails if there is a trailing colon but no clobbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44265 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
4c1a2a97b203d7db248b7a83bb3f471c1aa37e26 13-Nov-2007 Chris Lattner <sabre@nondot.org> Parse "sizeof(arr)[0]" as a sizeof of an expr if arr
is an expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44065 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.c
e61933ddb958cda2650891ec12521169638cf5c9 25-Oct-2007 Chris Lattner <sabre@nondot.org> Fix a recovery bug Fariborz and I noticed yesterday. We were producing:

method.c:4:3: error: use of undeclared identifier 'BADIDENT'
&BADIDENT, 0
^
method.c:5:2: error: expected '}'
};
^
method.c:3:14: error: to match this '{'
struct S A = {
^

now we only produce:

method.c:4:3: error: use of undeclared identifier 'BADIDENT'
&BADIDENT, 0
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43349 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery-1.c
02209fbebc261a40a8cd5dfe6589a7c1cc37e91b 18-Oct-2007 Chris Lattner <sabre@nondot.org> remove typedef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43109 91177308-0d34-0410-b5e6-96231b3b80d8
elector-1.m
a0818e3cd7d59d05e6da41015033b5574c3d7893 16-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to parse @selector expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43022 91177308-0d34-0410-b5e6-96231b3b80d8
elector-1.m
bece4ac257d85e51d94212a51eb7405818247e7e 12-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug whereby, struct tag name matches a typedef/objc-class name
and hid them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42915 91177308-0d34-0410-b5e6-96231b3b80d8
amelookup-bug-1.c
amelookup-bug-2.c
243b64b0001172405ff803c61bdcaa8e98ec1552 12-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> This patch implementa objective-c's @compatibilty-alias declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42883 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-alias-printing.m
dfbcce2b55ca8b45ce9d9c09c32e43c3bd73ac2a 11-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Implemented parsing of objctive-c protocol conforming type used in
an identifier statement. Fixed up pretty priting to print this type
correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42866 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-type-printing.m
3b427b3ba518f7a7293458c2d3d92eebd8458d87 11-Oct-2007 Chris Lattner <sabre@nondot.org> rename -parse-ast-print to -ast-print
rename -parse-ast-dump to -ast-dump
remove -parse-ast, which is redundant with -fsyntax-only



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42852 91177308-0d34-0410-b5e6-96231b3b80d8
ompoundStmtScope.c
rgument_redef.c
ttributes.c
ad-control.c
uiltin_classify_type.c
uiltin_types_compatible.c
har-literal-printing.c
heck_cast.c
ompound_literal.c
xx-reference.cpp
unction-decls.c
oto-ident.c
f-scope-c90.c
f-scope-c99.c
mplicit-casts.c
cu_vector_components.c
armvardecl_conversion.c
ointer-arithmetic.c
ointer_promotion.c
ecovery-1.c
ypeof.c
2d85f8ba62fd6fdcf0ae303d77112b413d412cae 10-Oct-2007 Anders Carlsson <andersca@mac.com> Emit a warning when the body of an if block is a NullStmt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42840 91177308-0d34-0410-b5e6-96231b3b80d8
ointer_promotion.c
b384d329e0b727d4f2effa28fbb9aba2ac420e7b 04-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> this patch accomodates clattner's comments on expression processing in @try-statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42611 91177308-0d34-0410-b5e6-96231b3b80d8
ncode.m
bjc-try-catch-1.m
9f3d942e9970bc8f51add390b2a2c46b5a2ab747 26-Sep-2007 Ted Kremenek <kremenek@apple.com> Removed option "-parse-ast-check" from clang driver. This is now implemented
using "-parse-ast -verify".

Updated all test cases (using a sed script) that invoked -parse-ast-check to
now use -parse-ast -verify.

Fixed a bug where using "-verify" instead of "-parse-ast-check" would not
correctly create the DiagClient needed to accumulate diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42365 91177308-0d34-0410-b5e6-96231b3b80d8
ompoundStmtScope.c
rgument_redef.c
ttributes.c
ad-control.c
uiltin_classify_type.c
uiltin_types_compatible.c
heck_cast.c
ompound_literal.c
xx-reference.cpp
oto-ident.c
f-scope-c90.c
f-scope-c99.c
mplicit-casts.c
cu_vector_components.c
armvardecl_conversion.c
ointer-arithmetic.c
ointer_promotion.c
ecovery-1.c
ypeof.c
397fcc117e5631db53879fbfcca66966088f3f07 19-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to parse objective-c's @try-statement and @throw-statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42148 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch-1.m
a65ff6c81f5b278000839988bb532114fd8c6797 06-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for parsing objective-c style method calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41731 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-messaging-1.m
0ccb27ded12fd03eb6818a880f50901bb70254fe 05-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> 1. Fix parsing of method prototype involving c-style argument declarations.
2. Fixes all allowable key-words used as selectors.
3. Template to do the messaging parse.
4. A test case for all allowable selector names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41723 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-prototype-1.m
45a566cfcbec0efd50bc737991bdfcc70e986811 27-Aug-2007 Chris Lattner <sabre@nondot.org> implement a fixme: __extension__ marker on decls in compound stmts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41473 91177308-0d34-0410-b5e6-96231b3b80d8
xtension.c
2215325a5696fb3b23551239b900559bb3018ee9 27-Aug-2007 Chris Lattner <sabre@nondot.org> Fix test/Parser/if-scope-*.c. Patch by Neil Booth!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41471 91177308-0d34-0410-b5e6-96231b3b80d8
f-scope-c90.c
f-scope-c99.c
ad7ef480b93a0d5dd23ec2202662b99465fcfa7e 25-Aug-2007 Steve Naroff <snaroff@apple.com> Change Expr::isLvalue() to properly deal with ImplicitCastExpr's.

This fixes the following bug...

t.c:1:31: error: expression is not assignable
short x; void foo(char c) { x += c; }

This case, among others are now captured in implicit-casts.c.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41402 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-casts.c
e45fa6af52d0a99ad3c6e4b58a4e4c351c987b87 25-Aug-2007 Chris Lattner <sabre@nondot.org> reenable this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41397 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.c
388577b3bd05bc1c442365b10e8960306e28a261 25-Aug-2007 Chris Lattner <sabre@nondot.org> test the parser only, not sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41395 91177308-0d34-0410-b5e6-96231b3b80d8
xpressions.c
a36ce713cff561b88f1cba5aad3f384c0fb0a249 22-Aug-2007 Chris Lattner <sabre@nondot.org> Fix a nasty C99 scope issue that Neil pointed out (for ifs)
This fixes test/Parser/control-scope.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41263 91177308-0d34-0410-b5e6-96231b3b80d8
ontrol-scope.c
2f9d5fe98ed64343116f45eb67c7048ebff4ec69 21-Aug-2007 Chris Lattner <sabre@nondot.org> add a testcase I forgot to check in long ago



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41219 91177308-0d34-0410-b5e6-96231b3b80d8
ointer-arithmetic.c
e77fd3c15c8c4a2f1225e75d5742b6ad07578913 16-Aug-2007 Steve Naroff <snaroff@apple.com> Fixed Sema::CheckEqualityOperands() and Sema::CheckRelationalOperands() to deal more
thoughtfully with incompatible pointers. This includes:

- Emit a diagnostic when two pointers aren't compatible!
- Promote one of the pointers/integers so we maintain the invariant expected by the
code generator (i.e. that the left/right types match).
- Upgrade the pointer/integer comparison diagnostic to include the types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41127 91177308-0d34-0410-b5e6-96231b3b80d8
ointer_promotion.c
c3018153a11afe91849748a93d920040a571b76c 10-Aug-2007 Chris Lattner <sabre@nondot.org> add support for a top-level __extension__ marker, implementing a todo.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41004 91177308-0d34-0410-b5e6-96231b3b80d8
xtension.c
cff944ba2616e00b8753c0630ff727889802c061 10-Aug-2007 Chris Lattner <sabre@nondot.org> fix this test to pass.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40996 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin_types_compatible.c
13b7c5ff42d6077a8d59e2c9ec9e7fedd0150ae6 09-Aug-2007 Steve Naroff <snaroff@apple.com> Finish implementing __builtin_classify_type()...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40951 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin_classify_type.c
69625f4925646669f68caa234cd9133261acaaa1 05-Aug-2007 Steve Naroff <snaroff@apple.com> Make sure the good old "function/array conversion" is done to function parameters.

This resulted in the following error...

[dylan:clang/test/Parser] admin% cat parmvardecl_conversion.c
// RUN: clang -parse-ast-check %s

void f (int p[]) { p++; }

[dylan:clang/test/Parser] admin% clang -parse-ast-check parmvardecl_conversion.c
Errors seen but not expected:
Line 3: cannot modify value of type 'int []'

With this fix, the test case above succeeds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40831 91177308-0d34-0410-b5e6-96231b3b80d8
armvardecl_conversion.c
52e3de597cf689848d1f2929cc195685608a313e 04-Aug-2007 Chris Lattner <sabre@nondot.org> fix hang in testsuite


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40799 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin_types_compatible.c
608e0ee4b4b8c313dd5e1b4407f742d8bff246b3 04-Aug-2007 Steve Naroff <snaroff@apple.com> Restrict vector component access (using "." and "[]") to variables.
Chris suggested this, since it simplifies the code generator.
If this features is needed (and we don't think it is), we can revisit.

The following test case now produces an error.
[dylan:~/llvm/tools/clang] admin% cat t.c

typedef __attribute__(( ocu_vector_type(4) )) float float4;

static void test() {
float4 vec4;

vec4.rg.g;
vec4.rg[1];
}
[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang t.c
t.c:8:12: error: vector component access limited to variables
vec4.rg.g;
^~
t.c:9:12: error: vector component access limited to variables
vec4.rg[1];
^~~
2 diagnostics generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40795 91177308-0d34-0410-b5e6-96231b3b80d8
cu_vector_components.c
d04fdd5f99f985abf2e7b7d7d4d427eebe001e55 03-Aug-2007 Steve Naroff <snaroff@apple.com> Implement __builtin_choose_expr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40794 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin_types_compatible.c
441995e92e7eba385cd7d4d79c2c455cd3c15e89 03-Aug-2007 Steve Naroff <snaroff@apple.com> Add a test case to validate code gen for typeof/builtin_types_compatible.

This test case currently generates the following unexpected warnings (when compared with gcc).

[dylan:clang/test/Parser] admin% ../../../../Debug/bin/clang -parse-ast-check builtin_types_compatible.c
Warnings seen but not expected:
Line 28: expression result unused
Line 29: expression result unused
Line 30: expression result unused
Line 31: expression result unused
Line 32: expression result unused
Line 33: expression result unused



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40789 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin_types_compatible.c
8d1a3b8ca1e5fcc4567b5a6f51d82be2e460de1c 01-Aug-2007 Steve Naroff <snaroff@apple.com> Two typeof() related changes...

- Changed the name of ASTContext::getTypeOfType(Expr*)->getTypeOfExpr().
- Remove FIXME for TypeOfExpr::getAsStringInternal(). This will work fine for printing the AST. It isn't ideal
for error diagnostics (since it's more natural to display the expressions type).

One "random" (or at least delayed:-) change...

- Changed all "ext_typecheck_*" diagnostics from EXTENSION->WARNING. Reason: Since -pedantic is now
off (by default), these diagnostics were never being emitted (which is bad). With this change, clang will
emit the warning all the time. The only downside (wrt GCC compatibility) is -pedantic-errors will not turn
this diagnostics into errors (a "feature" of making tagging them with EXTENSION). When/if this becomes
an issue, we can revisit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40676 91177308-0d34-0410-b5e6-96231b3b80d8
ypeof.c
2cb64ecc8672258eef57c616fa37717e57b78ed0 01-Aug-2007 Steve Naroff <snaroff@apple.com> Tighten up Parser::ParseTypeofSpecifier().
Add some more tests to typeof.c. Also added a couple of missing "expect" attributes that caused the test to fail.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40656 91177308-0d34-0410-b5e6-96231b3b80d8
ypeof.c
d1861fd633d5096a00777c918eb8575ea7162fe7 31-Jul-2007 Steve Naroff <snaroff@apple.com> Add parsing and AST support for GNU "typeof".
Many small changes to lot's of files.
Still some FIXME's, however the basic support is in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40631 91177308-0d34-0410-b5e6-96231b3b80d8
ypeof.c
fec0b49c3fa621fbf63e420f3d54a5bb3a0265d2 30-Jul-2007 Steve Naroff <snaroff@apple.com> Finish up semantic analysis for vector components.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40584 91177308-0d34-0410-b5e6-96231b3b80d8
cu_vector_components.c
e1b31fedbc006e6e4071bbb4f74c6116b56cfa9f 28-Jul-2007 Steve Naroff <snaroff@apple.com> Implement syntax/semantic analysis for OCU Vector Components.
Next step, AST support...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40568 91177308-0d34-0410-b5e6-96231b3b80d8
cu_vector_components.c
eca996743d1bc6681c18bbf146590fa4ee7b2b00 26-Jul-2007 Chris Lattner <sabre@nondot.org> don't expect to be able to reparse arbitrary system headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40511 91177308-0d34-0410-b5e6-96231b3b80d8
har-literal-printing.c
700204c74b455746752e851b25565ebf932f5340 24-Jul-2007 Steve Naroff <snaroff@apple.com> Fix Sema::ParseCallExpr()...it wasn't doing the default array/function promotions on it's argument types.

This resulted in the following errors when compiling promote_types_in_proto.c test...

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang test/Parser/promote_types_in_proto.c
test/Parser/promote_types_in_proto.c:7:24: error: incompatible types passing 'char *[]' to function expecting 'char *const []'
arrayPromotion(argv);
~~~~~~~~~~~~~~ ^~~~
test/Parser/promote_types_in_proto.c:8:27: error: incompatible types passing 'void (char *const [])' to function expecting 'void (char *const [])'
functionPromotion(arrayPromotion);
~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~
2 diagnostics generated.

When fixing this, noticed that both ParseCallExpr() and ParseReturnStmt() were prematurely comparing types for
equivalence. This is incorrect (since the expr. promotions haven't been done yet). To fix this, I moved the
check "down" to Sema::CheckAssignmentConstraints().

I also converted Type::isArrayType() to the modern API (since I needed it). Still more Type predicates to
convert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40475 91177308-0d34-0410-b5e6-96231b3b80d8
romote_types_in_proto.c
95cfb85ad1820117e0864712555f3aa4fdf4721a 22-Jul-2007 Chris Lattner <sabre@nondot.org> Catch goto's with a missing identifier, patch by Neil Booth.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40381 91177308-0d34-0410-b5e6-96231b3b80d8
oto-ident.c
4aa88f8d8469ced8fe04a0c411bbccc5d313e055 19-Jul-2007 Steve Naroff <snaroff@apple.com> Work towards fixing crasher with compound literals...

Before this commit, we crashed in ParseBinOp...

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang -parse-ast-check compound_literal.c
SemaExpr.cpp:1298: failed assertion `(rhs != 0) && "ParseBinOp(): missing right expression"'

With this commit, we still crash in the newly added action ParseCompoundLiteral (which is progress:-)

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang -parse-ast-check compound_literal.c
SemaExpr.cpp:478: failed assertion `(Op != 0) && "ParseCompoundLiteral(): missing expression"'

The crash go away once the actions return AST nodes. I will do this in a separate commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40032 91177308-0d34-0410-b5e6-96231b3b80d8
ompound_literal.c
16beff840865ce36794e495bce10fd0a3e473ab0 17-Jul-2007 Steve Naroff <snaroff@apple.com> Implement semantic analysis for the cast operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39943 91177308-0d34-0410-b5e6-96231b3b80d8
heck_cast.c
8bf9f079f11997df432b0b711be97b72cc497ffa 14-Jul-2007 Chris Lattner <sabre@nondot.org> Improve char literal pretty printing, patch by Keith Bauer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39846 91177308-0d34-0410-b5e6-96231b3b80d8
har-literal-printing.c
a7fa381a50bd27a2f3788a73bbf9fb7c13e8cc26 12-Jul-2007 Chris Lattner <sabre@nondot.org> update tests


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39786 91177308-0d34-0410-b5e6-96231b3b80d8
xx-casting.cpp
xpressions.c
e8fdbba7d746d6342b1b883c2014322026498ac6 12-Jul-2007 Chris Lattner <sabre@nondot.org> -pedantic no longer defaults to on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39785 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.c
2b80ec2192c74bf7927982759684bc736af0062c 12-Jul-2007 Chris Lattner <sabre@nondot.org> update test



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39784 91177308-0d34-0410-b5e6-96231b3b80d8
ecovery-1.c
5f016e2cb5d11daeb237544de1c5d59f20fe1a6e 11-Jul-2007 Reid Spencer <rspencer@reidspencer.com> Stage two of getting CFE top correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8
ompoundStmtScope.c
rgument_qualified.c
rgument_redef.c
rgument_scope.c
ttributes.c
ad-control.c
-namespace.c
xx-bool.cpp
xx-casting.cpp
xx-reference.cpp
eclarators.c
xpressions.c
unction-decls.c
ortability.c
ecovery-1.c
tatements.c
truct-recursion.c
ypes.c