summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
* Handle decltype keyword in Parser::isDeclarationSpecifier.Francois Pichet2011-06-191-0/+4
| | | | | | Fixes PR10154. Found by parsing MFC 2010 code with clang. llvm-svn: 133380
* Remove dead variables.Benjamin Kramer2011-06-181-1/+0
| | | | llvm-svn: 133346
* Only accept __bridge_retain in system headers, as Doug suggested.John McCall2011-06-171-5/+17
| | | | llvm-svn: 133300
* As a hopefully temporary workaround for a header mistake, treatJohn McCall2011-06-171-1/+2
| | | | | | __bridge_retain as a synonym for __bridge_retained. llvm-svn: 133295
* Automatic Reference Counting.John McCall2011-06-153-5/+73
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Remove the Fix-it for missing statement in switchesDavid Majnemer2011-06-141-6/+4
| | | | llvm-svn: 132994
* Improve the diagnostics generated for switch statements missing expressionsDavid Majnemer2011-06-131-4/+7
| | | | | | | - Move the diagnostic to the case statement instead of at the end of the switch - Add a fix-it hint as to how to fix the compilation error llvm-svn: 132903
* Correct the spelling of instantiationDavid Majnemer2011-06-131-1/+1
| | | | llvm-svn: 132901
* 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-113-42/+249
| | | | llvm-svn: 132878
* Implement Objective-C Related Result Type semantics.Douglas Gregor2011-06-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related result types apply Cocoa conventions to the type of message sends and property accesses to Objective-C methods that are known to always return objects whose type is the same as the type of the receiving class (or a subclass thereof), such as +alloc and -init. This tightens up static type safety for Objective-C, so that we now diagnose mistakes like this: t.m:4:10: warning: incompatible pointer types initializing 'NSSet *' with an expression of type 'NSArray *' [-Wincompatible-pointer-types] NSSet *array = [[NSArray alloc] init]; ^ ~~~~~~~~~~~~~~~~~~~~~~ /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1: note: instance method 'init' is assumed to return an instance of its receiver type ('NSArray *') - (id)init; ^ It also means that we get decent type inference when writing code in Objective-C++0x: auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil]; // ^ now infers NSMutableArray* rather than id llvm-svn: 132868
* Restore 'atomic' as an attribute of objcFariborz Jahanian2011-06-111-0/+2
| | | | | | properties. llvm-svn: 132866
* Remove 'atomic' as a property attribute keyword.Fariborz Jahanian2011-06-081-2/+0
| | | | | | | It is not a sanctioned keyword and is assumed as default. // rdar://8790791 llvm-svn: 132753
* Parse C++0x generalized initializers.Sebastian Redl2011-06-054-51/+123
| | | | llvm-svn: 132662
* Add support for builtin astype:Tanya Lattner2011-06-041-0/+30
| | | | | | | __builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types. Added test case. llvm-svn: 132612
* 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-252-2/+69
| | | | | | | | | | | | | | | | 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 explicit specialization of explicitly-defaulted constructors.Alexis Hunt2011-05-231-68/+39
| | | | | | | | The general out-of-line case (including explicit instantiation mostly works except that the definition is being lost somewhere between the AST and CodeGen, so the definition is never emitted. llvm-svn: 131933
* Implement __underlying_type for libc++.Alexis Hunt2011-05-194-0/+50
| | | | llvm-svn: 131633
* Implement the __is_trivially_copyable type traitAlexis Hunt2011-05-133-0/+6
| | | | llvm-svn: 131270
* Properly parse the 'default' and 'delete' keywords.Alexis Hunt2011-05-124-32/+156
| | | | | | | | | | | | | | | | | 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-112-4/+16
| | | | | | | | | | | | | class scope. This removes 2 errors when parsing MFC code with clang Example: class A { virtual void f() = 0 { } } llvm-svn: 131175
* Rename "hasTrivialConstructor" to "hasTrivialDefaultConstructor" andAlexis Hunt2011-05-091-1/+2
| | | | | | | modify the semantics slightly to accomodate default constructors (I hope). llvm-svn: 131087
* Don't fail at parsing __declspec(property(get=get_func_name)). Just skip ↵Francois Pichet2011-05-071-0/+8
| | | | | | everything inside property() for now while we wait for the BoostPro people to provide a complete patch. llvm-svn: 131053
* Add support for _if_exists and __if_not_exists at namespace/global scope.Francois Pichet2011-05-072-37/+87
| | | | llvm-svn: 131050
* Per Richard's suggestion, rename DefLoc to DefaultLoc where it appears.Alexis Hunt2011-05-062-9/+7
| | | | llvm-svn: 131018
* Add support for Microsoft __if_exists and __if_not_exists construct inside ↵Francois Pichet2011-05-061-0/+70
| | | | | | | | | | | | function definition. Allow to include or exclude code depending on if a symbol exists or not. Just like a #ifdef but for C/C++ symbols. More doc: http://msdn.microsoft.com/en-us/library/x7wy9xh3(v=VS.100).aspx Support at class and namespace scopes will be added later. llvm-svn: 131014
* Do defaulted constructors properly.Alexis Hunt2011-05-062-1/+14
| | | | | | | | 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-062-18/+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-052-15/+41
| | | | llvm-svn: 130953
* Implement some framework for defaulted constructors.Alexis Hunt2011-05-052-1/+18
| | | | | | There's some unused stuff for now. llvm-svn: 130912
* Remove unused but set variable.Benjamin Kramer2011-05-031-1/+0
| | | | llvm-svn: 130776
* Fix a double free when parsing malformed code. Fixes rdar://9173693.Argyrios Kyrtzidis2011-05-031-2/+5
| | | | llvm-svn: 130775
* 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
* Remove the type traits UTT_IsLvalueExpr and UTT_IsRvalueExpr.Chandler Carruth2011-05-011-2/+0
| | | | | | | | | | | As might be surmised from their names, these aren't type traits, they're expression traits. Amazingly enough, they're expression traits that we have, and fully implement. These "type" traits are even parsed from the same tokens as the expression traits. Luckily, the parser only tried the expression trait parsing for these tokens, so this was all just a pile of dead code. llvm-svn: 130643
* 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
* libstdc++ 4.4 uses __is_signed as an identifier, while Clang treats itDouglas Gregor2011-04-281-0/+18
| | | | | | | | | | | | | as a keyword for the __is_signed type trait. Cope with this conflict via some hackish recovery: if we see a declaration of the form static const bool __is_signed then we stop treating __is_signed as a keyword and instead treat it as an identifier. It's ugly, but it's better than making the __is_signed type trait conditional on some language flag. Fixes PR9804. llvm-svn: 130399
* SEH was crashing under -fms-extensions.Francois Pichet2011-04-281-6/+11
| | | | llvm-svn: 130377
* Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin ↵Francois Pichet2011-04-284-0/+19
| | | | | | | | | | | | | | defines to real types. Otherwise statements like: __int64 var = __int64(0); would be expanded to: long long var = long long(0); and fail to compile. llvm-svn: 130369
* Parsing/AST support for Structured Exception HandlingJohn Wiegley2011-04-284-16/+199
| | | | | | | | Patch authored by Sohail Somani. Provide parsing and AST support for Windows structured exception handling. llvm-svn: 130366
* Implementation of Embarcadero array type traitsJohn Wiegley2011-04-282-0/+61
| | | | | | | | | | Patch authored by John Wiegley. These are array type traits used for parsing code that employs certain features of the Embarcadero C++ compiler: __array_rank(T) and __array_extent(T, Dim). llvm-svn: 130351
* t/clang/type-traitsJohn Wiegley2011-04-273-20/+99
| | | | | | | | | | 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
* Introduce a new parser annotation token for primary expressions. WhenDouglas Gregor2011-04-272-27/+20
| | | | | | | ClassifyName() builds a primary expression, generate one of these annotation tokens rather than jumping into the parser. llvm-svn: 130297
* Clean out some cruft I introduced when adding Sema::ClassifyName()Douglas Gregor2011-04-272-26/+0
| | | | llvm-svn: 130295
* Simplify the parser's handling of Sema::ClassifyName() for types, byDouglas Gregor2011-04-273-57/+7
| | | | | | | creating a type-annotation token rather than jumping into the declaration parsing. llvm-svn: 130293
OpenPOWER on IntegriCloud