summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-8/+8
| | | | llvm-svn: 171367
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-201-4/+4
| | | | | | which is wrong here. llvm-svn: 170721
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-4/+4
| | | | | | single attribute in the future. llvm-svn: 170500
* [parser] Push a semi token for recovery only when it is actually missing.Argyrios Kyrtzidis2012-12-171-7/+9
| | | | llvm-svn: 170363
* PR14549. Don't assert if we see an incomplete decltype specifier at the end ↵Richard Smith2012-12-091-2/+1
| | | | | | of the file. llvm-svn: 169688
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-3/+3
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Implement C++11 [dcl.attr.grammar] p4: If an attribute-specifier-seq ↵Michael Han2012-11-281-1/+35
| | | | | | appertains to a friend declaration, that declaration shall be a definition. llvm-svn: 168826
* Improve diagnostic on C++11 attribute specifiers that appear at wrong ↵Michael Han2012-11-261-1/+58
| | | | | | | | | | | | | 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! llvm-svn: 168626
* Made the "expected string literal" diagnostic more expressiveAndy Gibbs2012-11-171-1/+2
| | | | llvm-svn: 168267
* PR9903: Recover from a member functon declared with the 'typedef' specifier byRichard Smith2012-11-151-9/+2
| | | | | | | dropping the specifier, just like we do for non-member functions and function templates declared 'typedef'. Patch by Brian Brooks! llvm-svn: 168108
* Fix crash on missing namespace name in namespace alias definition -- PR14085.Nico Weber2012-10-271-0/+6
| | | | | | Patch from Brian Brooks <brooks.brian@gmail.com>! llvm-svn: 166893
* In Parser::ParseDecltypeSpecifier, make sure the end location it returnsArgyrios Kyrtzidis2012-10-261-2/+15
| | | | | | | is at the end of parsed tokens when an error occurs, otherwise we'll hit an assertion when trying to annotate the decltype tokens. llvm-svn: 166826
* Handle a "#pragma options align" inside a class.Argyrios Kyrtzidis2012-10-121-0/+5
| | | | llvm-svn: 165810
* Improve C++11 attribute parsing.Michael Han2012-10-031-29/+36
| | | | | | | | - 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. llvm-svn: 165082
* Fix for r163013 regression and further __interface enhancement.John McCall2012-09-251-13/+43
| | | | | | Patch by Andy Gibbs! llvm-svn: 164590
* Recover properly after a parse error in a static_assert declaration.Richard Smith2012-09-131-3/+4
| | | | llvm-svn: 163826
* Normalize line endings of r163013 (part 2).Joao Matos2012-08-311-37/+37
| | | | llvm-svn: 163032
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-311-35/+37
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* Fix a few -Wdocumentation warnings.Dmitri Gribenko2012-08-241-3/+0
| | | | llvm-svn: 162506
* Now that ASTMultiPtr is nothing more than a array reference, make it a ↵Benjamin Kramer2012-08-231-6/+5
| | | | | | | | MutableArrayRef. This required changing all get() calls to data() and using the simpler constructors. llvm-svn: 162501
* Remove ASTOwningVector, it doesn't own anything and provides no value over ↵Benjamin Kramer2012-08-231-2/+2
| | | | | | SmallVector. llvm-svn: 162492
* Rip out remnants of move semantic emulation and smart pointers in Sema.Benjamin Kramer2012-08-231-2/+2
| | | | | | | These were nops for quite a while and only lead to confusion. ASTMultiPtr now behaves like a proper dumb array reference. llvm-svn: 162475
* Add diagnostics for comma at end of enum and for extra semicolon at namespaceRichard Smith2012-07-231-5/+3
| | | | | | | | 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. llvm-svn: 160618
* A ':' after an enum-specifier at class scope is a bitfield, not a typo for a ↵Richard Smith2012-07-021-3/+5
| | | | | | ';'. llvm-svn: 159549
* Extend the "expected ';' after struct" logic to also apply to enums, and toRichard Smith2012-06-251-73/+83
| | | | | | struct and enum forward-declarations. llvm-svn: 159164
* Clean up a large number of C++11 attribute parse issues, including parsingAlexis Hunt2012-06-231-4/+27
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 159072
* Perform typo correction for base class specifiers.Kaelyn Uhrain2012-06-221-1/+3
| | | | llvm-svn: 159046
* Reapply r158700 and fixup patches, minus one hunk that slipped through andAlexis Hunt2012-06-191-3/+3
| | | | | | | caused a crash in an obscure case. On the plus side, it caused me to catch another bug by inspection. llvm-svn: 158767
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-191-3/+3
| | | | | | | | 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. llvm-svn: 158749
* Improve the specification of spellings in Attr.td.Alexis Hunt2012-06-191-3/+3
| | | | | | | | | | | | | | | | | Note that this is mostly a structural patch that handles the change from the old spelling style to the new one. One consequence of this is that all AT_foo_bar enum values have changed to not be based off of the first spelling, but rather off of the class name, so they are now AT_FooBar and the like (a straw poll on IRC showed support for this). Apologies for code churn. Most attributes have GNU spellings as a temporary solution until everything else is sorted out (such as a Keyword spelling, which I intend to add if someone else doesn't beat me to it). This is definitely a WIP. I've also killed BaseCheckAttr since it was unused, and I had to go through every attribute anyway. llvm-svn: 158700
* Handle C++11 attribute namespaces automatically.Alexis Hunt2012-06-181-4/+5
| | | | | | | | Now, as long as the 'Namespaces' variable is correct inside Attr.td, the generated code will correctly admit a C++11 attribute only when it has the appropriate namespace(s). llvm-svn: 158661
* PR13064: Store whether an in-class initializer uses direct or copyRichard Smith2012-06-101-10/+11
| | | | | | | initialization, and use that information to produce the right kind of initialization during template instantiation. llvm-svn: 158288
* Recognize the MS inheritance attributes and turn them into attributesJohn McCall2012-05-221-0/+17
| | | | | | | | | on the RecordDecl. Persist the MS portability type attributes and ignore them in Sema rather than the parser. Patch by João Matos! llvm-svn: 157288
* Move the warnings for extra semi-colons under -Wextra-semi. Also, addedRichard Trieu2012-05-161-11/+6
| | | | | | | | 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. llvm-svn: 156934
* Recover properly if a class member declaration starts with a scope specifierRichard Smith2012-05-091-5/+11
| | | | | | or template-id which can't be parsed. llvm-svn: 156468
* Change how we suppress access control in explicit instantiationsJohn McCall2012-05-071-7/+15
| | | | | | | | | | so that we actually accumulate all the delayed diagnostics. Do this so that we can restore those diagnostics to good standing if it turns out that we were wrong to suppress, e.g. if the tag specifier is actually an elaborated type specifier and not a declaration. llvm-svn: 156291
* Add -Wimplicit-fallthrough warning flag, which warns on fallthrough betweenRichard Smith2012-05-031-19/+21
| | | | | | | | | | | | cases in switch statements. Also add a [[clang::fallthrough]] attribute, which can be used to suppress the warning in the case of intentional fallthrough. Patch by Alexander Kornienko! The handling of C++11 attribute namespaces in this patch is temporary, and will be replaced with a cleaner mechanism in a subsequent patch. llvm-svn: 156086
* Revert most of r154844, which was disabled in r155975. Keep around theRichard Smith2012-05-021-76/+8
| | | | | | | refactorings in that revision, and some of the subsequent bugfixes, which seem to be relevant even without delayed exception specification parsing. llvm-svn: 156031
* PR12688: ParseCXXClassMemberDeclaration's sometimes-null ThisDecl takes anotherRichard Smith2012-04-291-1/+1
| | | | | | | victim. Don't crash if we have a delay-parsed exception specification for a class member which is invalid in a way which precludes building a FunctionDecl. llvm-svn: 155788
* Remove unnecessary StringRef->char*->StringRef conversion, which read ↵Benjamin Kramer2012-04-221-1/+1
| | | | | | | | uninitialized memory if the input wasn't 0-terminated. Found by valgrind. llvm-svn: 155323
* Fix regression in r154844. If necessary, defer computing adjusted destructorRichard Smith2012-04-211-0/+4
| | | | | | | exception specifications in C++11 until after we've parsed the exception specifications for nested classes. llvm-svn: 155293
* Implement the last part of C++ [class.mem]p2, delaying the parsing ofDouglas Gregor2012-04-161-16/+87
| | | | | | | | | exception specifications on member functions until after the closing '}' for the containing class. This allows, for example, a member function to throw an instance of its own class. Fixes PR12564 and a fairly embarassing oversight in our C++98/03 support. llvm-svn: 154844
* Parsing of C++11 attributes:Richard Smith2012-04-101-26/+68
| | | | | | | | | | * 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. llvm-svn: 154381
* Disambiguation of '[[':Richard Smith2012-04-101-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 '[]'. llvm-svn: 154369
* Support for definitions of member enumerations of class templates outside theRichard Smith2012-03-231-11/+4
| | | | | | | class template's definition, and for explicit specializations of such enum members. llvm-svn: 153304
* Fix a crash-on-invalid found by -Wlogical-op-parentheses.David Blaikie2012-03-121-1/+1
| | | | llvm-svn: 152559
* Fix parsing of trailing-return-type. Types are syntactically prohibited fromRichard Smith2012-03-121-17/+17
| | | | | | | | being defined here: [] () -> struct S {} does not define struct S. In passing, implement DR1318 (syntactic disambiguation of 'final'). llvm-svn: 152551
* Fix parsing of type-specifier-seq's. Types are syntactically allowed to beRichard Smith2012-03-121-14/+12
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 152549
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-22/+22
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* User-defined literals: reject string and character UDLs in all places where theRichard Smith2012-03-061-1/+8
| | | | | | | | | | 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. llvm-svn: 152098
OpenPOWER on IntegriCloud