summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaAccess.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Detect efforts to declare a template member friend and explicitly ignore them.John McCall2010-08-201-0/+3
| | | | | | Avoids a crash. llvm-svn: 111609
* Move Sema's headers into include/clang/Sema, renaming a few along the way.Douglas Gregor2010-08-121-3/+3
| | | | llvm-svn: 110945
* Partial fix for PR7267 based on comments by John McCall on an earlier patch.Chandler Carruth2010-06-281-0/+15
| | | | | | | | | | | | | | | | | | This is more targeted, as it simply provides toggle actions for the parser to turn access checking on and off. We then use these to suppress access checking only while we parse the template-id (included scope specifier) of an explicit instantiation and explicit specialization of a class template. The specialization behavior is an extension, as it seems likely a defect that the standard did not exempt them as it does explicit instantiations. This allows the very common practice of specializing trait classes to work for private, internal types. This doesn't address instantiating or specializing function templates, although those apparently already partially work. The naming and style for the Action layer isn't my favorite, comments and suggestions would be appreciated there. llvm-svn: 106993
* PR7245: Make binding a reference to a temporary without a usable copyJeffrey Yasskin2010-06-071-4/+7
| | | | | | constructor into an extension warning into the error that C++98 requires. llvm-svn: 105529
* When we complain about a member being inaccessible due to a constraintDouglas Gregor2010-05-281-0/+4
| | | | | | | along an access path, add another note pointing at the member we actually found. llvm-svn: 104937
* An access is permitted if the current template instantiates to the appropriateJohn McCall2010-05-041-3/+29
| | | | | | class. Add some conservative support for the idea. Fixes PR 7024. llvm-svn: 102999
* Add another 'catch all' access diagnostic.Anders Carlsson2010-04-231-2/+3
| | | | llvm-svn: 102169
* Use the naming class from the overloaded lookup when access-checking anJohn McCall2010-04-221-9/+1
| | | | | | | | | | address of overloaded function, instead of assuming that a nested name specifier was used. A nested name specifier is not required for static functions. Fixes PR6886. llvm-svn: 102107
* Re-land the patch that merges two diagnostics into one now that it passes ↵Anders Carlsson2010-04-221-7/+6
| | | | | | self-host :) llvm-svn: 102050
* Revert "Unify two diagnostics into one.", it breaks with an assertion ↵Daniel Dunbar2010-04-221-6/+7
| | | | | | failure on bootstrap. llvm-svn: 102043
* Unify two diagnostics into one.Anders Carlsson2010-04-221-7/+6
| | | | llvm-svn: 102040
* Diagnose access to fields with private constructors.Anders Carlsson2010-04-211-0/+7
| | | | llvm-svn: 102025
* Keep tack of whether a base in an InitializedEntity is an inherited virtual ↵Anders Carlsson2010-04-211-2/+6
| | | | | | base or not. Use this in CheckConstructorAccess. llvm-svn: 102020
* Pass the InitializedEntity to Sema::CheckConstructorAccess and use it to ↵Anders Carlsson2010-04-211-5/+16
| | | | | | report different diagnostics depending on which entity is being initialized. llvm-svn: 102010
* Fix the access checking of function and function template argument types,Chandler Carruth2010-04-181-2/+9
| | | | | | | return types, and default arguments. This fixes PR6855 along with several similar cases where we rejected valid code. llvm-svn: 101706
* Check access for the implicit calls to destructors that occur when weJohn McCall2010-04-071-1/+1
| | | | | | | | have a temporary object in C++. Also fix a tag mismatch that Doug noticed. llvm-svn: 100593
* Implement the protected access restriction ([class.protected]), which requiresJohn McCall2010-04-061-210/+421
| | | | | | | | that protected members be used on objects of types which derive from the naming class of the lookup. My first N attempts at this were poorly-founded, largely because the standard is very badly worded here. llvm-svn: 100562
* Correct the calculation of access to more closely model the wording inJohn McCall2010-04-021-123/+206
| | | | | | the standard. llvm-svn: 100155
* Fix an oversight with access control for address-of-function.John McCall2010-03-301-0/+1
| | | | llvm-svn: 99942
* Propagate the "found declaration" (i.e. the using declaration instead ofJohn McCall2010-03-301-0/+25
| | | | | | | | | | | | | the underlying/instantiated decl) through a lot of API, including "intermediate" MemberExprs required for (e.g.) template instantiation. This is necessary because of the access semantics of member accesses to using declarations: only the base class *containing the using decl* need be accessible from the naming class. This allows us to complete an access-controlled selfhost, if there are no recent regressions. llvm-svn: 99936
* Optimize PartialDiagnostic's memory-allocation behavior by placing aDouglas Gregor2010-03-291-11/+16
| | | | | | | | | | | | | | cache of PartialDiagnostic::Storage objects into an allocator within the ASTContext. This eliminates a significant amount of malloc traffic, for a 10% performance improvement in -fsyntax-only wall-clock time with 403.gcc's combine.c. Also, eliminate the RequireNonAbstractType hack I put in earlier, which was but a symptom of this larger problem. Fixes <rdar://problem/7806091>. llvm-svn: 99849
* Accumulate all functions and classes that the effective context isJohn McCall2010-03-271-35/+51
| | | | | | | | nested within, and suddenly local classes start working. Wouldn't be necessary if I hadn't used local classes in Clang in the first place. Or, well, wouldn't be necessary yet. :) llvm-svn: 99709
* Reapply r99596 with a fix: link an instantiated friend function to itsJohn McCall2010-03-261-1/+1
| | | | | | pattern if it has a body. llvm-svn: 99610
* Apparently that didn't work. Reverting for now.John McCall2010-03-261-1/+1
| | | | llvm-svn: 99601
* Properly instantiate and link in friend function templates.John McCall2010-03-261-1/+1
| | | | llvm-svn: 99596
* Fix a very minor oversight in privileges-elevation: we were only consideringJohn McCall2010-03-251-1/+1
| | | | | | | friendship for a derived class if the base class specifier was non-public, and thus not considering friendship for non-public members of public bases. llvm-svn: 99554
* Preserve type-source information in friend declarations.John McCall2010-03-251-2/+2
| | | | llvm-svn: 99525
* Properly instantiate friend class template declarations and link them intoJohn McCall2010-03-251-3/+7
| | | | | | | the redeclaration chain. Recommitted from r99477 with a fix: we need to merge in default template arguments from previous declarations. llvm-svn: 99496
* Revert 99477 since it appears to be breaking the clang-x86_64-darwin10-fntBob Wilson2010-03-251-7/+3
| | | | | | | | | | | buildbot. The tramp3d test fails. --- Reverse-merging r99477 into '.': U test/SemaTemplate/friend-template.cpp U test/CXX/temp/temp.decls/temp.friend/p1.cpp U lib/Sema/SemaTemplateInstantiateDecl.cpp U lib/Sema/SemaAccess.cpp llvm-svn: 99481
* Properly instantiate and link in friend-class-template declarations.John McCall2010-03-251-3/+7
| | | | llvm-svn: 99477
* Walk out of enums when determining effective context.John McCall2010-03-241-1/+11
| | | | llvm-svn: 99391
* Support friend function specializations.John McCall2010-03-241-8/+10
| | | | llvm-svn: 99389
* Implement a framework for the delay of arbitrary diagnostics withinJohn McCall2010-03-241-61/+287
| | | | | | | | | templates. So delay access-control diagnostics when (for example) the target of a friend declaration is a specific specialization of a template. I was surprised to find that this was required for an access-controlled selfhost. llvm-svn: 99383
* Remember the "found declaration" for an overload candidate, which is theJohn McCall2010-03-191-24/+20
| | | | | | | | | | | | | | | | entity (if applicable) which was actually looked up. If a candidate was found via a using declaration, this is the UsingShadowDecl; otherwise, if the candidate is template specialization, this is the template; otherwise, this is the function. The point of this exercise is that "found declarations" are the entities we do access control for, not their underlying declarations. Broadly speaking, this patch fixes access control for using declarations. There is a *lot* of redundant code calling into the overload-resolution APIs; we really ought to clean that up. llvm-svn: 98945
* When elevating access along an inheritance path, initialize the computedJohn McCall2010-03-181-13/+30
| | | | | | | | | | | | | | | | access to the (elevated) access of the accessed declaration, if applicable, rather than plunking that access onto the end after we've calculated the inheritance access. Also, being a friend of a derived class gives you public access to its members (subject to later modification by further inheritance); it does not simply ignore a single location of restricted inheritance. Also, when computing the best unprivileged path to a subobject, preserve the information that the worst path might be AS_none (forbidden) rather than a minimum of AS_private. llvm-svn: 98899
* from code inspection, we were treating placement news with one argument asJohn McCall2010-03-181-0/+18
| | | | | | | | non-placement news when selecting the corresponding operator delete; this is fixed. Access and ambiguity control for calls to operator new and delete. Also AFAICT llvm-svn: 98818
* Implement non-dependent friend functions and classes.John McCall2010-03-171-18/+94
| | | | llvm-svn: 98764
* Grant nested classes the access privileges of their enclosing classes.John McCall2010-03-171-48/+51
| | | | llvm-svn: 98710
* Access control for implicit calls to copy assignment operators and copyJohn McCall2010-03-161-0/+17
| | | | | | constructors from implicitly-defined members. llvm-svn: 98614
* Perform access control for the implicit base and member destructor callsJohn McCall2010-03-161-81/+80
| | | | | | required when emitting a destructor definition. llvm-svn: 98609
* Implement basic support for friend types and functions in non-dependentJohn McCall2010-03-121-2/+27
| | | | | | contexts. llvm-svn: 98321
* Improve access control diagnostics. Perform access control on member-pointerJohn McCall2010-02-101-227/+401
| | | | | | | conversions. Fix an access-control bug where privileges were not considered at intermediate points along the inheritance path. Prepare for friends. llvm-svn: 95775
* Mark dtors for parameter variables and eliminate some redundant type munging.John McCall2010-02-021-7/+2
| | | | llvm-svn: 95079
* Access control for implicit destructor calls. Diagnostic could be orders ofJohn McCall2010-02-021-0/+25
| | | | | | magnitude clearer. llvm-svn: 95078
* Access checking for implicit user-defined conversions.John McCall2010-02-011-1/+18
| | | | llvm-svn: 94971
* Access checking for overloaded operators.John McCall2010-01-281-0/+24
| | | | llvm-svn: 94725
* Implement access-check delays for out-of-line member definitionsJohn McCall2010-01-271-2/+35
| | | | | | using the same framework we use for deprecation warnings. llvm-svn: 94659
* Implement access control for overloaded functions. Suppress access controlJohn McCall2010-01-271-0/+42
| | | | | | | diagnostics in "early" lookups, such as during typename checks and when building unresolved lookup expressions. llvm-svn: 94647
* Implement elementary access control.John McCall2010-01-231-0/+99
| | | | llvm-svn: 94268
* Set a member's access specifier even if it doesn't match the previous specifier.John McCall2009-12-231-0/+2
| | | | | | | | Prevents an assert on successive redeclarations. Fixed PR5573. llvm-svn: 91956
OpenPOWER on IntegriCloud