summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* When folding the size of a global scope VLA to a constant, require the arrayRichard Smith2011-12-071-5/+2
| | | | | | | bound to not have side effects(!). Add constant-folding support for expressions of void type, to ensure that we can still fold ((void)0, 1) as an array bound. llvm-svn: 146000
* objc: issue deprecated/unavailable diagnostic whenFariborz Jahanian2011-12-072-8/+12
| | | | | | | methods with these attributes are sent to receivers of 'id' type too. // rdar://10459930 llvm-svn: 145999
* Suggest typo corrections for implicit function declarations.Hans Wennborg2011-12-061-1/+25
| | | | | | | A mistyped function call becomes an inmplicit function declaration in C. Suggest typo correction when one can be found. llvm-svn: 145930
* Extend warnings for missing '@end'.Erik Verbruggen2011-12-061-15/+32
| | | | | | Fixes PR2709. llvm-svn: 145928
* Switch a cast to a dyn_cast and check the pointer before using. Fixes a crashRichard Trieu2011-12-061-4/+5
| | | | | | | | | | in the following code: void test4(bool (&x)(void)) { while (x); } llvm-svn: 145918
* Make sure we perform lvalue-to-rvalue conversions for enum initializers. ↵Eli Friedman2011-12-061-0/+3
| | | | | | PR11484. llvm-svn: 145874
* objc: put out more coherent warning when method definitionFariborz Jahanian2011-12-061-1/+3
| | | | | | attributes don't match its declaration. // rdar://10529259. llvm-svn: 145872
* Add a warning for implicit conversion from function literals (and staticLang Hames2011-12-051-0/+19
| | | | | | | | | | | | | methods) to bool. E.g. void foo() {} if (f) { ... // <- Warns here. } Only applies to non-weak functions, and does not apply if the function address is taken explicitly with the addr-of operator. llvm-svn: 145849
* Support decltype in nested-name-specifiers.David Blaikie2011-12-041-0/+23
| | | | llvm-svn: 145785
* Move block return type inference diagnostic to a common place whereFariborz Jahanian2011-12-031-14/+15
| | | | | | Function or array lvalue conversions happens. llvm-svn: 145782
* Implement support for the __is_final type trait, to determine whetherDouglas Gregor2011-12-031-0/+7
| | | | | | | a class is marked 'final', from Alberto Ganesh Barbati! Fixes PR11462. llvm-svn: 145775
* If block literal return type is not specified, return type of the block is Fariborz Jahanian2011-12-033-2/+16
| | | | | | | inferred from return types. All the return statements have to agree about the type. // rdar://10466373 llvm-svn: 145774
* In Microsoft mode, don't perform typo correction in a template member ↵Francois Pichet2011-12-031-0/+7
| | | | | | | | | | function dependent context because it interferes with the "lookup into dependent bases of class templates" feature. Basically typo correction will try to offer a correction instead of looking into type dependent base classes. I found this problem while parsing Microsoft ATL code with clang. llvm-svn: 145772
* Implement overload resolution for reference-typed parameters supplied with ↵Sebastian Redl2011-12-031-3/+65
| | | | | | initializer lists. llvm-svn: 145769
* When we treat an #include or #import as a module import, create anDouglas Gregor2011-12-021-1/+2
| | | | | | | implicit ImportDecl in the translation unit to record the presence of the import. llvm-svn: 145727
* Introduce a module import declaration, so that we properly represent, e.g.,Douglas Gregor2011-12-021-3/+18
| | | | | | | | __import_module__ std.vector; in the AST. llvm-svn: 145725
* Revert r145697 and dependent patch r145702. It added a dependency fromNick Lewycky2011-12-021-1/+1
| | | | | | lib/Analysis to lib/Sema which is cyclical. llvm-svn: 145724
* Make sure that name lookup in C checks whether a name is hidden.Douglas Gregor2011-12-021-0/+5
| | | | llvm-svn: 145700
* Make conversion specifier warning refer to typedef if possible.Hans Wennborg2011-12-021-1/+1
| | | | | | | | For example, the warning for printf("%zu", 42.0); changes from "conversion specifies type 'unsigned long'" to "conversion specifies type 'size_t' (aka 'unsigned long')" llvm-svn: 145697
* Implementing parsing and resolution of module export declarationsDouglas Gregor2011-12-021-1/+27
| | | | | | | | within module maps, which will (eventually) be used to re-export a module from another module. There are still some pieces missing, however. llvm-svn: 145665
* Introduce the notion of name visibility into modules. For a givenDouglas Gregor2011-12-011-1/+2
| | | | | | | | | | | | | | (sub)module, all of the names may be hidden, just the macro names may be exposed (for example, after the preprocessor has seen the import of the module but the parser has not), or all of the names may be exposed. Importing a module makes its names, and the names in any of its non-explicit submodules, visible to name lookup (transitively). This commit only introduces the notion of name visible and marks modules and submodules as visible when they are imported. The actual name-hiding logic in the AST reader will follow (along with test cases). llvm-svn: 145586
* When typo-correction an Objective-C superclass name, don'tDouglas Gregor2011-12-011-4/+9
| | | | | | typo-correct to ourselves. llvm-svn: 145583
* When sending a message to a receiver that has "unknown any" type,Douglas Gregor2011-12-012-3/+16
| | | | | | | force the unknown any type to "id" so that the message send can be completed without requiring a case. Fixes <rdar://problem/10506646>. llvm-svn: 145552
* Specially whitelist the selector 'addOperationWithBlock:' for the ↵Ted Kremenek2011-12-011-1/+7
| | | | | | | | retain-cycle checking in -Warc-retain-cycles. This commonly is hit by users using NSOperationQueue. Fixes <rdar://problem/10465721>. llvm-svn: 145548
* Further tweak -Wurneachable-code and templates by allowing the warning to run onTed Kremenek2011-12-011-14/+6
| | | | | | | | | explicit template specializations (which represent actual functions somebody wrote). Along the way, refactor some other code which similarly cares about whether or not they are looking at a template instantiation. llvm-svn: 145547
* Promote ModuleMap::Module to a namespace-scope class in the BasicDouglas Gregor2011-11-301-3/+3
| | | | | | | | | library, since modules cut across all of the libraries. Rename serialization::Module to serialization::ModuleFile to side-step the annoying naming conflict. Prune a bunch of ModuleMap.h includes that are no longer needed (most files only needed the Module type). llvm-svn: 145538
* Don't run -Wunreachable-code on template instantiations. Different ↵Ted Kremenek2011-11-301-2/+8
| | | | | | instantiations may produce different unreachable code results, and it is very difficult for us to prove that ALL instantiations of a template have specific unreachable code. If we come up with a better solution, then we can revisit this, but this approach will at least greatly reduce the noise of this warning for code that makes use of templates. llvm-svn: 145520
* Fix the instantiation of pseudo-object expressions. This is aJohn McCall2011-11-302-2/+59
| | | | | | | | | really bad way to go about this, but I'm not sure there's a better choice without substantial changes to TreeTransform --- most notably, preserving implicit semantic nodes instead of discarding and rebuilding them. llvm-svn: 145480
* Switch the module-loading interfaces and parser from a simpleDouglas Gregor2011-11-301-5/+2
| | | | | | | top-level module name to a module path (e.g., std.vector). We're still missing a number of pieces for this actually to do something. llvm-svn: 145462
* Revert r145244. It causes us to create broken ASTs with missing type informationRichard Smith2011-11-294-179/+91
| | | | | | | | | | for some cast expressions. Original commit message: Removed useless ImplicitCast nodes in explicit cstyle and static casts llvm-svn: 145447
* Suppress -Warray-bounds for classes (not just structs) where the last field isMatt Beaumont-Gay2011-11-291-2/+5
| | | | | | a 1-length character array. llvm-svn: 145445
* Test isa<FunctionDecl> to exclude objective-C methods. This ensures the ↵Lang Hames2011-11-291-1/+1
| | | | | | following cast will never fail. llvm-svn: 145441
* Merge branch 'yo-dawg-i-herd-u-like-arrays'Matt Beaumont-Gay2011-11-291-0/+11
| | | | llvm-svn: 145421
* objc: warn if NSObject attribute appears other than in a typedef.Fariborz Jahanian2011-11-291-0/+4
| | | | | | // rdar://10453342 llvm-svn: 145358
* When synthesizing an implicitly-defined copy or move constructor, orDouglas Gregor2011-11-281-7/+15
| | | | | | | | when computing the exception specification of a copy or move constructor, ignore non-static data member initializers. Fixes PR11418 / <rdar://problem/10478642>. llvm-svn: 145269
* Remove code made redundant by my previous patch.Fariborz Jahanian2011-11-281-12/+1
| | | | llvm-svn: 145266
* pinpoint name/location of deprecated/unavailable enumeratorFariborz Jahanian2011-11-281-1/+8
| | | | | | | whose enum has been made deprecated/unavailable in the warning. // rdar://10201690 llvm-svn: 145264
* objc: turn warning for property type mismatch in Fariborz Jahanian2011-11-281-1/+1
| | | | | | | primary and its continuation class into error. // rdar://10142679 llvm-svn: 145255
* When checking a call to a builtin atomic operation, be sure toDouglas Gregor2011-11-281-13/+199
| | | | | | | | | consider the _<width> variants as well, which we'll see if we're performing the type checking in a template instantiation where the call expression itself was originally not type-dependent. Fixes PR11411. llvm-svn: 145248
* Removed useless ImplicitCast nodes in explicit cstyle and static castsNicola Gigante2011-11-284-91/+179
| | | | llvm-svn: 145244
* In Sema::MaybeBindToTemporary, create a CXXBindTemporaryExpr for anPeter Collingbourne2011-11-271-1/+2
| | | | | | array of objects with non-trivial destructors. PR11365. llvm-svn: 145203
* Reference initialization with initializer lists.Sebastian Redl2011-11-272-25/+212
| | | | | | This supports single-element initializer lists for references according to DR1288, as well as creating temporaries and binding to them for other initializer lists. llvm-svn: 145186
* Test commitNicola Gigante2011-11-261-0/+1
| | | | llvm-svn: 145147
* Fixed lexical declaration context when instantiating a friend / out-of-line ↵Abramo Bagnara2011-11-261-0/+7
| | | | | | class template member. llvm-svn: 145146
* In Microsoft mode, make "Unqualified lookup into dependent bases of class ↵Francois Pichet2011-11-252-3/+14
| | | | | | | | | | templates" works inside a friend function definition at class scope. Basically we have to look into the parent *lexical* DeclContext for friend functions at class scope. That's because calling GetParent() return the namespace or file DeclContext. This fixes all remaining cases of "Unqualified lookup into dependent bases of class templates" when parsing MFC code with clang. llvm-svn: 145127
* Add feature to diagnostics that will provide more information on functionRichard Trieu2011-11-234-19/+143
| | | | | | | | | | pointer mismatch. Cases covered are: initialization, assignment, and function arguments. Additional text will give the extra information about the nature of the mismatch: different classes for member functions, wrong number of parameters, different parameter type, different return type, and function qualifier mismatch. llvm-svn: 145114
* [libclang] Fix operations (token annotation, getting cursor, etc.) with a ↵Argyrios Kyrtzidis2011-11-232-1/+12
| | | | | | | | | | | | | | | file region inside an objc container that "contains" other file-level declarations. When getting the array of file-level declarations that overlap with a file region, we failed to report that the region overlaps with an objc container, if the container had other file-level declarations declared lexically inside it. Fix this by marking such declarations as "isTopLevelDeclInObjCContainer" in the AST and handling them appropriately. llvm-svn: 145109
* [libclang] Indexing API: Fix issues, mostly C++ related.Argyrios Kyrtzidis2011-11-231-2/+3
| | | | llvm-svn: 145107
* Fixed HadMultipleCandidates loading.Abramo Bagnara2011-11-192-35/+54
| | | | llvm-svn: 144995
* Fixed implicit instantiations source range.Abramo Bagnara2011-11-182-1/+6
| | | | llvm-svn: 144977
OpenPOWER on IntegriCloud