summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser
Commit message (Collapse)AuthorAgeFilesLines
...
* If the declaration of a C++ member function with an inline definitionDouglas Gregor2011-04-141-0/+15
| | | | | | | 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>. llvm-svn: 129547
* Detect when the string "<::" is found in code after a cast or template name ↵Richard Smith2011-04-141-2/+32
| | | | | | | | 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. llvm-svn: 129540
* Parse an '@' in an Objective-C++ class member specification,Douglas Gregor2011-04-141-0/+15
| | | | | | | diagnosing it as an error rather than looping infinitely. Also, explicitly disallow @defs in Objective-C++. Fixes <rdar://problem/9260136>. llvm-svn: 129521
* Diagnose a missing ')' on what looks like a statement expression.John McCall2011-04-061-0/+6
| | | | | | | A situation where we can get an invalid ExprResult without an error. Fixes PR8394. Patch by Justin Bogner! llvm-svn: 128979
* Improve recovery (error + fix-it) when parsing type dependent template name ↵Francois Pichet2011-03-271-0/+24
| | | | | | | | | | | without the "template" keyword. For example: typename C1<T>:: /*template*/ Iterator<0> pos; Also the error is downgraded to an ExtWarn in Microsoft mode. llvm-svn: 128387
* fix the second part of rdar://8366474 - clang fails to parse ObjC selectors ↵Chris Lattner2011-03-261-10/+16
| | | | | | with '::', when :: isn't the first part of the selector. llvm-svn: 128344
* Add a __has_feature check for the 'availability' attributeDouglas Gregor2011-03-261-0/+5
| | | | llvm-svn: 128337
* Extend the new 'availability' attribute with support for anDouglas Gregor2011-03-261-0/+6
| | | | | | | 'unavailable' argument, which specifies that the declaration to which the attribute appertains is unavailable on that platform. llvm-svn: 128329
* Fix the recovery from missing semis on @property declarations to not consumeJohn McCall2011-03-261-0/+5
| | | | | | | | 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. llvm-svn: 128325
* Remove 'new' from virt-specifier since it's going to be removed in the next ↵Anders Carlsson2011-03-251-3/+0
| | | | | | C++0x draft llvm-svn: 128271
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 128127
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-0/+16
| | | | | | | | | 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. llvm-svn: 127915
* Parser support for noexcept specifications.Sebastian Redl2011-03-051-17/+0
| | | | llvm-svn: 127086
* Add -fcxx-exceptions to all tests that use C++ exceptions.Anders Carlsson2011-02-283-3/+3
| | | | llvm-svn: 126599
* Better parser recovery when method isFariborz Jahanian2011-02-231-0/+25
| | | | | | | errornously defined inside an objc class. // rdar://7029784 llvm-svn: 126269
* Make clang -cc1 disable Objective-C exceptions by default, and add a ↵Anders Carlsson2011-02-221-2/+2
| | | | | | | | -fobjc-exceptions flag to turn them on. Update all tests accordingly. llvm-svn: 126177
* Pass -fexceptions to all tests that use try/catch/throw.Anders Carlsson2011-02-193-3/+3
| | | | llvm-svn: 126037
* implement basic support for __label__. I wouldn't be shocked if there areChris Lattner2011-02-181-1/+25
| | | | | | | | | 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
* rename testChris Lattner2011-02-181-0/+0
| | | | llvm-svn: 125816
* Enhance the array bounds checking to work for several other constructs,Chandler Carruth2011-02-171-2/+2
| | | | | | | | | 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
* Improve parser recovery in "for" statements, from Richard Smith!Douglas Gregor2011-02-171-0/+20
| | | | llvm-svn: 125722
* OpenCL: standardise naming of test casesPeter Collingbourne2011-02-151-1/+1
| | | | llvm-svn: 125590
* OpenCL: add support for __kernel, kernel keywords and EXTENSION,Peter Collingbourne2011-02-142-0/+21
| | | | | | FP_CONTRACT pragmas. Patch originally by ARM. llvm-svn: 125475
* Reject forbidden storage class specifiers in OpenCL. Patch by George Russell!Peter Collingbourne2011-02-111-0/+9
| | | | llvm-svn: 125399
* Fix scoping of method declarations and issue Fariborz Jahanian2011-02-093-3/+3
| | | | | | | warning when same parameter name used multiple times. // rdar://8877730 llvm-svn: 125229
* Parse: add support for parsing CUDA kernel callsPeter Collingbourne2011-02-091-0/+9
| | | | llvm-svn: 125219
* Fix test for previous commitDouglas Gregor2011-02-041-3/+3
| | | | llvm-svn: 124861
* Fix a crash-on-invalid where we were trying to parse C++ constructs inDouglas Gregor2011-02-041-0/+5
| | | | | | | C, then hitting an assertion because C code shouldn't try to parse optional nested-name-specifiers. Fixes PR9137. llvm-svn: 124860
* Allow Microsoft attributes in a constructor's parameter list.Francois Pichet2011-01-311-0/+8
| | | | | | This fixes a few compile errors when parsing <regex> from MSVC 2008 with clang. llvm-svn: 124573
* Improve the extension warning for the use of ref-qualifiers, toDouglas Gregor2011-01-261-0/+10
| | | | | | | distinguish them from rvalue references. Using the rvalue-references warning was weird when the ref-qualifier was '&'. llvm-svn: 124316
* Downgrade the error about rvalue references to an extension warningDouglas Gregor2011-01-251-1/+1
| | | | | | | | 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
* Get rid of the [[final]] C++0x attribute.Anders Carlsson2011-01-231-1/+0
| | | | llvm-svn: 124083
* Improve our parse recovery on 'case blah;' and 'default;'.John McCall2011-01-221-0/+14
| | | | llvm-svn: 124025
* Fix tests to be valid.Anders Carlsson2011-01-201-4/+14
| | | | llvm-svn: 123887
* Add silly test case.Anders Carlsson2011-01-201-0/+5
| | | | llvm-svn: 123880
* Add more parser tests for the override control keywords.Anders Carlsson2011-01-201-0/+7
| | | | llvm-svn: 123875
* Parse the optional semicolon after a C++ in-class member functionDouglas Gregor2011-01-191-2/+6
| | | | | | | definition, rather than complaining about it. Problem reported by Marshall Clow. llvm-svn: 123835
* Add support for explicit constructor calls in Microsoft mode.Francois Pichet2011-01-181-0/+18
| | | | | | | | | | | | | | | | | | | 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
* Begin work on supporting "N3206: Override control: Eliminating Attributes", fromAnders Carlsson2011-01-161-0/+6
| | | | | | | | | 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
* When we're inside a functional cast, '>' is an operator. Fixes PR8912.Douglas Gregor2011-01-111-0/+3
| | | | llvm-svn: 123201
* Use Parser::ExpectAndConsume() uniformly to eat semicolons afterDouglas Gregor2011-01-052-4/+11
| | | | | | | | | 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
* More __uuidof validation:Francois Pichet2010-12-271-0/+16
| | | | | | | 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
* Improve the diagnostic and recovery for missing colons after 'case'Douglas Gregor2010-12-231-1/+9
| | | | | | | | | | | | | | | 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
* Emit an error if operator __uuidof() is called on a type with no associated ↵Francois Pichet2010-12-202-45/+49
| | | | | | GUID. llvm-svn: 122226
* Validate Microsoft's uuid attribute string.Francois Pichet2010-12-201-1/+9
| | | | llvm-svn: 122220
* Microsoft's __uuidof operator returns a lvalue.Francois Pichet2010-12-171-0/+2
| | | | llvm-svn: 122021
* When parsing something that looks like an ill-formedDouglas Gregor2010-11-191-0/+12
| | | | | | | | 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
* comparison of AltiVec vectors now gives bool result (fix for 7533)Anton Yartsev2010-11-182-18/+18
| | | | llvm-svn: 119678
* Emit a specific diagnostic when typedefing C++ bool, mirroring gcc.Argyrios Kyrtzidis2010-11-161-0/+3
| | | | | | Fixes rdar://8365458 llvm-svn: 119359
* Issues good diagnostic when @end is missing.Fariborz Jahanian2010-11-091-0/+10
| | | | | | // rdar://8283484 llvm-svn: 118629
OpenPOWER on IntegriCloud