summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix five more cases of tokens which can legally follow a type specifier.Richard Smith2013-01-191-2/+13
| | | | llvm-svn: 172886
* Fix parsing of class specifiers before '\n' 'operator'.Nico Weber2013-01-181-0/+1
| | | | | | | | | | | | | 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. llvm-svn: 172834
* ArrayRef-ize some ctor initializer related APIsDavid Blaikie2013-01-171-2/+1
| | | | llvm-svn: 172701
* Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith2013-01-171-1/+8
| | | | | | | | 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). llvm-svn: 172691
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Tighten types a bit. No functionality change.Rafael Espindola2013-01-081-1/+1
| | | | llvm-svn: 171894
* Add fixit hints for misplaced C++11 attributes around class specifiers.Michael Han2013-01-071-8/+45
| | | | | | | | | | 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. llvm-svn: 171757
* s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few ↵Richard Smith2013-01-021-23/+23
| | | | | | nearby 'C++0x' comments. llvm-svn: 171372
* 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
OpenPOWER on IntegriCloud