summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert attempted fix for integral template arguments. It seems to have ↵Douglas Gregor2010-03-261-20/+19
| | | | | | broken tramp3d-v4. llvm-svn: 99583
* Mark virtual methods that are used in tables included in VTTs as used.Rafael Espindola2010-03-262-2/+19
| | | | | | Fixes PR6706. llvm-svn: 99582
* Warn when the conversion of an integral non-type template argument toDouglas Gregor2010-03-251-19/+20
| | | | | | | | | | | | | | | | | | the type of its corresponding non-type template parameter changes the value. Previously, we were diagnosing this as an error, which was wrong. We give reasonably nice warnings like: test/SemaTemplate/temp_arg_nontype.cpp:100:10: warning: non-type template argument value '256' truncated to '0' for template parameter of type 'unsigned char' Overflow<256> *overflow3; // expected-warning{{non-type template ... ^~~ test/SemaTemplate/temp_arg_nontype.cpp:96:24: note: template parameter is declared here template<unsigned char C> struct Overflow; ^ llvm-svn: 99561
* Teach the diagnostic engine to provide more detailed information aboutDouglas Gregor2010-03-252-13/+25
| | | | | | | | | how to handle a diagnostic during template argument deduction, which may be "substitution failure", "suppress", or "report". This keeps us from, e.g., emitting warnings while performing template argument deduction. llvm-svn: 99560
* When finishing a function definition, leave the function definition *after*John McCall2010-03-251-2/+3
| | | | | | | doing all the cleanup tasks and checks. This gives us the proper context for checking access to base and member destructors. llvm-svn: 99559
* 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
* Handle simple friend-class decls in class templates better by ensuring thatJohn McCall2010-03-252-61/+85
| | | | | | | we look for shadow friend decls in the appropriate scope before injecting a new declaration. llvm-svn: 99552
* Preserve type-source information in friend declarations.John McCall2010-03-254-12/+21
| | | | llvm-svn: 99525
* Remove support for nand atomic builtins. They are inconsistently implemented inDaniel Dunbar2010-03-251-15/+9
| | | | | | | gcc, and the common expectation seems to be that they are unused. If and when someone cares we can add them back with well documented demantics. llvm-svn: 99522
* Improve our handling of local instantiation scopes in two related ways:Douglas Gregor2010-03-253-13/+33
| | | | | | | | | | | | | | | - When substituting template arguments as part of template argument deduction, introduce a new local instantiation scope. - When substituting into a function prototype type, introduce a new "temporary" local instantiation scope that merges with its outer scope but also keeps track of any additions it makes, removing them when we exit that scope. Fixes PR6700, where we were getting too much mixing of local instantiation scopes due to template argument deduction that substituted results into function types. llvm-svn: 99509
* Properly instantiate friend class template declarations and link them intoJohn McCall2010-03-252-26/+101
| | | | | | | 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-252-91/+26
| | | | | | | | | | | 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
* Fix two bugs in format-string checking:Ted Kremenek2010-03-251-19/+17
| | | | | | | | | (1) Do not assume the data arguments start after the format string (2) Do not use the fact that a function is variadic to treat it like a va_list printf function Fixes PR 6697. llvm-svn: 99480
* Properly instantiate and link in friend-class-template declarations.John McCall2010-03-252-26/+91
| | | | llvm-svn: 99477
* Kill off two more uses of Sema::CheckReferenceInit in favor of the newDouglas Gregor2010-03-253-24/+23
| | | | | | | | initialization code. Exposed a bug where we were not marking an implicit conversion as an lvalue when we were forming a call to a conversion function whose return type is a reference. llvm-svn: 99459
* Switch static_cast from the old reference-initialization code (viaDouglas Gregor2010-03-241-20/+17
| | | | | | | | CheckReferenceInit) over to the new initialization code (InitializationSequence), which is better-tested and doesn't require us to compute the entire conversion sequence twice. llvm-svn: 99452
* When pulling apart an initializer that involves a CXXConstructExpr, doDouglas Gregor2010-03-241-11/+13
| | | | | | | not pick apart a CXXTemporaryObjectExpr because such an object construction was explicitly written in the source code. Fixes PR6657. llvm-svn: 99427
* Allow conversion of qualified Class type to unqualifiedFariborz Jahanian2010-03-241-2/+4
| | | | | | Class type to match gcc's. Fixes radar 7789113. llvm-svn: 99425
* Improve diagnostics when ivar added to classFariborz Jahanian2010-03-241-1/+1
| | | | | | extension (radar 6812436). llvm-svn: 99408
* Silently drop dependent friend function template specializations,Douglas Gregor2010-03-241-4/+11
| | | | | | | | since we have absolutely no way to match them when they are declared nor do we have a way to represent these parsed-but-not-checked friend declarations. llvm-svn: 99407
* Walk out of enums when determining effective context.John McCall2010-03-241-1/+11
| | | | llvm-svn: 99391
* Correct that last fixit: if the user wroteJohn McCall2010-03-241-2/+17
| | | | | | | | | template <> friend void foo(int); we need to change it to friend void foo<>(int); or else the user won't get the template specialization they obviously want. llvm-svn: 99390
* Support friend function specializations.John McCall2010-03-243-12/+31
| | | | llvm-svn: 99389
* When a declaration of a function is missing an exception specificationDouglas Gregor2010-03-242-14/+116
| | | | | | | | | | | | | | | | | | | | | that was present in a prior declaration, emit a warning rather than a hard error (which we did before, and still do with mismatched exception specifications). Moreover, provide a fix-it hint with the throw() clause that should be added, e.g., t.C:10:7: warning: 'operator new' is missing exception specification 'throw(std::bad_alloc)' void *operator new(unsigned long sz) ^ throw(std::bad_alloc) As part of this, disable the warning when we're missing an exception specification on operator new, operator new[], operator delete, or operator delete[] when exceptions are turned off (-fno-exceptions). Fixes PR5957. llvm-svn: 99388
* Implement a framework for the delay of arbitrary diagnostics withinJohn McCall2010-03-243-62/+309
| | | | | | | | | 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
* When performing name lookup for the allocation or deallocationDouglas Gregor2010-03-241-0/+17
| | | | | | | operators, make sure that the implicitly-declared global new and delete operators are always available. Fixes PR5904. llvm-svn: 99382
* Each non-local class instantiation is its own local instantiationDouglas Gregor2010-03-241-0/+6
| | | | | | scope. Fixes PR6619. llvm-svn: 99377
* Make sure to properly track the anonymous namespace that lives insideDouglas Gregor2010-03-241-1/+2
| | | | | | | | | | each namespace, even when the outer namespace has multiple definitions. As part of this, collapsed two pointers worth of storage (original namespace and inner anonymous namespace) into a single pointer with a distinguishing bit, since the two are mutually exclusive, saving a pointer per NamespaceDecl. Fixes PR6620. llvm-svn: 99368
* Implement computation of the final overriders for each virtualDouglas Gregor2010-03-231-94/+87
| | | | | | | | | | | | | | | | | | | | function within a class hierarchy (C++ [class.virtual]p2). We use the final-overrider computation to determine when a particular class is ill-formed because it has multiple final overriders for a given virtual function (e.g., because two virtual functions override the same virtual function in the same virtual base class). Fixes PR5973. We also use the final-overrider computation to determine which virtual member functions are pure when determining whether a class is abstract or diagnosing the improper use of an abstract class. The prior approach to determining whether there were any pure virtual functions in a class didn't cope with virtual base class subobjects properly, and could not easily be fixed to deal with the oddities of subobject hiding. Fixes PR6631. llvm-svn: 99351
* revert 99311. Looks like it broke darwin bootstrap.Rafael Espindola2010-03-231-1/+7
| | | | llvm-svn: 99317
* Improve diagnostic for @property/ivar type mismatch by including the types ↵Ted Kremenek2010-03-231-2/+6
| | | | | | | | of the ivar and @property respectively. llvm-svn: 99312
* Avoid producing implicit methods when we have a explicit template instantiationRafael Espindola2010-03-231-7/+1
| | | | | | declaration. llvm-svn: 99311
* When recovering from a qualified typedef name, don't clear out theDouglas Gregor2010-03-231-1/+2
| | | | | | | DeclContext because we don't want a NULL DeclContext. Instead, use the current context. llvm-svn: 99281
* Ignore a more comprehensive set of gcc-special format attributes.Duncan Sands2010-03-231-1/+2
| | | | llvm-svn: 99277
* For forward-declared static inline functions, delay CFG-based warnings until weTed Kremenek2010-03-232-8/+23
| | | | | | encounter a definition. llvm-svn: 99243
* Only perform CFG-based warnings on 'static inline' functions thatTed Kremenek2010-03-236-41/+113
| | | | | | | are called (transitively) by regular functions/blocks within a translation untion. llvm-svn: 99233
* Set the relevent attributes declared in class extensionFariborz Jahanian2010-03-221-0/+5
| | | | | | | and fix a missing diagnostics on assigning to a read-only property. Fixes radar 7766184. llvm-svn: 99230
* A fixed version of r99174 which also includes a test that we emit vtables whenRafael Espindola2010-03-222-2/+11
| | | | | | we see an specialization definition ever if we then see a extern template declaration. llvm-svn: 99226
* (re)implement PR6542, accepting and discarding the __gcc_tdiag__Chris Lattner2010-03-221-0/+8
| | | | | | format attribute specifier. llvm-svn: 99213
* Diagnose miuse of property dot-syntax instead of crashing.Fariborz Jahanian2010-03-221-1/+4
| | | | | | (radar 7634653). llvm-svn: 99210
* Fixes access rues for ivars declared in classFariborz Jahanian2010-03-221-2/+0
| | | | | | implementations (radar 7547942). llvm-svn: 99198
* revert r99174. It caused PR6677. Will try to debug why tonight.Rafael Espindola2010-03-222-6/+2
| | | | llvm-svn: 99188
* When handling a TSK_ExplicitInstantiationDefinition after aRafael Espindola2010-03-222-2/+6
| | | | | | | | | TSK_ExplicitInstantiationDeclaration make sure we call MaybeMarkVirtualMembersReferenced with a method attached to the definition. Remove the hack that forced vtable emition with declarations. llvm-svn: 99174
* -Wshadow should only warn about parameter declarations when we'reJohn McCall2010-03-223-14/+33
| | | | | | | | | entering a function or block definition, not on every single declaration. Unfortunately we don't have previous-lookup results around when it's time to make this decision, so we have to redo the lookup. The alternative is to use delayed diagnostics. llvm-svn: 99172
* Fix PR6618.Rafael Espindola2010-03-212-7/+15
| | | | | | | If a struct has an invalid field, mark it as invalid. Also avoid producing errors about incomplete types that are invalid. llvm-svn: 99150
* Don't bother running the analysis for CFG-based warnings if theTed Kremenek2010-03-201-0/+7
| | | | | | declaration is in a system header. llvm-svn: 99087
* Refactor CFG-based warnings in Sema to be run by a worked object called ↵Ted Kremenek2010-03-207-302/+425
| | | | | | | | | | | | | | | AnalysisBasedWarnings. This object controls when the warnings are executed, allowing the client code in Sema to selectively disable warnings as needed. Centralizing the logic for analysis-based warnings allows us to optimize when and how they are run. Along the way, remove the redundant logic for the 'check fall-through' warning for blocks; now the same logic is used for both blocks and functions. llvm-svn: 99085
* Implement -Wshadow for parameter declarations as well.John McCall2010-03-202-19/+37
| | | | llvm-svn: 99037
* Remove the capture, serialization, and deserialization of commentDouglas Gregor2010-03-192-7/+0
| | | | | | | | ranges as part of the ASTContext. This code is not and was never used, but contributes ~250k to the size of the Cocoa.h precompiled header. llvm-svn: 99007
* Promote enum types during -Wsign-compare. Fixes some spurious warnings,John McCall2010-03-191-0/+5
| | | | | | mostly during conditional expressions. llvm-svn: 98975
OpenPOWER on IntegriCloud