summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Allow list-initialization of a local variable of class type with aDouglas Gregor2010-10-151-3/+13
| | | | | | | | flexible array member, so long as the flexibility array member is either not initialized or is initialized with an empty initializer list. Fixes <rdar://problem/8540437>. llvm-svn: 116647
* Check for ivar being a C++ object before attempting toFariborz Jahanian2010-10-151-2/+4
| | | | | | | | | find a copy constructor/assignment operator used in getter/setter synthesis. This removes an unintended diagnostics and makes objc++ consistant with objective-c. // rdar: //8550657. llvm-svn: 116631
* Report the location of the syntax error inside a macro. Fixes PR7944.Nick Lewycky2010-10-151-1/+1
| | | | llvm-svn: 116624
* When performing typo correction, keep track of whether the last lookupDouglas Gregor2010-10-151-1/+37
| | | | | | | | | we did was an acceptable lookup. If it is, then we can re-use that lookup result. If it isn't, we have to perform the lookup again. This is almost surely the cause behind the mysterious typo.m failures on some builders; we were getting the wrong lookup results returned. llvm-svn: 116586
* When we're in the context of an Objective-C message send's receiver,Douglas Gregor2010-10-151-1/+13
| | | | | | | typo correction prefers "super" over other, equivalent completions. I believe this will fix the regression on the buildbot. llvm-svn: 116574
* Diagnose C++ [class.mem]p13-14, where a class member has the same nameDouglas Gregor2010-10-152-1/+50
| | | | | | as the class itself. Fixes PR7082. llvm-svn: 116573
* fix http://llvm.org/PR8371 in the straightforward way, also adding a commentGabor Greif2010-10-151-0/+1
| | | | llvm-svn: 116570
* Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall2010-10-153-5/+5
| | | | | | ambiguous context. llvm-svn: 116567
* Don't complain about a variable within a linkage-specification that isDouglas Gregor2010-10-151-1/+1
| | | | | | initialized. Fixes PR7076. llvm-svn: 116553
* Add builtin conditional operator candidates for scoped enumerationDouglas Gregor2010-10-151-3/+12
| | | | | | types, from Alp Toker! Fixes PR8344. llvm-svn: 116549
* template-ids are looked up differently in friend declarations.John McCall2010-10-141-1/+6
| | | | llvm-svn: 116529
* When performing typo correction, look through the set of knownDouglas Gregor2010-10-142-10/+38
| | | | | | | | | | | | | | | | | | | | identifiers to determine good typo-correction candidates. Once we've identified those candidates, we perform name lookup on each of them and the consider the results. This optimization makes typo correction > 2x faster on a benchmark example using a single typo (NSstring) in a tiny file that includes Cocoa.h from a precompiled header, since we are deserializing far less information now during typo correction. There is a semantic change here, which is interesting. The presence of a similarly-named entity that is not visible can now affect typo correction. This is both good (you won't get weird corrections if the thing you wanted isn't in scope) and bad (you won't get good corrections if there is a similarly-named-but-completely-unrelated thing). Time will tell whether it was a good choice or not. llvm-svn: 116528
* Make sure that we diagnose invalid qualifiers on friend functions.Douglas Gregor2010-10-141-6/+9
| | | | llvm-svn: 116527
* Put line number on the diagnostic. //rdar: //8550657.Fariborz Jahanian2010-10-141-1/+1
| | | | llvm-svn: 116519
* Tweak the typo-correction implementation to determine correctionsDouglas Gregor2010-10-141-147/+109
| | | | | | | | | | | | | | | | | | | | | solely based on the names it sees, rather than actual declarations it gets. In essence, we determine the set of names that are "close enough" to the typo'd name. Then, we perform name lookup for each of those names, filtering out those that aren't actually visible, and typo-correct from the remaining results. Overall, there isn't much of a change in the behavior of typo correction here. The only test-suite change comes from the fact that we make good on our promise to require that the user type 3 characters for each 1 character corrected. The real intent behind this change is to set the stage for an optimization to typo correction (so that we don't need to deserialize all declarations in a translation unit) and future work in finding missing qualification ("'vector' isn't in scope; did you mean 'std::vector'?). Plus, the code is cleaner this way. llvm-svn: 116511
* Don't add the injected class name to the redeclarations chain; the chain ↵Argyrios Kyrtzidis2010-10-141-1/+3
| | | | | | | | should contain actual redeclarations, not implicits. As a bonus, now we don't deserialize it unless we need it. llvm-svn: 116504
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-143-28/+71
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Whoops. This really shouldn't compile in clang, either.John McCall2010-10-141-2/+2
| | | | llvm-svn: 116470
* Perform range restrictions on regparm when applied to a type andJohn McCall2010-10-141-0/+14
| | | | | | not a decl. llvm-svn: 116469
* Diagnose when a 'static' member function overrides a virtual functionDouglas Gregor2010-10-131-6/+24
| | | | | | in a base class. Fixes PR8168. llvm-svn: 116448
* Generalize the checking for qualification of (non-friend) classDouglas Gregor2010-10-132-17/+45
| | | | | | | | members. Provide a hard error when the qualification doesn't match the current class type, or a warning + Fix-it if it does match the current class type. Fixes PR8159. llvm-svn: 116445
* Eliminate the use of ObjCSuperExpr in code completion.Douglas Gregor2010-10-131-11/+9
| | | | llvm-svn: 116436
* There is no reason for dereferencing a pointer-to-member to requireDouglas Gregor2010-10-131-2/+5
| | | | | | | | | that the class type into which the pointer points be complete, even though the standard requires it. GCC/EDG do not require a complete type here, so we're calling this a problem with the standard. Fixes PR8328. llvm-svn: 116429
* Introduce a bit into Type that keeps track of whether there are anyDouglas Gregor2010-10-131-1/+1
| | | | | | | | | | | unnamed or local types within that type. This bit is cached along with the linkage of a type, so that it can be recomputed (e.g., when we see that a typedef has given a name to an anonymous declaration). Use this bit when checking C++03 [temp.arg.type]p2, so that we don't walk template argument types repeatedly. llvm-svn: 116413
* Fix a silly bug in the suppression of non-error diagnostics in aDouglas Gregor2010-10-131-0/+2
| | | | | | | SFINAE context, where we weren't getting the right diagnostic argument count. I blame DiagnosticBuilder's weirdness. Fixes PR8372. llvm-svn: 116411
* Eliminates a clang warning.Fariborz Jahanian2010-10-131-0/+1
| | | | llvm-svn: 116408
* Preserve the original scope when picking the right scope for a friendJohn McCall2010-10-131-2/+3
| | | | | | declaration, because we'll need it later. Hopefully fixed self-host. llvm-svn: 116399
* Support friend function declarations in local classes correctly.John McCall2010-10-132-51/+87
| | | | | | | | Fixes a crash and diagnoses the error condition of an unqualified friend which doesn't resolve to something. I'm still not certain how this is useful. llvm-svn: 116393
* Teach the warning about unnamed/local types in template arguments toDouglas Gregor2010-10-133-32/+221
| | | | | | | actually walk the template argument type to find any unnamed/local types within it. Fixes PR6784. llvm-svn: 116382
* Introduce support for emitting diagnostics (warnings + their notes)Douglas Gregor2010-10-128-57/+131
| | | | | | | | | | | | | | | that are suppressed during template argument deduction. This change queues diagnostics computed during template argument deduction. Then, if the resulting function template specialization or partial specialization is chosen by overload resolution or partial ordering (respectively), we will emit the queued diagnostics at that point. This addresses most of PR6784. However, the check for unnamed/local template arguments (which existed before this change) is still only skin-deep, and needs to be extended to look deeper into types. It must be improved to finish PR6784. llvm-svn: 116373
* Fix anon union member assignment expression's location.Devang Patel2010-10-121-1/+1
| | | | | | This is tested by anon-union.exp in gdb testsuite. llvm-svn: 116371
* Handle dependent friends more explicitly and deal with the possibilityJohn McCall2010-10-124-44/+75
| | | | | | | | of templated-scope friends by marking them invalid and white-listing all accesses until such time as we implement them. Fixes a crash, this time without a broken test case. llvm-svn: 116364
* PR8325: don't do destructor checking when a pointer is thrown.Eli Friedman2010-10-121-0/+4
| | | | llvm-svn: 116336
* Enter the context of the declared function template when performingJohn McCall2010-10-121-2/+6
| | | | | | | deduction and the final substitution, but not while substituting the explicit template arguments. Fixes rdar://problem/8537391 llvm-svn: 116332
* When finalizing a function template specialization following templateDouglas Gregor2010-10-121-7/+4
| | | | | | | | | | argument deduction, make sure to check the correctness of deduced template type arguments (which we had previously skipped) along with other kinds of template arguments. This fixes part of PR6784, but we're still swallowing the extension warning about unnamed/local template arguments. llvm-svn: 116327
* If we end up instantiating a function parameter whose default argumentDouglas Gregor2010-10-122-0/+15
| | | | | | | | | has not yet been parsed, note that the default argument hasn't been parsed and keep track of all of the instantiations of that function parameter. When its default argument does get parsed, imbue the instantiations with that default argument. Fixes PR8245. llvm-svn: 116324
* fix PR7885, rejecting invalid uses of __builtin_constant_p.Chris Lattner2010-10-121-0/+10
| | | | llvm-svn: 116317
* Pacify gcc-4.4.Duncan Sands2010-10-121-2/+4
| | | | llvm-svn: 116300
* C's comma operator performs lvalue conversion on both its operands;John McCall2010-10-121-6/+11
| | | | | | require them to have complete types. llvm-svn: 116297
* I just do what the comments tell me to do.John McCall2010-10-121-1/+2
| | | | llvm-svn: 116289
* Progress.John McCall2010-10-121-32/+65
| | | | llvm-svn: 116287
* Add some infrastructure for dealing with expressions of 'placeholder' type,John McCall2010-10-123-60/+63
| | | | | | | i.e. expressions with an internally-convenient type which should not be appearing in generally valid, complete ASTs. llvm-svn: 116281
* Eliminate the (de-)serialization of code completion results, now thatDouglas Gregor2010-10-111-154/+0
| | | | | | libclang does not support out-of-process code completion. llvm-svn: 116253
* Switch c-index-test from clang_codeComplete() over toDouglas Gregor2010-10-111-2/+4
| | | | | | | | | | clang_codeCompleteAt(). This uncovered a few issues with the latter: - ASTUnit wasn't saving/restoring diagnostic state appropriately between reparses and code completions. - "Overload" completions weren't being passed through to the client llvm-svn: 116241
* This patch does a few things in the area of objective-cFariborz Jahanian2010-10-111-25/+32
| | | | | | | | | | | properties. 1. Generates the AST for lexical info. of accessing getter/setter methods using dot-syntax notation. This fixes //rdar: //8528170. 2. Modifes rewriter to handle the AST putout in 1. 3. Supportes in rewriter ObjCImplicitSetterGetter ASTs. llvm-svn: 116237
* fix PR8217, a silent miscompilation of invalid code.Chris Lattner2010-10-101-5/+15
| | | | llvm-svn: 116166
* Allow a string literal to initialize a tail array (PR8217), patch Chris Lattner2010-10-101-1/+2
| | | | | | by Pierre Habouzit! llvm-svn: 116165
* Don't rely on a StringRef being null-terminated (it's not) for deprecation ↵Benjamin Kramer2010-10-092-12/+9
| | | | | | | | messages. Store pointer and length of the message in DelayedDiagnostic and hide the gory union details. llvm-svn: 116153
* Fix g++.dg regressions introduced at r115347 (rdar://8529993)Argyrios Kyrtzidis2010-10-091-2/+2
| | | | llvm-svn: 116144
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-088-27/+197
| | | | | | bit by me). llvm-svn: 116122
OpenPOWER on IntegriCloud