summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Work-in-progress for lambda conversion-to-block operator. Still need to ↵Eli Friedman2012-02-251-5/+11
| | | | | | implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure). llvm-svn: 151428
* Improve the diagnostic in ARC mode when a conditional with an Objective-C ↵Eli Friedman2012-02-251-0/+16
| | | | | | type and void* is used. <rdar://problem/10486347>. llvm-svn: 151416
* Bugfix: bogus warning -- "invalid use of non-static data member",DeLesley Hutchins2012-02-251-1/+2
| | | | | | | when a class is forward declared, and the reference to the data member in question does not occur within a method body. llvm-svn: 151413
* Implement C++11 [over.match.copy]p1b2, which allows the use ofDouglas Gregor2012-02-244-18/+52
| | | | | | | | | | | explicit conversion functions to initialize the argument to a copy/move constructor that itself is the subject of direct initialization. Since we don't have that much context in overload resolution, we end up threading more flags :(. Fixes <rdar://problem/10903741> / PR10456. llvm-svn: 151409
* Make helper static.Benjamin Kramer2012-02-241-1/+1
| | | | llvm-svn: 151400
* C++11 [class.ctor]p5 says thatDouglas Gregor2012-02-241-2/+6
| | | | | | | | | | | | | | | | | A defaulted default constructor for a class X is defined as deleted if [...] - X is a union and all of its variant members are of const-qualified type. A pedantic reading therefore says that union X { }; has a deleted default constructor, which is both silly and almost certainly unintended. Pretend as if this this read - X is a union with one or more variant members, and all of its variant members are of const-qualified type. llvm-svn: 151394
* Fix comment: correct predicate name, reformat comment.Dmitri Gribenko2012-02-241-5/+4
| | | | llvm-svn: 151389
* __decltype is a GNU extension, not a C++11 extension.Richard Smith2012-02-241-2/+0
| | | | llvm-svn: 151377
* Two minor, related fixes for template instantiation with blocks:Douglas Gregor2012-02-241-2/+6
| | | | | | | | | | | | - Make sure that the block expression is instantiation-dependent if the block is in a dependent context - Make sure that the C++ 'this' expression gets captured even if we don't rebuild the AST node during template instantiation. This would also have manifested as a bug for lambdas. Fixes <rdar://problem/10832617>. llvm-svn: 151372
* Sink variable into assertMatt Beaumont-Gay2012-02-241-2/+1
| | | | llvm-svn: 151356
* Kill a spurious use of hasTrivialDefaultConstructor()Douglas Gregor2012-02-241-2/+1
| | | | llvm-svn: 151353
* Implement a new type trait __is_trivially_constructible(T, Args...)Douglas Gregor2012-02-242-0/+254
| | | | | | | | | | | | | | | | that provides the behavior of the C++11 library trait std::is_trivially_constructible<T, Args...>, which can't be implemented purely as a library. Since __is_trivially_constructible can have zero or more arguments, I needed to add Yet Another Type Trait Expression Class, this one handling arbitrary arguments. The next step will be to migrate UnaryTypeTrait and BinaryTypeTrait over to this new, more general TypeTrait class. Fixes the Clang side of <rdar://problem/10895483> / PR12038. llvm-svn: 151352
* Modernize some code which processes CastExprs to use CastKinds. No intended ↵Eli Friedman2012-02-231-29/+21
| | | | | | functional change. llvm-svn: 151298
* objective-c++: Type of an objc string literal is NSString, not 'id'.Fariborz Jahanian2012-02-231-3/+15
| | | | | | // rdar://10907410 llvm-svn: 151296
* Turned on support for __declspecs: noreturn, noinline, nothrow and naked in ↵Aaron Ballman2012-02-231-4/+13
| | | | | | MS compatibility mode. llvm-svn: 151295
* Pull the OpaqueValueExpr's source expression into its constructor, soDouglas Gregor2012-02-232-3/+4
| | | | | | that we can correctly compute value-dependence of the OVE. llvm-svn: 151291
* [libclang] Make sure that all top-level decls in a @implementation areArgyrios Kyrtzidis2012-02-231-0/+19
| | | | | | | | marked as such. Previously we missed tag declarations; fixes rdar://10902015 llvm-svn: 151283
* objective-c default synthesis. classes which adopt protocol propertiesFariborz Jahanian2012-02-231-1/+2
| | | | | | | must still auto synthesize those propeties which have been redeclared in the class. // rdar://10907410 llvm-svn: 151268
* Replace some DenseSets with SmallPtrSets. Apart from the "small" ↵Benjamin Kramer2012-02-232-6/+4
| | | | | | optimization, the current implementation is also a denser. llvm-svn: 151257
* Replace the std::map in the init list checker with a DenseMap to reduce ↵Benjamin Kramer2012-02-231-3/+3
| | | | | | malloc thrashing. llvm-svn: 151254
* Provide the __is_trivially_assignable type trait, which providesDouglas Gregor2012-02-231-0/+49
| | | | | | | compiler support for the std::is_trivially_assignable library type trait. llvm-svn: 151240
* Two fixes to how we compute visibility:Rafael Espindola2012-02-231-0/+1
| | | | | | | | | | | | * Handle some situations where we should never make a decl more visible, even when merging in an explicit visibility. * Handle attributes in members of classes that are explicitly specialized. Thanks Nico for the report and testing, Eric for the initial review, and dgregor for the awesome test27 :-) llvm-svn: 151236
* Try to handle qualifiers more consistently for array InitListExprs. Fixes ↵Eli Friedman2012-02-232-5/+8
| | | | | | | | <rdar://problem/10907510>, and makes the ASTs a bit more self-consistent. (I've chosen to keep the qualifiers, but it isn't a strong preference; if anyone prefers removing them, please yell.) llvm-svn: 151229
* Turned on support for __declspec(deprecated) in MS compatibility mode.Aaron Ballman2012-02-231-1/+2
| | | | llvm-svn: 151225
* Doug's review comments.Sebastian Redl2012-02-221-1/+1
| | | | llvm-svn: 151173
* Teach overload resolution to prefer user-defined conversion via aDouglas Gregor2012-02-221-0/+48
| | | | | | | | | | lambda closure type's function pointer conversion over user-defined conversion via a lambda closure type's block pointer conversion, always. This is a preference for more-standard code (since blocks are an extension) and a nod to efficiency, since function pointers don't require any memory management. Fixes PR12063. llvm-svn: 151170
* Fix parsing and processing initializer lists in return statements and as ↵Sebastian Redl2012-02-222-7/+33
| | | | | | direct member initializers. llvm-svn: 151155
* Warn about non-standard format strings (pr12017)Hans Wennborg2012-02-221-2/+60
| | | | | | | | | This adds the -Wformat-non-standard flag (off by default, enabled by -pedantic), which warns about non-standard things in format strings (such as the 'q' length modifier, the 'S' conversion specifier, etc.) llvm-svn: 151154
* More ArrayRef-ification of methods.Bill Wendling2012-02-221-1/+1
| | | | llvm-svn: 151152
* ArrayRef-icize the function arguments.Bill Wendling2012-02-223-5/+4
| | | | llvm-svn: 151151
* Throw away stray CXXDefaultArgExprs. Fixes PR12061.Sebastian Redl2012-02-221-0/+7
| | | | | | I think there's a deeper problem here in the way TransformCXXConstructExpr works, but I won't tackle it now. llvm-svn: 151146
* Generate an AST for the conversion from a lambda closure type to aDouglas Gregor2012-02-223-14/+85
| | | | | | | | | | | | | | | block pointer that returns a block literal which captures (by copy) the lambda closure itself. Some aspects of the block literal are left unspecified, namely the capture variable (which doesn't actually exist) and the body (which will be filled in by IRgen because it can't be written as an AST). Because we're switching to this model, this patch also eliminates tracking the copy-initialization expression for the block capture of the conversion function, since that information is now embedded in the synthesized block literal. -1 side tables FTW. llvm-svn: 151131
* Implement C++11 [expr.call]p11: If the operand to a decltype-specifier is aRichard Smith2012-02-225-12/+125
| | | | | | | | | | | | | | | | | | function call (or a comma expression with a function call on its right-hand side), possibly parenthesized, then the return type is not required to be complete and a temporary is not bound. Other subexpressions inside a decltype expression do not get this treatment. This is implemented by deferring the relevant checks for all calls immediately within a decltype expression, then, when the expression is fully-parsed, checking the relevant constraints and stripping off any top-level temporary binding. Deferring the completion of the return type exposed a bug in overload resolution where completion of the argument types was not attempted, which is also fixed by this change. llvm-svn: 151117
* Don't crash on attempts to synthesize an invalid property.John McCall2012-02-211-0/+1
| | | | | | rdar://problem/10904479 llvm-svn: 151089
* Only pop the expression evaluation context corresponding to a lambdaDouglas Gregor2012-02-211-5/+1
| | | | | | | | | expression after we've finished the function body of the corresponding function call operator. Otherwise, ActOnFinishFunctionBody() will see the (unfinished) evaluation context of the lambda expression itself. Fixes PR12031. llvm-svn: 151082
* When calling a non variadic format function(vprintf, vscanf, NSLogv, …), ↵Jean-Daniel Dupas2012-02-211-7/+21
| | | | | | warn if the format string argument is a parameter that is not itself declared as a format string with compatible format. llvm-svn: 151080
* Improve our handling of lambda expressions that occur within defaultDouglas Gregor2012-02-212-7/+34
| | | | | | | | | | | | | | | | | | | arguments. There are two aspects to this: - Make sure that when marking the declarations referenced in a default argument, we don't try to mark local variables, both because it's a waste of time and because the semantics are wrong: we're not in a place where we could capture these variables again even if it did make sense. - When a lambda expression occurs in a default argument of a function template, make sure that the corresponding closure type is considered dependent, so that it will get properly instantiated. The second bit is a bit of a hack; to fix it properly, we may have to rearchitect our handling of default arguments, parsing them only after creating the function definition. However, I'd like to separate that work from the lambdas work. llvm-svn: 151076
* Remove comma from end of enum to silence build warning.Craig Topper2012-02-211-1/+1
| | | | llvm-svn: 151036
* Implement non-internal linkage for lambda closure types that need aDouglas Gregor2012-02-211-5/+34
| | | | | | | | | stable mangling, since these lambdas can end up in multiple translation units. Sema is responsible for deciding when this is the case, because it's already responsible for choosing the mangling number. llvm-svn: 151029
* Implement name mangling for lambda expressions that occur within theDouglas Gregor2012-02-212-9/+35
| | | | | | initializers of data members (both static and non-static). llvm-svn: 151017
* Implement name mangling for lambda expressions that occur within theDouglas Gregor2012-02-214-7/+40
| | | | | | | | | | | | | | | | default arguments of function parameters. This simple-sounding task is complicated greatly by two issues: (1) Default arguments aren't actually a real context, so we need to maintain extra state within lambda expressions to track when a lambda was actually in a default argument. (2) At the time that we parse a default argument, the FunctionDecl doesn't exist yet, so lambda closure types end up in the enclosing context. It's not clear that we ever want to change that, so instead we introduce the notion of the "effective" context of a declaration for the purposes of name mangling. llvm-svn: 151011
* Make RequireLiteralType work correctly with incomplete array types. PR12037.Eli Friedman2012-02-201-2/+8
| | | | llvm-svn: 151005
* Fix a constexpr FIXME: When implicitly instantiating the primary template for anRichard Smith2012-02-202-7/+8
| | | | | | | explicit specialization of a function template, mark the instantiation as constexpr if the specialization is, rather than requiring them to match. llvm-svn: 151001
* Make sure that we set up the right declaration contexts when creatingDouglas Gregor2012-02-201-2/+2
| | | | | | | | | and introducing the lambda closure type and its function call operator. Previously, we assumed that the lambda closure type would land directly in the current context, and not some parent context (as occurs with linkage specifications). Thanks to Richard for the test case. llvm-svn: 150987
* modern objc translator. Finish off first cut of theFariborz Jahanian2012-02-201-0/+4
| | | | | | | modern meta-data translation by commenting out private ivar declarations in user source. Also, added several tests. llvm-svn: 150985
* When we resolve the type of an 'auto' variable, clear out the linkageDouglas Gregor2012-02-201-1/+2
| | | | | | | of that variable; it will need to be recomputed with the resolved type. llvm-svn: 150984
* Basic support for name mangling of C++11 lambda expressions. BecauseDouglas Gregor2012-02-202-3/+14
| | | | | | | | | | | | | | | name mangling in the Itanium C++ ABI for lambda expressions is so dependent on context, we encode the number used to encode each lambda as part of the lambda closure type, and maintain this value within Sema. Note that there are a several pieces still missing: - We still get the linkage of lambda expressions wrong - We aren't properly numbering or mangling lambda expressions that occur in default function arguments or in data member initializers. - We aren't (de-)serializing the lambda numbering tables llvm-svn: 150982
* Emit a warning when list-initializing a std::initializer_list member.Sebastian Redl2012-02-192-1/+10
| | | | llvm-svn: 150933
* Add a testcase for using objects with list-constructors, and fix a Sema ↵Sebastian Redl2012-02-191-5/+17
| | | | | | crash by repeating an old hack. llvm-svn: 150925
* Fix a crash for nested initializer list initialization. Still does the wrong ↵Sebastian Redl2012-02-191-10/+19
| | | | | | thing in CodeGen, in that it never destructs anything. llvm-svn: 150922
OpenPOWER on IntegriCloud