summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Avoid redundant NNS qualification in constructor/destructor names.Abramo Bagnara2012-01-271-0/+1
| | | | llvm-svn: 149124
* Support decltype in member initializers.David Blaikie2012-01-241-8/+21
| | | | | | | | | | This is the last piece of N3031 (decltype in weird places) - supporting the use of decltype in a class ctor's member-initializer-list to specify the base classes to initialize. Reviewed by Richard Smith. llvm-svn: 148789
* Fix code so that a SkipUntil will ignore semicolons when skipping aRichard Trieu2012-01-211-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 148621
* Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:Richard Smith2012-01-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | - If the declarator is at the start of a line, and the previous line contained another declarator and ended with a comma, then that comma was probably a typo for a semicolon: int n = 0, m = 1, l = 2, // k = 5; myImportantFunctionCall(); // oops! - If removing the parentheses would correctly initialize the object, then produce a note suggesting that fix. - Otherwise, if there is a simple initializer we can suggest which performs value-initialization, then provide a note suggesting a correction to that initializer. Sema::Declarator now tracks the location of the comma prior to the declarator in the declaration, if there is one, to facilitate providing the note. The code to determine an appropriate initializer from the -Wuninitialized warning has been factored out to allow use in both that and -Wvexing-parse. llvm-svn: 148072
* Update C++11 scoped enumeration support to match the final proposal:Richard Smith2012-01-101-3/+4
| | | | | | | | - reject definitions of enums within friend declarations - require 'enum', not 'enum class', for non-declaring references to scoped enumerations llvm-svn: 147824
* Extend the diagnostic for a ',' at the end of a declaration where a ';' wasRichard Smith2012-01-091-4/+17
| | | | | | intended to cover C++ class definitions. llvm-svn: 147808
* Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" ↵Benjamin Kramer2011-12-231-4/+4
| | | | | | | | so this patch is surprisingly small. Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility. llvm-svn: 147221
* Use the real end of the decltype expression.David Blaikie2011-12-081-2/+1
| | | | llvm-svn: 146138
* Support decltype in nested-name-specifiers.David Blaikie2011-12-041-25/+73
| | | | llvm-svn: 145785
* When we notice that a member function is defined with "= delete" or "=Douglas Gregor2011-11-071-7/+9
| | | | | | | | | | | | default", make a note of which is used when creating the initial declaration. Previously, we would wait until later to handle default/delete as a definition, but this is too late: when adding the declaration, we already treated the declaration as "user-provided" when in fact it was merely "user-declared". Fixes PR10861 and PR10442, along with a bunch of FIXMEs. llvm-svn: 144011
* Tighten up the conditions under which we consider ourselves to beDouglas Gregor2011-11-071-7/+10
| | | | | | | entering the context of a nested-name-specifier. Fixes <rdar://problem/10397846>. llvm-svn: 143967
* Handle redundant 'typename' on base class specifications.David Blaikie2011-10-251-0/+7
| | | | llvm-svn: 142937
* Fix erroneous name-specifiers prior to decltypes better/correctly as per ↵David Blaikie2011-10-251-8/+9
| | | | | | Doug's feedback. llvm-svn: 142935
* Initialize the BaseLoc for decltype base type specifications.David Blaikie2011-10-251-0/+2
| | | | llvm-svn: 142929
* Fix cases where the optional nested-name-specifier erroneously preceeded a ↵David Blaikie2011-10-251-21/+22
| | | | | | decltype-specification when specifying a base type. llvm-svn: 142928
* Support the use of decltype for specifying base types. Fixes PR11216.David Blaikie2011-10-251-11/+27
| | | | llvm-svn: 142926
* Rework Microsoft __if_exists/__if_not_exists parsing and semanticDouglas Gregor2011-10-241-15/+18
| | | | | | | | | | | | | | | | | analysis to separate dependent names from non-dependent names. For dependent names, we'll behave differently from Visual C++: - For __if_exists/__if_not_exists at class scope, we'll just warn and then ignore them. - For __if_exists/__if_not_exists in statements, we'll treat the inner statement as a compound statement, which we only instantiate in templates where the dependent name (after instantiation) exists. This behavior is different from VC++, but it's as close as we can get without encroaching ridiculousness. The latter part (dependent statements) is not yet implemented. llvm-svn: 142864
* Add -Wc++98-compat warnings for uses of the new keywords 'alignof', 'char16_t',Richard Smith2011-10-171-0/+4
| | | | | | 'char32_t', 'constexpr', 'decltype', 'noexcept', 'nullptr' and 'static_assert'. llvm-svn: 142302
* When we end up having to parse the initializer of a C++ member earlyDouglas Gregor2011-10-171-9/+14
| | | | | | | in -fms-extensions mode, make sure we actually use that initializer after having handled the declaration. Fixes PR11150. llvm-svn: 142195
* Fixed merge-mistake where ActOnAccessSpecifier was called twice for every ↵Erik Verbruggen2011-10-171-6/+7
| | | | | | access specifier. The testcase has been changed to catch this too. llvm-svn: 142186
* Implement -Wc++98-compat warnings for the parser.Richard Smith2011-10-151-12/+19
| | | | llvm-svn: 142056
* Refactor: remove redundant check for 'final' specifier when parsing ↵Richard Smith2011-10-151-13/+4
| | | | | | class/struct definition. llvm-svn: 142054
* Rename an ExtWarn to ext_ for consistency.Richard Smith2011-10-151-1/+1
| | | | llvm-svn: 142049
* Don't warn about use of 'final' in ill-formed C++98 code which didn't useRichard Smith2011-10-151-3/+4
| | | | | | | 'final', and don't accept (then silently discard) braced init lists in C++98 new-expressions. llvm-svn: 142048
* -Wc++98-compat: warn on C++11 attributes and alignas.Richard Smith2011-10-141-0/+3
| | | | llvm-svn: 141999
* Allow for annotate attributes after access specifiers. When suchErik Verbruggen2011-10-131-5/+20
| | | | | | attributes are found, propagate them to subsequent declarations. llvm-svn: 141861
* Fix crash-on-invalid, improve error recovery, and test coverage for missing ↵David Blaikie2011-10-131-5/+16
| | | | | | colon after access specifiers in C++ llvm-svn: 141852
* Introduce BalancedDelimiterTracker, to better track open/closeDouglas Gregor2011-10-121-67/+58
| | | | | | | delimiter pairs and detect when we exceed the implementation limit for nesting depth, from Aaron Ballman! llvm-svn: 141782
* Move some bool flags out of function parameter lists.Kaelyn Uhrain2011-10-111-3/+1
| | | | llvm-svn: 141610
* Parse the initializer for a class member after handling itsDouglas Gregor2011-10-101-25/+37
| | | | | | | declarator, so that the declarator is in scope for the initializer. Fixes PR9989. llvm-svn: 141539
* Add braces around do-while body. The lack of them gives me the chillsDouglas Gregor2011-10-071-2/+2
| | | | llvm-svn: 141411
* Parse attributes written in an ObjC method parameter type asJohn McCall2011-10-011-1/+1
| | | | | | attributes on the parameter declaration. llvm-svn: 140944
* Add support for alignment-specifiers in C1X and C++11, removePeter Collingbourne2011-09-291-43/+6
| | | | | | | support for the C++0x draft [[align]] attribute and add the C1X standard header file stdalign.h llvm-svn: 140796
* Add support for parsing an attribute-specifier-seq containing multiplePeter Collingbourne2011-09-291-8/+22
| | | | | | attribute-specifiers llvm-svn: 140794
* Diagnose attempts to use 'using typename' with a non-identifier name,Douglas Gregor2011-09-261-0/+9
| | | | | | from Stepan Dyatkovskiy. Fixes PR10925. llvm-svn: 140528
* Correctly parse braced member initializers (even in delayed parsing) and ↵Sebastian Redl2011-09-241-3/+11
| | | | | | | | | | | correctly pass the information on to Sema. There's still an incorrectness in the way template instantiation works now, but that is due to a far larger underlying representational problem. Also add a test case for various list initialization cases of scalars, which test this commit as well as the previous one. llvm-svn: 140460
* Fix up comment now that 'new' is no longer a virt-specifier, from Aaron BallmanDouglas Gregor2011-09-231-1/+0
| | | | llvm-svn: 140389
* Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear ↵Francois Pichet2011-09-171-3/+3
| | | | | | | | that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag. Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag. llvm-svn: 139987
* Specializations cannot be module-hidden. Diagnose attempts to do so.Douglas Gregor2011-09-091-1/+1
| | | | llvm-svn: 139406
* __module_private__ is inherited by redeclarations of an entity, andDouglas Gregor2011-09-091-1/+1
| | | | | | must also be present of the first declaration of that entity. llvm-svn: 139384
* Modules: introduce the __module_private__ declaration specifier, whichDouglas Gregor2011-09-091-0/+1
| | | | | | | indicates that a declaration is only visible within the module it is declared in. llvm-svn: 139348
* Thread Safety: Patch to implement delayed parsing of attributes within aCaitlin Sadowski2011-09-081-4/+21
| | | | | | | | class scope. This patch was also written by DeLesley Hutchins. llvm-svn: 139301
* Add test case for defaulted copy and move structure validation.Sebastian Redl2011-09-041-1/+0
| | | | | | | | Fix bug this uncovered. Address minor comments from Doug. Enable cxx_implicit_moves feature. llvm-svn: 139101
* Support code-completion for C++ inline methods and ObjC buffering methods.Argyrios Kyrtzidis2011-09-041-6/+10
| | | | | | | | | | | | | | Previously we would cut off the source file buffer at the code-completion point; this impeded code-completion inside C++ inline methods and, recently, with buffering ObjC methods. Have the code-completion inserted into the source buffer so that it can be buffered along with a method body. When we actually hit the code-completion point the cut-off lexing or parsing. Fixes rdar://10056932&8319466 llvm-svn: 139086
* objc - Simplify switing objc decl context by usingFariborz Jahanian2011-08-221-24/+6
| | | | | | a context switching object. llvm-svn: 138248
* Restore patch I reversed in r138040. Known buildbotFariborz Jahanian2011-08-221-7/+26
| | | | | | failures are resolved. llvm-svn: 138234
* Track in the AST whether a function is constexpr.Richard Smith2011-08-151-1/+2
| | | | llvm-svn: 137653
* Parsing of C++0x lambda expressions, from John Freeman with help fromDouglas Gregor2011-08-041-3/+1
| | | | | | David Blaikie! llvm-svn: 136876
* Turn off __has_feature(is_empty) and __has_feature(is_pod) if theDouglas Gregor2011-07-301-1/+1
| | | | | | | libstdc++ hack has reverted these type traits to keywords. Icky, but fixes <rdar://problem/9836262>. llvm-svn: 136560
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-8/+8
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
OpenPOWER on IntegriCloud