summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* PR10359: Template declarations which define classes are not permitted to ↵Richard Smith2011-07-141-0/+5
| | | | | | | | | | | | also contain declarators. Previously we would accept code like this: template<typename T> struct S { } f() { return 0; } This case now produces a missing ';' diagnostic, since that seems like a much more likely error than an attempt to declare a function or variable in addition to the class template. Treat this llvm-svn: 135195
* Fix AST representations of alias-declarations which define tag types. Inside ↵Richard Smith2011-07-011-4/+7
| | | | | | classes, the tag types need to have an associated access specifier, and inside function definitions, they need to be included in the declarations of the DeclStmt. These issues manifested as assertions during template instantiation, and also in a WIP constexpr patch. llvm-svn: 134250
* When deciding how to parse "= something" as part of a memberDouglas Gregor2011-06-251-2/+2
| | | | | | | | | declaration, determine whether the declaration will end up declaring a function using semantic criteria (e.g., it will have function type) rather than purely syntactic criteria (e.g., it has the form of a function declarator). Fixes <rdar://problem/9670557>. llvm-svn: 133854
* Introduce DelayedCleanupPool useful for simplifying clean-up of certain ↵Argyrios Kyrtzidis2011-06-221-10/+3
| | | | | | | | | | resources that, while their lifetime is well-known and restricted, cleaning them up manually is easy to miss and cause a leak. Use it to plug the leaking of TemplateIdAnnotation objects. rdar://9634138. llvm-svn: 133610
* Don't assert on initialized typedef declarations in classes:Richard Smith2011-06-121-1/+3
| | | | | | | | | | | | struct { typedef int A = 0; }; According to the C++11 standard, this is not ill-formed, but does not have any ascribed meaning. We can't reasonably accept it, so treat it as ill-formed. Also switch C++ from an incorrect 'fields can only be initialized in constructors' diagnostic for this case to C's 'illegal initializer (only variables can be initialized)' llvm-svn: 132890
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-111-42/+120
| | | | llvm-svn: 132878
* Parse C++0x generalized initializers.Sebastian Redl2011-06-051-21/+28
| | | | llvm-svn: 132662
* Silence sign compare warning.Benjamin Kramer2011-05-261-4/+4
| | | | llvm-svn: 132146
* Add a fix-it and better error recovery for improperly nested namespaces. ↵Richard Trieu2011-05-261-7/+86
| | | | | | This will give a better error message for cases such as "namespace foo::bar::baz {}" and a suggested fix-it of "namespace foo { namespace bar { namespace baz {} } }" llvm-svn: 132138
* Add support for Microsoft __if_exists, __if_not_exists extension at class scope.Francois Pichet2011-05-251-0/+67
| | | | | | | | | | | | | | | | Example: typedef int TYPE; class C { __if_exists(TYPE) { TYPE a; } __if_not_exists(TYPE) { this will never be parsed. } }; llvm-svn: 132052
* Implement a new type node, UnaryTransformType, designed to represent aAlexis Hunt2011-05-241-1/+1
| | | | | | | | type that turns one type into another. This is used as the basis to implement __underlying_type properly - with TypeSourceInfo and proper behavior in the face of templates. llvm-svn: 132017
* Implement __underlying_type for libc++.Alexis Hunt2011-05-191-0/+36
| | | | llvm-svn: 131633
* Properly parse the 'default' and 'delete' keywords.Alexis Hunt2011-05-121-22/+29
| | | | | | | | | | | | | | | | | They are actually grammatically considered definitions and parsed accordingly. This fixes the outstanding bugs regarding defaulting functions after their declarations. We now really nicely diagnose the following construct (try it!) int foo() = delete, bar; Still todo: Defaulted functions other than default constructors Test cases (including for the above construct) llvm-svn: 131228
* In Microsoft mode, allow pure specifier (=0) on inline functions declared at ↵Francois Pichet2011-05-111-2/+13
| | | | | | | | | | | | | class scope. This removes 2 errors when parsing MFC code with clang Example: class A { virtual void f() = 0 { } } llvm-svn: 131175
* Per Richard's suggestion, rename DefLoc to DefaultLoc where it appears.Alexis Hunt2011-05-061-6/+6
| | | | llvm-svn: 131018
* Do defaulted constructors properly.Alexis Hunt2011-05-061-1/+10
| | | | | | | | Explictly defaultedness is correctly reflected on the AST, but there are no changes to how that affects the definition of functions or much else really. llvm-svn: 130974
* Revert r130912 in order to approach defaulted functions from the otherAlexis Hunt2011-05-061-13/+1
| | | | | | | direction and not introduce things in the wrong place three different times. llvm-svn: 130968
* Slight tweak to alias template error handling: don't guess that a ↵Richard Smith2011-05-051-1/+2
| | | | | | template-id in an alias declaration was meant to be a specialization. Use a generic, but more accurate, diagnostic. llvm-svn: 130961
* Implement support for C++0x alias templates.Richard Smith2011-05-051-11/+37
| | | | llvm-svn: 130953
* Implement some framework for defaulted constructors.Alexis Hunt2011-05-051-1/+13
| | | | | | There's some unused stuff for now. llvm-svn: 130912
* When parsing a template friend declaration we dropped the templateChandler Carruth2011-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | parameters on the floor in certain cases: class X { template <typename T> friend typename A<T>::Foo; }; This was parsed as a *non* template friend declaration some how, and received an ExtWarn. Fixing the parser to actually provide the template parameters to the freestanding declaration parse triggers the code which specifically looks for such constructs and hard errors on them. Along the way, this prevents us from trying to instantiate constructs like the above inside of a outer template. This is important as loosing the template parameters means we don't have a well formed declaration and template instantiation will be unable to rebuild the AST. That fixes a crash in the GCC test suite. llvm-svn: 130772
* Fixed source range for extern linkage specification without braces.Abramo Bagnara2011-05-011-0/+5
| | | | llvm-svn: 130660
* White-list yet more type trait names, since they're used asDouglas Gregor2011-04-291-10/+20
| | | | | | identifiers in libc++. llvm-svn: 130508
* libstdc++ 4.2 also uses __is_same as a struct name, which conflicts with our ↵Douglas Gregor2011-04-291-1/+2
| | | | | | new type trait __is_same llvm-svn: 130468
* Parsing/AST support for Structured Exception HandlingJohn Wiegley2011-04-281-0/+2
| | | | | | | | Patch authored by Sohail Somani. Provide parsing and AST support for Windows structured exception handling. llvm-svn: 130366
* t/clang/type-traitsJohn Wiegley2011-04-271-16/+13
| | | | | | | | | | Patch authored by John Wiegley. These type traits are used for parsing code that employs certain features of the Embarcadero C++ compiler. Several of these constructs are also desired by libc++, according to its project pages (such as __is_standard_layout). llvm-svn: 130342
* Make the invalid declarator recovery when parsing members work the same as ↵Sebastian Redl2011-04-241-1/+1
| | | | | | when parsing global decls. It's still rather broken (skipping much too far when the declarator belongs to a function definition), but at least not so broken as to mismatch braces. Tested by the removal of the fixme in the template test case. llvm-svn: 130101
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-10/+44
| | | | llvm-svn: 129567
OpenPOWER on IntegriCloud