Anders Carlsson
570af5d426
Improve handling of vector casts in C++.
...
llvm-svn: 82072
2009-09-16 19:19:43 +00:00
Douglas Gregor
64621e6eb3
Teach Sema::FindInstantiatedDecl to find instantiated RecordDecls even
...
when we are not instantiating the corresponding "current
instantiation." This happens, e.g., when we are instantiating a
declaration reference that refers into the "current instantiation" but
occurs in a default function argument. The libstdc++ vector default
constructor now instantiates properly.
llvm-svn: 82069
2009-09-16 18:34:49 +00:00
Fariborz Jahanian
cceedbff27
Do not generate write-barrier in indirect assignment to
...
a weak object.
llvm-svn: 82061
2009-09-16 18:09:18 +00:00
Fariborz Jahanian
4141deb68e
Removed a superfluous check before setting
...
a flag (objc GC).
llvm-svn: 82052
2009-09-16 16:49:08 +00:00
Anders Carlsson
20759ad54c
x86-64 ABI: If a type is a C++ record with either a non-trivial destructor or a non-trivial copy constructor, it should be passed in a pointer. Daniel, plz review.
...
llvm-svn: 82050
2009-09-16 15:53:40 +00:00
Benjamin Kramer
26ddfee3b2
PR4991: Properly remove trailing newline from __TIMESTAMP__.
...
Replace strcpy with memcpy while at it.
llvm-svn: 82043
2009-09-16 13:10:04 +00:00
Daniel Dunbar
306945d3d0
Incremental improvement to logic determining whether we emit unwind tables or
...
not.
- PR4932.
llvm-svn: 82021
2009-09-16 06:17:29 +00:00
Ted Kremenek
4f335c300a
Have divide-by-zero checker not handled undefined denominators. This is handled by the generic checking for undefined operands for BinaryOperators.
...
llvm-svn: 82019
2009-09-16 06:04:26 +00:00
Ted Kremenek
6879beda08
Remove ImplicitBadDivides/ExplicitBadDivides node sets. This checking is now down by a 'Checker' and not build into GRExprEngine.
...
llvm-svn: 82017
2009-09-16 06:03:39 +00:00
Chris Lattner
f7ff53d4d9
fix some ppc register name issues, patch by Richard Pennington!
...
llvm-svn: 82009
2009-09-16 05:05:27 +00:00
Mike Stump
b4bed3a497
Collapse more clang version numbers down into fewer places.
...
llvm-svn: 81983
2009-09-16 01:26:05 +00:00
Douglas Gregor
82e22869aa
Fix a typo in a FIXME
...
llvm-svn: 81960
2009-09-16 00:01:48 +00:00
Mike Stump
e18856dad1
Back to 1.1 we go.
...
llvm-svn: 81944
2009-09-15 23:04:22 +00:00
Fariborz Jahanian
a9c4041471
In building list of visible conversion functions, use
...
result type of template convesion functions.
llvm-svn: 81943
2009-09-15 23:02:16 +00:00
Douglas Gregor
87f5406081
When implicitly declaring operators new, new[], delete, and delete[],
...
give them the appropriate exception specifications. This,
unfortunately, requires us to maintain and/or implicitly generate
handles to namespace "std" and the class "std::bad_alloc". However,
every other approach I've come up with was more hackish, and this
standard requirement itself is quite the hack.
Fixes PR4829.
llvm-svn: 81939
2009-09-15 22:30:29 +00:00
Fariborz Jahanian
adcea10410
1) don't do overload resolution in selecting conversion
...
to pointer function for delete expression. 2)
Treat type conversion function and its 'const' version
as identical in building the visible conversion list.
llvm-svn: 81930
2009-09-15 22:15:23 +00:00
Mike Stump
c3844bea75
Be sure to use the correct version instead of inventing the wrong one.
...
llvm-svn: 81924
2009-09-15 21:48:34 +00:00
Anders Carlsson
c8bfc466f3
Add back the workaround since it lead to constructor conversion bugs :(
...
llvm-svn: 81917
2009-09-15 21:14:33 +00:00
Douglas Gregor
f70b2b4f38
Make sure we're comparing the canonical types when we determine
...
whether a constructor is a copy constructor.
Sadly, I wasn't able to get down to a test case smaller than libstdc++'s
<string>.
llvm-svn: 81913
2009-09-15 20:50:23 +00:00
Douglas Gregor
4fb9cde8ef
When printing an overload candidate that is a function template specialization,
...
point at the template and print out its template arguments, e.g.,
ambiguous-ovl-print.cpp:5:8: note: candidate function template specialization
[with T = int]
void f(T*, long);
llvm-svn: 81907
2009-09-15 20:11:42 +00:00
Fariborz Jahanian
3e6b57e593
Issue good diagnostics when initialization failes due to
...
ambiguity in type conversion function selection.
llvm-svn: 81898
2009-09-15 19:12:21 +00:00
Douglas Gregor
31fae89497
Add an assertion and a test case, in a fruitless attempt to track down an existing bug
...
llvm-svn: 81885
2009-09-15 18:26:13 +00:00
Ted Kremenek
188f62f1cc
Fix static analyzer regression when emitting undefined value warnings
...
with binary operators. The result of a binary operator may be
undefined even if its operands are well-defined.
llvm-svn: 81874
2009-09-15 17:43:54 +00:00
Fariborz Jahanian
c34c179f4b
Perform overload resolution when selecting a pointer conversion
...
function for delete of a class expression and issue
good diagnostic when result is ambiguous.
llvm-svn: 81870
2009-09-15 17:21:47 +00:00
Douglas Gregor
00a511f0c1
Slightly improved template argument deduction for use in partial
...
ordering, along with another test case for partial ordering of partial
specializations.
llvm-svn: 81869
2009-09-15 16:51:42 +00:00
Anders Carlsson
1450adbbf9
Code generation of Conditional operators that are lvalues (but that aren't bitfields).
...
llvm-svn: 81867
2009-09-15 16:35:24 +00:00
Douglas Gregor
be999390eb
Implement partial ordering of class template partial specializations
...
(C++ [temp.class.order]).
llvm-svn: 81866
2009-09-15 16:23:51 +00:00
Anders Carlsson
01ccf998d5
Use getTrueExpr/getFalseExpr as suggested by Doug.
...
llvm-svn: 81863
2009-09-15 16:03:44 +00:00
Anders Carlsson
6b2737d591
If a conversion operator exists in a base class, make sure to cast the object to that base class.
...
llvm-svn: 81852
2009-09-15 07:42:44 +00:00
Anders Carlsson
110b07b848
When performing an user defined conversion sequence, perform the initial standard conversion sequence. This lets us remove a workaround in SemaCompleteConstructorCall.
...
llvm-svn: 81847
2009-09-15 06:28:28 +00:00
Anders Carlsson
611da28725
Revert for real.
...
llvm-svn: 81844
2009-09-15 05:49:31 +00:00
Anders Carlsson
e5506884cc
Whoops, didn't mean to commit this.
...
llvm-svn: 81842
2009-09-15 05:31:01 +00:00
Anders Carlsson
4e66cda3f7
Only reuse an already existing ImplicitCastExpr if the cast kinds are the same.
...
llvm-svn: 81841
2009-09-15 05:28:24 +00:00
Anders Carlsson
d3bc31f04f
Get rid of the CastInfo struct.
...
llvm-svn: 81839
2009-09-15 05:13:45 +00:00
Anders Carlsson
7cd39e0721
Handle reinterpret_cast between integral types and pointer types.
...
llvm-svn: 81837
2009-09-15 04:48:33 +00:00
Anders Carlsson
04c3bf4fab
Codegen support for nullptr from C++0x.
...
llvm-svn: 81835
2009-09-15 04:39:46 +00:00
Ted Kremenek
b66229464e
Per feedback from Eli, recognize in the transfer function logic for
...
__builtin_offsetof in the static analyzer that __builtin_offsetof is
not guaranteed to return an integer constant. We will need to shore
this up later, but now at least we have correct support for when this
*is* an integer constant.
llvm-svn: 81830
2009-09-15 04:19:09 +00:00
Ted Kremenek
3413f277d0
Fix typo in comment.
...
llvm-svn: 81825
2009-09-15 03:28:00 +00:00
Ted Kremenek
27347135dd
Add static analyzer transfer function support for __builtin_offsetof.
...
llvm-svn: 81820
2009-09-15 00:40:32 +00:00
Fariborz Jahanian
19c7328881
Issue a good diagnostics when attempt to select
...
a type convesion function results in ambiguity.
llvm-svn: 81812
2009-09-15 00:10:11 +00:00
Anders Carlsson
3fa58d1f63
Diagnose taking the address of a bit-field inside a conditional operator.
...
llvm-svn: 81808
2009-09-14 23:15:26 +00:00
Douglas Gregor
6010da024c
Implement partial ordering of function templates when calling a
...
conversion function.
llvm-svn: 81807
2009-09-14 23:02:14 +00:00
Douglas Gregor
48bc374d1e
Test function template partial ordering when resolving the address of
...
an overloaded function (template).
llvm-svn: 81804
2009-09-14 22:02:01 +00:00
Ted Kremenek
4112969df1
Fix: <rdar://problem/5905851> do not report a leak when post-dominated by a call
...
to a noreturn or panic function
llvm-svn: 81803
2009-09-14 22:01:32 +00:00
John McCall
27b5c253d8
Skeletal support for friend class templates.
...
llvm-svn: 81801
2009-09-14 21:59:20 +00:00
Daniel Dunbar
09d3362bf5
ARM/[A]APCS: Ignore empty records passed as arguments.
...
llvm-svn: 81798
2009-09-14 21:54:03 +00:00
Douglas Gregor
e1d2ef3508
Refactor MarkDeductedTemplateParameters into
...
MarkUsedTemplateParameters, which is able to mark template parameters
used within non-deduced contexts as well as deduced contexts. Use this
to finish the implementation of [temp.deduct.partial]p11.
llvm-svn: 81794
2009-09-14 21:25:05 +00:00
Fariborz Jahanian
f4061e39a3
Used visible conversion function api to do overload
...
resolution of type conversion functions in base and
current class.
llvm-svn: 81784
2009-09-14 20:41:01 +00:00
Ted Kremenek
37a118520c
Implement FIXME: free up BugReportEquivClass objects when deleting BugTypes.
...
llvm-svn: 81783
2009-09-14 20:40:59 +00:00
Sam Weinig
b7608d7064
-Wchar-subscripts should not warn for explicit signed char subscripts either. Another fix for PR4978.
...
llvm-svn: 81780
2009-09-14 20:14:57 +00:00