Fariborz Jahanian
82ff1e52df
Better parser recovery when method is
...
errornously defined inside an objc class.
// rdar://7029784
llvm-svn: 126269
2011-02-23 00:11:21 +00:00
Anders Carlsson
3320e1575f
Make clang -cc1 disable Objective-C exceptions by default, and add a -fobjc-exceptions flag to turn them on.
...
Update all tests accordingly.
llvm-svn: 126177
2011-02-22 01:52:06 +00:00
Anders Carlsson
479d6f51e3
Pass -fexceptions to all tests that use try/catch/throw.
...
llvm-svn: 126037
2011-02-19 19:23:03 +00:00
Chris Lattner
43e7f31f11
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
llvm-svn: 125817
2011-02-18 02:08:43 +00:00
Chris Lattner
4ba77fa976
rename test
...
llvm-svn: 125816
2011-02-18 02:05:32 +00:00
Chandler Carruth
1af88f12a3
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.
llvm-svn: 125775
2011-02-17 21:10:52 +00:00
Douglas Gregor
230a7e60b1
Improve parser recovery in "for" statements, from Richard Smith!
...
llvm-svn: 125722
2011-02-17 03:38:46 +00:00
Peter Collingbourne
e91b2dbdf1
OpenCL: standardise naming of test cases
...
llvm-svn: 125590
2011-02-15 19:46:41 +00:00
Peter Collingbourne
7ce13fc940
OpenCL: add support for __kernel, kernel keywords and EXTENSION,
...
FP_CONTRACT pragmas. Patch originally by ARM.
llvm-svn: 125475
2011-02-14 01:42:53 +00:00
Peter Collingbourne
de32b20bdd
Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!
...
llvm-svn: 125399
2011-02-11 19:59:54 +00:00
Fariborz Jahanian
ca3566fc20
Fix scoping of method declarations and issue
...
warning when same parameter name used multiple times.
// rdar://8877730
llvm-svn: 125229
2011-02-09 22:20:01 +00:00
Peter Collingbourne
5eec5f0422
Parse: add support for parsing CUDA kernel calls
...
llvm-svn: 125219
2011-02-09 21:12:02 +00:00
Douglas Gregor
5d8b8babd5
Fix test for previous commit
...
llvm-svn: 124861
2011-02-04 11:59:47 +00:00
Douglas Gregor
0fcaac9ef3
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.
llvm-svn: 124860
2011-02-04 11:57:16 +00:00
Francois Pichet
79f3a87007
Allow Microsoft attributes in a constructor's parameter list.
...
This fixes a few compile errors when parsing <regex> from MSVC 2008 with clang.
llvm-svn: 124573
2011-01-31 04:54:32 +00:00
Douglas Gregor
a52713096d
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 '&'.
llvm-svn: 124316
2011-01-26 20:35:32 +00:00
Douglas Gregor
0098499f7d
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.
llvm-svn: 124169
2011-01-25 02:17:32 +00:00
Anders Carlsson
19588aa40b
Get rid of the [[final]] C++0x attribute.
...
llvm-svn: 124083
2011-01-23 21:07:30 +00:00
John McCall
0140bfeead
Improve our parse recovery on 'case blah;' and 'default;'.
...
llvm-svn: 124025
2011-01-22 09:28:32 +00:00
Anders Carlsson
b4801436d1
Fix tests to be valid.
...
llvm-svn: 123887
2011-01-20 05:55:43 +00:00
Anders Carlsson
511315cc55
Add silly test case.
...
llvm-svn: 123880
2011-01-20 04:07:46 +00:00
Anders Carlsson
d802266c6b
Add more parser tests for the override control keywords.
...
llvm-svn: 123875
2011-01-20 03:41:12 +00:00
Douglas Gregor
8a4db83041
Parse the optional semicolon after a C++ in-class member function
...
definition, rather than complaining about it. Problem reported by
Marshall Clow.
llvm-svn: 123835
2011-01-19 16:41:58 +00:00
Francois Pichet
6422579411
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.
llvm-svn: 123735
2011-01-18 05:04:39 +00:00
Anders Carlsson
11fdbbc1ad
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.
llvm-svn: 123606
2011-01-16 23:56:42 +00:00
Douglas Gregor
94a32477fd
When we're inside a functional cast, '>' is an operator. Fixes PR8912.
...
llvm-svn: 123201
2011-01-11 00:33:19 +00:00
Douglas Gregor
78edf99f46
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!
llvm-svn: 122855
2011-01-05 01:10:06 +00:00
Francois Pichet
b7577657cd
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.
llvm-svn: 122578
2010-12-27 01:32:00 +00:00
Douglas Gregor
0d0a965b62
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'}}
^
:
llvm-svn: 122522
2010-12-23 22:56:40 +00:00
Francois Pichet
9dddd40a1c
Emit an error if operator __uuidof() is called on a type with no associated GUID.
...
llvm-svn: 122226
2010-12-20 03:51:03 +00:00
Francois Pichet
7da1166da0
Validate Microsoft's uuid attribute string.
...
llvm-svn: 122220
2010-12-20 01:41:49 +00:00
Francois Pichet
4f64c5aa70
Microsoft's __uuidof operator returns a lvalue.
...
llvm-svn: 122021
2010-12-17 02:00:06 +00:00
Douglas Gregor
3a001f48e4
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.
llvm-svn: 119805
2010-11-19 17:10:50 +00:00
Anton Yartsev
3f8f2886c1
comparison of AltiVec vectors now gives bool result (fix for 7533)
...
llvm-svn: 119678
2010-11-18 03:19:30 +00:00
Argyrios Kyrtzidis
20ee5ae871
Emit a specific diagnostic when typedefing C++ bool, mirroring gcc.
...
Fixes rdar://8365458
llvm-svn: 119359
2010-11-16 18:18:13 +00:00
Fariborz Jahanian
dbee986290
Issues good diagnostic when @end is missing.
...
// rdar://8283484
llvm-svn: 118629
2010-11-09 20:38:00 +00:00
Chris Lattner
0786544ac5
fix PR8380, a crash on invalid due to an illogical DeclSpec SourceRange being constructed.
...
llvm-svn: 118625
2010-11-09 20:14:26 +00:00
Fariborz Jahanian
d4c5348a55
Diagnose a coherant message when @interface
...
does not terminate with @end .
// rdar: //7824372
llvm-svn: 117991
2010-11-02 00:44:43 +00:00
Abramo Bagnara
932e393fda
Treat __extension__ like ParenExpr.
...
llvm-svn: 116569
2010-10-15 07:51:18 +00:00
Douglas Gregor
b048402073
When we are missing the ',' or '>' to terminate a template parameter
...
list, complain about it! Fixes PR7053.
llvm-svn: 116551
2010-10-15 01:15:58 +00:00
Nick Lewycky
8d3a1783ba
Replace \r\n with \n in this file.
...
llvm-svn: 116312
2010-10-12 16:46:35 +00:00
Francois Pichet
c2bc5ac149
Add parsing support for Microsoft attributes. MS attributes will just be skipped and not inserted into the AST for now.
...
llvm-svn: 116203
2010-10-11 12:59:39 +00:00
Francois Pichet
d61f192b1a
Add 2 Microsoft compiler intrinsics that don't require prototypes:
...
__assume
__noop
llvm-svn: 116202
2010-10-11 12:00:10 +00:00
Francois Pichet
f804a97d4f
_inline is an alias for inline in MSVC.
...
llvm-svn: 115785
2010-10-06 13:02:48 +00:00
Chris Lattner
d7821e4ec4
enhance tentative parsing to handle ms extensions, patch by Martin Vejnar!
...
llvm-svn: 115004
2010-09-28 23:35:09 +00:00
Argyrios Kyrtzidis
40cec8326c
Revert r114316, -Wunused-value enabled by default was intended.
...
llvm-svn: 114318
2010-09-19 23:03:35 +00:00
Argyrios Kyrtzidis
3698bf1c6d
Make -Wunused-value off by default, matching GCC. Fixes rdar://7126194.
...
llvm-svn: 114316
2010-09-19 21:21:44 +00:00
John Thompson
1224061281
Added '|' delimiter to separate inline asm multiple alternative constraints for Clang side of support.
...
llvm-svn: 114253
2010-09-18 01:15:13 +00:00
John Thompson
9a587aaaa9
Add more error checking to attribute vecreturn
...
llvm-svn: 114251
2010-09-18 01:12:07 +00:00
Francois Pichet
9f4f2078d6
Microsoft's __uuidof operator implementation part 1.
...
llvm-svn: 113356
2010-09-08 12:20:18 +00:00