summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.h
Commit message (Collapse)AuthorAgeFilesLines
* Access checking for overloaded operators.John McCall2010-01-281-0/+2
| | | | llvm-svn: 94725
* Add placeholder function in Sema for new format string checking logic.Ted Kremenek2010-01-281-0/+7
| | | | | | | | This function will use the format string parsing logic in libAnalysis, and once it is shown to be better than the current implementation it will replace AlternateCheckPrintfString() entirely. llvm-svn: 94721
* Implement access-check delays for out-of-line member definitionsJohn McCall2010-01-271-4/+56
| | | | | | using the same framework we use for deprecation warnings. llvm-svn: 94659
* Implement access control for overloaded functions. Suppress access controlJohn McCall2010-01-271-9/+15
| | | | | | | diagnostics in "early" lookups, such as during typename checks and when building unresolved lookup expressions. llvm-svn: 94647
* Handle redeclarations found by ADL deterministically and reasonably.John McCall2010-01-261-3/+2
| | | | | | | | | This solution relies on an O(n) scan of redeclarations, which means it might scale poorly in crazy cases with tons of redeclarations brought in by a ton of distinct associated namespaces. I believe that avoiding this is not worth the common-case cost. llvm-svn: 94530
* Preserve access bits through overload resolution much better. SomeJohn McCall2010-01-261-7/+13
| | | | | | general refactoring in operator resolution. llvm-svn: 94498
* Pass access specifiers around in overload resolution.John McCall2010-01-261-4/+12
| | | | llvm-svn: 94485
* Implement instantiation of AsmStmts (Crazy, I know)Anders Carlsson2010-01-241-1/+1
| | | | llvm-svn: 94361
* fix PR6034, a crash on invalid where the switch stack would get Chris Lattner2010-01-241-0/+2
| | | | | | unbalanced. llvm-svn: 94347
* Implement elementary access control.John McCall2010-01-231-0/+3
| | | | llvm-svn: 94268
* Patch to implement required warnings for unimplementedFariborz Jahanian2010-01-201-3/+11
| | | | | | properties imported frfom protocol. Fixes radar 7544809. llvm-svn: 93965
* Teach Sema::ActOnDependentTemplateName that a dependent template nameDouglas Gregor2010-01-191-1/+0
| | | | | | | | in a member access expression referring into the current instantiation need not be resolved at template definition *if* the current instantiation has any dependent base classes. Fixes PR6081. llvm-svn: 93877
* Preserve type source information in compound literal expressions.John McCall2010-01-181-1/+6
| | | | | | Patch by Enea Zaffanella! llvm-svn: 93752
* Mostly renaming some methods and updating comments toFariborz Jahanian2010-01-181-4/+6
| | | | | | | reflect what these methods are actually doing. One method template for future work. No change in functionality. llvm-svn: 93742
* Introduce a second queue of "local" pending implicit instantiation,Douglas Gregor2010-01-161-2/+23
| | | | | | | | | | which are instantiations of the member functions of local classes. These implicit instantiations have to occur at the same time as---and in the same local instantiation scope as---the enclosing function, since the member functions of the local class can refer to locals within the enclosing function. This should really, really fix PR5764. llvm-svn: 93666
* Keep track of the source locations for each protocol reference inDouglas Gregor2010-01-161-0/+3
| | | | | | | | Objective-C classes, protocol definitions, forward protocol declarations, and categories. This information isn't actually used yet; that's coming next. llvm-svn: 93636
* Preserve type source information for C++ named casts through templateJohn McCall2010-01-151-0/+7
| | | | | | instantiation. llvm-svn: 93533
* Don't lose type source information when rebuilding C-style cast expressions.John McCall2010-01-151-0/+5
| | | | | | Also we don't need to recheck for altivec initializers, I think. llvm-svn: 93529
* Don't repeat lookup when instantiating resolved member expressions.John McCall2010-01-151-1/+1
| | | | | | | | | | Adjust BuildMemberReferenceExpr to perform the inheritance check on implicit member accesses, which can arise from unqualified lookups and therefore may reference decls from enclosing class scopes. Fixes PR 5838. llvm-svn: 93510
* When performing qualified name lookup into the current instantiation,Douglas Gregor2010-01-151-1/+2
| | | | | | | | | | | | | do not look into base classes if there are any dependent base classes. Instead, note in the lookup result that we couldn't look into any dependent bases. Use that new result kind to detect when this case occurs, so that we can fall back to treating the type/value/etc. as a member of an unknown specialization. Fixes an issue where we were resolving lookup at template definition time and then missing an ambiguity at template instantiation time. llvm-svn: 93497
* When qualified lookup into the current instantiation fails (because itDouglas Gregor2010-01-141-0/+1
| | | | | | | | finds nothing), and the current instantiation has dependent base classes, treat the qualified lookup as if it referred to an unknown specialization. Fixes PR6031. llvm-svn: 93433
* Code-completion for @public, @protected, @private, @package.Douglas Gregor2010-01-131-0/+1
| | | | llvm-svn: 93361
* Implement semantic checking for C++ literal operators.Alexis Hunt2010-01-131-0/+2
| | | | | | | This now rejects literal operators that don't meet the requirements. Templates are not yet checked for. llvm-svn: 93315
* Add an unreachable code checker.Mike Stump2010-01-131-3/+7
| | | | llvm-svn: 93287
* When in objective-c methods, do the built-in name lookup afterFariborz Jahanian2010-01-121-1/+2
| | | | | | ivar name lookup. Fixes pr5986. llvm-svn: 93271
* Improve recovery for template-ids whose template-name doesn't actuallyDouglas Gregor2010-01-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | name a template, when they occur in a base-specifier. This is one of the (few) places where we know for sure that an identifier followed by a '<' must be a template name, so we can diagnose and recover well: test/SemaTemplate/dependent-base-classes.cpp:9:16: error: missing 'template' keyword prior to dependent template name 'T::apply' struct X1 : T::apply<U> { }; // expected-error{{missing 'template' ... ^ template test/SemaTemplate/dependent-base-classes.cpp:12:13: error: unknown template name 'vector' struct X2 : vector<T> { }; // expected-error{{unknown template name 'vector'}} ^ 2 diagnostics generated. llvm-svn: 93257
* implement PR6004, warning about divide and remainder by zero.Chris Lattner2010-01-121-1/+2
| | | | llvm-svn: 93256
* So I was sitting around, trying vainly to think of something to commit, and thenJohn McCall2010-01-121-0/+1
| | | | | | | | I said to myself, self, why don't you go add a couple of parameters to a method and then fail to use them, and I thought that sounded like a pretty good idea, so I did it. llvm-svn: 93233
* Introduce a specific representation for the ambiguous implicit conversionJohn McCall2010-01-121-0/+3
| | | | | | | sequence. Lots of small relevant changes. Fixes some serious problems with ambiguous conversions; also possibly improves associated diagnostics. llvm-svn: 93214
* Implement name lookup for conversion function template specializationsDouglas Gregor2010-01-111-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | (C++ [temp.mem]p5-6), which involves template argument deduction based on the type named, e.g., given struct X { template<typename T> operator T*(); } x; when we call x.operator int*(); we perform template argument deduction to determine that T=int. This template argument deduction is needed for template specialization and explicit instantiation, e.g., template<> X::operator float*() { /* ... */ } and when calling or otherwise naming a conversion function (as in the first example). This fixes PR5742 and PR5762, although there's some remaining ugliness that's causing out-of-line definitions of conversion function templates to fail. I'll look into that separately. llvm-svn: 93162
* Improve code completion by introducing patterns for the various C andDouglas Gregor2010-01-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | C++ grammatical constructs that show up in top-level (namespace-level) declarations, member declarations, template declarations, statements, expressions, conditions, etc. For example, we now provide a pattern for static_cast<type>(expr) when we can have an expression, or using namespace identifier; when we can have a using directive. Also, improves the results of code completion at the beginning of a top-level declaration. Previously, we would see value names (function names, global variables, etc.); now we see types, namespace names, etc., but no values. llvm-svn: 93134
* Generalize target weirdness handling having proper layering in mind:Anton Korobeynikov2010-01-101-3/+4
| | | | | | | | | 1. Add helper class for sema checks for target attributes 2. Add helper class for codegen of target attributes As a proof-of-concept - implement msp430's 'interrupt' attribute. llvm-svn: 93118
* Change the printing of OR_Deleted overload results to print all the candidates,John McCall2010-01-081-3/+13
| | | | | | | | | | | | | | | not just the viable ones. This is reasonable because the most common use of deleted functions is to exclude some implicit conversion during calls; users therefore will want to figure out why some other options were excluded. Started sorting overload results. Right now it just sorts by location in the translation unit (after putting viable functions first), but we can do better than that. Changed bool OnlyViable parameter to PrintOverloadCandidates to an enum for better self-documentation. llvm-svn: 92990
* Change ObjCContainerDecl to contain the entire range for the '@end'Ted Kremenek2010-01-071-4/+5
| | | | | | | | | | | piece of the declaration. The '@' and the 'end' are separate tokens, and require two SourceLocations to accurately track. This change was motivated because ObjCContainerDecl::getSourceRange() would previously not return the entire range of the declaration (the 'end' would be left off). llvm-svn: 92891
* Improve the diagnostics used to report implicitly-generated class membersJohn McCall2010-01-061-0/+1
| | | | | | | | | as parts of overload sets. Also, refer to constructors as 'constructors' rather than functions. Adjust a lot of tests. llvm-svn: 92832
* Make our marking of virtual members functions in a class beDouglas Gregor2010-01-061-5/+5
| | | | | | | | | | | | | | | | | | | | | deterministic and work properly with templates. Once a class that needs a vtable has been defined, we now do one if two things: - If the class has no key function, we place the class on a list of classes whose virtual functions will need to be "marked" at the end of the translation unit. The delay until the end of the translation unit is needed because we might see template specializations of these virtual functions. - If the class has a key function, we do nothing; when the key function is defined, the class will be placed on the aforementioned list. At the end of the translation unit, we "mark" all of the virtual functions of the classes on the list as used, possibly causing template instantiation and other classes to be added to the list. This gets LLVM's lib/Support/CommandLine.cpp compiling again. llvm-svn: 92821
* Move the -Wconversion logic into SemaChecking.cpp. There's a fair amount ofJohn McCall2010-01-041-4/+5
| | | | | | | overlap between this and -Wsign-compare, which is why I want them in the same place. llvm-svn: 92543
* Remember if the AsmStmt came from Microsoft-style inline assembly code.Mike Stump2010-01-041-1/+2
| | | | llvm-svn: 92526
* Implement typo correction for a variety of Objective-C-specificDouglas Gregor2010-01-031-2/+4
| | | | | | | | | | | | | | constructs: - Instance variable lookup ("foo->ivar" and, in instance methods, "ivar") - Property name lookup ("foo.prop") - Superclasses - Various places where a class name is required - Protocol names (e.g., id<proto>) This seems to cover many of the common places where typos could occur. llvm-svn: 92449
* Get rid of some unnecessary code.Eli Friedman2010-01-021-5/+0
| | | | llvm-svn: 92428
* Eliminate dead code.Eli Friedman2010-01-021-2/+0
| | | | llvm-svn: 92424
* Typo correction for member access into classes/structs/unions, e.g.,Douglas Gregor2009-12-311-0/+1
| | | | | | s.fnd("hello") llvm-svn: 92345
* Implement typo correction for id-expressions, e.g.,Douglas Gregor2009-12-311-3/+2
| | | | | | | | | | | | | typo.cpp:22:10: error: use of undeclared identifier 'radious'; did you mean 'radius'? return radious * pi; ^~~~~~~ radius This was super-easy, since we already had decent recovery by looking for names in dependent base classes. llvm-svn: 92341
* Typo correction for type names when they appear in declarations, e.g., givenDouglas Gregor2009-12-301-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | tring str2; we produce the following diagnostic + fix-it: typo.cpp:15:1: error: unknown type name 'tring'; did you mean 'string'? tring str2; ^~~~~ string To make this really useful, we'll need to introduce typo correction in many more places (wherever we do name lookup), and implement declaration-vs-expression heuristics that cope with typos better. However, for now this will handle the simple cases where we already get good "unknown type name" diagnostics. The LookupVisibleDecls functions are intended to be used by code completion as well as typo correction; that refactoring will happen later. llvm-svn: 92308
* Switch Sema::AddCXXDirectInitializerToDecl over to InitializationSequenceDouglas Gregor2009-12-221-1/+1
| | | | llvm-svn: 91927
* Zap CheckInitializerTypes.Eli Friedman2009-12-221-4/+0
| | | | llvm-svn: 91884
* Centralize the emission/suppression/delay of diagnostics describing runtime ↵Douglas Gregor2009-12-221-1/+2
| | | | | | before in the new function Sema::DiagRuntimeBehavior, addressing one of Chris' comments. llvm-svn: 91870
* When a template-id refers to a single function template, and theDouglas Gregor2009-12-211-1/+12
| | | | | | | | | | explicitly-specified template arguments are enough to determine the instantiation, and either template argument deduction fails or is not performed in that context, we can resolve the template-id down to a function template specialization (so sayeth C++0x [temp.arg.explicit]p3). Fixes PR5811. llvm-svn: 91852
* Small comment fix.Eli Friedman2009-12-211-1/+1
| | | | llvm-svn: 91808
* Don't inject the class name until that magical lbrace.John McCall2009-12-201-0/+6
| | | | | | | | | | | | | | | | Because of the rules of base-class lookup* and the restrictions on typedefs, it was actually impossible for this to cause any problems more serious than the spurious acceptance of template <class T> class A : B<A> { ... }; instead of template <class T> class A : B<A<T> > { ... }; but I'm sure we can all agree that that is a very important restriction which is well worth making another Parser->Sema call for. (*) n.b. clang++ does not implement these rules correctly; we are not ignoring non-type names llvm-svn: 91792
OpenPOWER on IntegriCloud