summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Diagnose the use of incomplete types in C++ typeid expressionsDouglas Gregor2009-12-231-2/+18
| | | | llvm-svn: 92045
* Remove cv-qualifiers from the argument to typeidDouglas Gregor2009-12-231-11/+30
| | | | llvm-svn: 92041
* Fix the overflow calculation in Sema::CheckTemplateArgument to be a bit moreEli Friedman2009-12-231-1/+8
| | | | | | accurate. llvm-svn: 92018
* When using a default function argument for a function template (orDouglas Gregor2009-12-231-3/+18
| | | | | | | | | | | | | | | | | member function thereof), perform the template instantiation each time the default argument is needed. This ensures that (1) We get different CXXTemporary objects for each instantiation, and (2) Any other instantiations or definitions triggered by the instantiation of the default argument expression are guaranteed to happen; previously, they might have been suppressed, e.g., because they happened in an unevaluated context. This fixes the majority of PR5810. However, it does not address the problem where we may have multiple uses of the same CXXTemporary within an expression when the temporary came from a non-instantiated default argument expression. llvm-svn: 92015
* move a few more symbols to .rodata/.data.rel.roNuno Lopes2009-12-231-1/+1
| | | | llvm-svn: 92012
* Fix DISABLE_SMART_POINTERS buildDouglas Gregor2009-12-231-5/+6
| | | | llvm-svn: 92008
* Update for the intrinsic changes in llvm: the object size intrinsicEric Christopher2009-12-231-0/+1
| | | | | | | only takes a boolean second argument now. Update tests accordingly. Currently the builtin still accepts the full range for compatibility. llvm-svn: 91983
* 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
* Objective-C methods can be variadic, too. Who knew.Douglas Gregor2009-12-231-0/+7
| | | | llvm-svn: 91951
* Switch Sema::CreateOverloadedUnaryOp over to InitializationSequence.Douglas Gregor2009-12-231-3/+8
| | | | llvm-svn: 91948
* warn when attribute warn_unused_result is applied to void functions.Nuno Lopes2009-12-221-1/+6
| | | | | | while at it, remove an outdated FIXME llvm-svn: 91946
* Allow the first parameter of operator new to be a cv-qualifiedDouglas Gregor2009-12-223-3/+4
| | | | | | | | size_t. Also, fix an issue with initialization of parameters in calls, where we weren't removing the cv-qualifiers on the parameter type itself. Fixes PR5823. llvm-svn: 91941
* Make sure that reinterpret_cast gets a CastKind on all successfulDouglas Gregor2009-12-221-1/+5
| | | | | | | paths. Fixes "cannot compile this unexpected cast lvalue yet" error in llvm/lib/Analysis/IPA/GlobalsModRef.cpp. llvm-svn: 91932
* Add using shadow decls to the "instantiated locals" map, fixing PR5847.John McCall2009-12-221-0/+5
| | | | llvm-svn: 91928
* Switch Sema::AddCXXDirectInitializerToDecl over to InitializationSequenceDouglas Gregor2009-12-223-36/+41
| | | | llvm-svn: 91927
* Switch parameter passing for overloaded binary operators toDouglas Gregor2009-12-221-7/+31
| | | | | | | InitializationSequence. Fixes the -fsyntax-only failure in llvm/lib/Transforms/Scalar/InstructionCombining.cpp. llvm-svn: 91921
* When transforming a C++ "new" expression that was not explicitly givenDouglas Gregor2009-12-221-0/+25
| | | | | | | a size, check whether the transformed type is itself an array type. If so, take the major array bound as the size to allocate. Fixes PR5833. llvm-svn: 91907
* Switch parameter-passing for calls via function pointers (where weDouglas Gregor2009-12-223-18/+30
| | | | | | don't have a FunctionDecl) over to InitializationSequence. llvm-svn: 91906
* Switch InitializedEntity from TypeLoc down to just QualTypes, since we don't ↵Douglas Gregor2009-12-225-150/+60
| | | | | | use the location information but we did spend a bunch of time building faked-up TypeLocs llvm-svn: 91905
* Switch initialization of parameters in a call over toDouglas Gregor2009-12-222-6/+33
| | | | | | | | | | | InitializationSequence (when a FunctionDecl is present). This required a few small fixes to initialization sequences: - Make sure to use the adjusted parameter type for initialization of function parameters. - Implement transparent union calling semantics in C llvm-svn: 91902
* fix a bug handling the gnu ?: extension. Patch by Storlek on IRC,Chris Lattner2009-12-221-1/+1
| | | | | | who prefers to be stealthy and mysterious. llvm-svn: 91888
* When we simply return a retained member expression when instantiating, we ↵Anders Carlsson2009-12-221-1/+6
| | | | | | must also mark the member decl as referenced. llvm-svn: 91887
* Zap CheckInitializerTypes.Eli Friedman2009-12-222-116/+0
| | | | llvm-svn: 91884
* Switch default arguments over to InitializationSequence.Eli Friedman2009-12-221-1/+5
| | | | llvm-svn: 91883
* Switch compound literals over to InitializationSequence.Eli Friedman2009-12-222-3/+10
| | | | llvm-svn: 91882
* Switch file-scope assignment initialization over to InitializationSequence.Eli Friedman2009-12-222-14/+21
| | | | llvm-svn: 91881
* Centralize the emission/suppression/delay of diagnostics describing runtime ↵Douglas Gregor2009-12-222-60/+53
| | | | | | before in the new function Sema::DiagRuntimeBehavior, addressing one of Chris' comments. llvm-svn: 91870
* Stop diagnosing the use of inner classes as friends. ddunbar asked whetherJohn McCall2009-12-221-7/+4
| | | | | | | | | this was useful, and on review Doug and I decided it was probably on the level of a bug in the standard and therefore not worth a warning even in -pedantic. If someone disagrees and urgently wants clang++ to warn about this in strict c++98 mode, we can talk about it. llvm-svn: 91868
* Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, ↵Douglas Gregor2009-12-225-6/+6
| | | | | | since the context is available in the Decl llvm-svn: 91862
* When converting from a type to itself or one of its base classes via aDouglas Gregor2009-12-221-1/+2
| | | | | | | | | constructor call, the conversion is only a standard conversion sequence if that constructor is a copy constructor. This fixes PR5834 in a semi-lame way, because the "real" fix will be to move over to InitializationSequence. That will happen "soonish", but not now. llvm-svn: 91861
* When filling in value initializations within an initializer list, beDouglas Gregor2009-12-221-65/+86
| | | | | | | sure to fill in the initialized member of a union when a member was explicitly designated. Fixes PR5843. llvm-svn: 91858
* When a template-id refers to a single function template, and theDouglas Gregor2009-12-215-27/+206
| | | | | | | | | | 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
* Introduce an assertion to ensure that template argument deduction doesDouglas Gregor2009-12-211-1/+1
| | | | | | | | | not deduce an "overload" type. Such a deduction indicates a failure in semantic analysis (e.g., PR5811) that currently isn't caught until code-generation time. This assertions makes it clearer that this particular issue is a semantic-analysis problem, not a code-gen problem. llvm-svn: 91844
* Allow comparison of 'void *' with function pointer Fariborz Jahanian2009-12-211-1/+12
| | | | | | as a g++ extension (fixes radar 7481987). llvm-svn: 91827
* Reorganize the base-lookup bits of ActOnMemInitializer in order to betterJohn McCall2009-12-211-8/+24
| | | | | | support diagnostics and error recovery. llvm-svn: 91825
* Fix for PR5840: fix the kind of name lookup used for classes inEli Friedman2009-12-211-2/+6
| | | | | | | | | | Sema::getTypeName. "LookupNestedNameSpecifierName" isn't quite the right kind of lookup, though; it doesn't ignore namespaces. Someone more familiar with the lookup code should fix this properly. llvm-svn: 91809
* Small comment fix.Eli Friedman2009-12-211-1/+1
| | | | llvm-svn: 91808
* fix PR4010: add support for the warn_unused_result for function pointersNuno Lopes2009-12-202-5/+4
| | | | llvm-svn: 91803
* Make sure we instantiate the destructor for variables initialized byEli Friedman2009-12-201-0/+9
| | | | | | assignment. llvm-svn: 91798
* Fix review comment; no visible change.Eli Friedman2009-12-201-28/+29
| | | | llvm-svn: 91797
* Switch default-initialization of variables of class type (or array thereof) ↵Douglas Gregor2009-12-202-21/+13
| | | | | | over to InitializationSequence. I could swear that this fixes a PR somewhere, but I couldn't figure out which one llvm-svn: 91796
* Revert accidental commitDouglas Gregor2009-12-201-11/+20
| | | | llvm-svn: 91795
* Fix CMake build on windows, from Cedric VenetDouglas Gregor2009-12-201-20/+11
| | | | llvm-svn: 91794
* Don't inject the class name until that magical lbrace.John McCall2009-12-202-24/+35
| | | | | | | | | | | | | | | | 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
* Kill off PreDeclaratorDC.John McCall2009-12-192-6/+2
| | | | llvm-svn: 91772
* Refactor to remove more dependencies on PreDeclaratorDC. I seem to have madeJohn McCall2009-12-194-70/+68
| | | | | | | the redeclaration problems in the [temp.explicit]p3 testcase worse, but I can live with that; they'll need to be fixed more holistically anyhow. llvm-svn: 91771
* Don't use EnterDeclaratorContext when rebuilding a type in the currentJohn McCall2009-12-191-2/+5
| | | | | | instantiation, since we're not using a Scope object for that anyway. llvm-svn: 91770
* Just push a new scope when parsing an out-of-line variable definition.John McCall2009-12-191-33/+43
| | | | | | | Magically fixes all the terrible lookup problems associated with not pushing a new scope. Resolves an ancient xfail and an LLVM misparse. llvm-svn: 91769
* Initialization improvements: addition of string initialization and a fewEli Friedman2009-12-193-30/+55
| | | | | | | | small bug fixes in SemaInit, switch over SemaDecl to use it more often, and change a bunch of diagnostics which are different with the new initialization code. llvm-svn: 91767
* Switch more of Sema::CheckInitializerTypes over toDouglas Gregor2009-12-192-81/+48
| | | | | | | | | | InitializationSequence. Specially, switch initialization of a C++ class type (either copy- or direct-initialization). Also, make sure that we create an elidable copy-construction when performing copy initialization of a C++ class variable. Fixes PR5826. llvm-svn: 91750
OpenPOWER on IntegriCloud