summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* improve diagnostics for case when a field type is unknown byChris Lattner2009-12-311-1/+2
| | | | | | | not emitting a follow-on error about 'int', which the user never wrote. PR5924. llvm-svn: 92339
* when making a decl for __builtin_fabsf() make sure toChris Lattner2009-12-301-0/+4
| | | | | | | | attach the appropriate attributes to it. I don't think this manifests as any real change though, we're still not getting the right LLVM IR attributes out of codegen. llvm-svn: 92316
* fix PR5917, L'x' was getting the wrong type in c++ mode. PerChris Lattner2009-12-301-2/+8
| | | | | | C++2.13.2p2: "A wide-character literal has type wchar_t" llvm-svn: 92313
* remove extraneous #includeChris Lattner2009-12-301-1/+0
| | | | llvm-svn: 92310
* Typo correction for type names when they appear in declarations, e.g., givenDouglas Gregor2009-12-305-3/+563
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix typo in commentDouglas Gregor2009-12-301-1/+1
| | | | llvm-svn: 92307
* More fixes to the handling of CVR-comparisons on array types. Adds a method toChandler Carruth2009-12-301-3/+5
| | | | | | | | | | | | QualType to get CVR-qualifiers through array types, and switches the primary comparison methods to use it. This may allow simplifying some of the callers of getUnqualifiedArrayType. Also fix the normalizing of CV-qualification during template deduction to normalize through arrays and allow a more qualified deduced array type. This fixes PR5911. llvm-svn: 92289
* Typedefs can be redeclared. That seems like something we should record inJohn McCall2009-12-302-3/+14
| | | | | | the AST lest we run into some crazy canonicalization bug like PR5874. llvm-svn: 92283
* Fix support for const_cast<>s of array types which actual change theChandler Carruth2009-12-291-2/+3
| | | | | | | | CV-qualifiers. Remove an error expectation from the 'good' set of const-cast test cases. With this patch, the final non-template test case from PR5542 passes. (It's the same as the one already in const-cast.cpp.) llvm-svn: 92257
* Correctly refer to element CVR qualifications when determining if a type isChandler Carruth2009-12-293-59/+34
| | | | | | | | | | more or less cv-qualified than another during implicit conversion and overload resolution ([basic.type.qualifier] p5). Factors the logic out of template deduction and into the ASTContext so it can be shared. This fixes several aspects of PR5542, but not all of them. llvm-svn: 92248
* Get rid of FixedWidthIntType, as suggested by Chris and Eli.Anders Carlsson2009-12-294-20/+5
| | | | llvm-svn: 92246
* Handle using declarations in overloaded and template functions during ADL andChandler Carruth2009-12-292-11/+11
| | | | | | | | | | address resolution. This fixes PR5751. Also, while we're here, remove logic from ADL which mistakenly included the definition namespaces of overloaded and/or templated functions whose name or address is used as an argument. llvm-svn: 92245
* Don't look through casts when looking for the underlying decl for a functionEli Friedman2009-12-261-1/+1
| | | | | | | call; the standard doesn't expect us to, and the program could be doing something crazy. Fixes PR5882. llvm-svn: 92166
* Attempted fix for PR5884; this code will be dead soon, but this fix shouldEli Friedman2009-12-251-3/+2
| | | | | | help for the moment. llvm-svn: 92165
* Remove some dead variables clang-analyzer found.Benjamin Kramer2009-12-255-8/+0
| | | | llvm-svn: 92162
* Make copy constructor elimination work in more cases; the case in questionEli Friedman2009-12-241-0/+4
| | | | | | here affects clang-on-clang. llvm-svn: 92151
* Egregious, disgusting workaround for PR5866. We need to rework how weDouglas Gregor2009-12-242-2/+8
| | | | | | | | keep track of friends within templates, which will provide a real for PR5866. For now, this makes sure we don't do something entirely stupid with friends of specializations. llvm-svn: 92143
* Add test case for PR5868, and improve location information slightly for ↵Douglas Gregor2009-12-242-1/+2
| | | | | | implicit "this" expressions llvm-svn: 92141
* When rebuilding a MemberExpr that refers to an anonymous union, beDouglas Gregor2009-12-241-1/+4
| | | | | | | sure to perform derived-to-base conversions on the base expression. Fixes PR5868. Proper testcase is coming soon. llvm-svn: 92139
* Fix -Asserts warning.Daniel Dunbar2009-12-241-2/+1
| | | | llvm-svn: 92137
* When transforming CXXExprWithTemporaries and CXXBindTemporaryExprDouglas Gregor2009-12-243-21/+9
| | | | | | | | | expressions (e.g., for template instantiation), just transform the subexpressions and return those, since the temporary-related nodes will be implicitly regenerated. Fixes PR5867, but I said that before... llvm-svn: 92135
* InitializationSequence handles binding to temporaries, so thatDouglas Gregor2009-12-241-3/+0
| | | | | | | | argument-passing doesn't have to. Fixes PR5867, where we were binding a temporary twice in the AST and, therefore, calling its destructor twice. llvm-svn: 92131
* Fix the clang-on-clang build: APFloat reports underflow whenever we get aJohn McCall2009-12-241-1/+5
| | | | | | | denormal, but we only want to diagnose if we underflowed to zero. This allows people to write constants in the denormal range. llvm-svn: 92129
* Tweak the text of several main() diagnostics and punch a hole specifically forJohn McCall2009-12-241-2/+12
| | | | | | | | | | Darwin's sekrit fourth argument. This should probably be factored to let targets make target-specific decisions about what main() should look like. Fixes rdar://problem/7414990 or if different platforms have radically different ideas of what they want in llvm-svn: 92128
* Diagnose out-of-bounds floating-point constants. Fixes rdar://problem/6974641John McCall2009-12-241-3/+21
| | | | llvm-svn: 92127
* allow the noreturn attribute to be used in class methodsNuno Lopes2009-12-231-1/+3
| | | | llvm-svn: 92090
* When we see a CXXDefaultArgExpr during template instantiation, rebuildDouglas Gregor2009-12-233-6/+10
| | | | | | | | the default argument so that we're sure to mark any referenced declarations. This gets us another little step closer to fixing PR5810. llvm-svn: 92078
* There is no such thing as typeinfo for a cv-qualified type. AssertDouglas Gregor2009-12-231-2/+9
| | | | | | | | that this is true when mangling, then fix up the various places in Sema and/or CodeGen that need to remove qualifiers. Addresses a linking issue when building LLVM with Clang. llvm-svn: 92064
* 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
OpenPOWER on IntegriCloud