David Blaikie
7555b6a4e5
Improve some of the conversion warnings to fire on conversion to bool.
...
Moves the bool bail-out down a little in SemaChecking - so now
-Wnull-conversion and -Wliteral-conversion can fire when the target type is
bool.
Also improve the wording/details in the -Wliteral-conversion warning to match
the -Wconstant-conversion.
llvm-svn: 156826
2012-05-15 16:56:36 +00:00
David Blaikie
631a486e6a
Fix crash & accepts-invalid for array of arrays of user defined type.
...
Test case/other help by Richard Smith.
Code review by John McCall.
llvm-svn: 152519
2012-03-10 23:40:02 +00:00
Douglas Gregor
7234103225
Don't consider an overloaded operator& when the expression is actually
...
going to be a pointer-to-member constant. Fixes <rdar://problem/10544564>.
llvm-svn: 146587
2011-12-14 21:23:13 +00:00
Richard Smith
9ca5c42582
Update all tests other than Driver/std.cpp to use -std=c++11 rather than
...
-std=c++0x. Patch by Ahmed Charles!
llvm-svn: 141900
2011-10-13 22:29:44 +00:00
Douglas Gregor
cda2270217
Allow calling an overloaded function set by taking the address of the
...
functions, e.g., (&f)(0). Fixes <rdar://problem/9803316>.
llvm-svn: 141877
2011-10-13 18:10:35 +00:00
John McCall
50a2c2c19d
Catch placeholder types in DefaultLvalueConversion
...
and DefaultFunctionArrayLvalueConversion. To prevent
significant regression for should-this-be-a-call fixits,
and to repair some such regression from the introduction of
bound member placeholders, make those placeholder checks
try to build calls appropriately. Harden the build-a-call
logic while we're at it.
llvm-svn: 141738
2011-10-11 23:14:30 +00:00
Eli Friedman
622e4fcac6
PR9899: handle pseudo-destructors correctly in noexcept() expressions.
...
llvm-svn: 131220
2011-05-12 02:11:32 +00:00
Eli Friedman
c6587cc550
PR9882: Fix noexcept to deal with dependent new, delete, calls, and
...
dynamic_cast correctly.
llvm-svn: 131177
2011-05-11 05:22:44 +00:00
Douglas Gregor
89f3cd5c15
Clean up our handling of template-ids that resolve down to a single
...
overload, so that we actually do the resolution for full expressions
and emit more consistent, useful diagnostics. Also fixes an IRGen
crasher, where Sema wouldn't diagnose a resolvable bound member
function template-id used in a full-expression (<rdar://problem/9108698>).
llvm-svn: 127747
2011-03-16 19:16:25 +00:00
Sebastian Redl
52ddca23a7
Extend the noexcept expression test to test noexcept specification functions.
...
llvm-svn: 127693
2011-03-15 20:45:42 +00:00
Anders Carlsson
6774b1f1c1
Add -fcxx-exceptions to all tests that use C++ exceptions.
...
llvm-svn: 126599
2011-02-28 00:40:07 +00:00
Richard Smith
30482bc786
Implement the C++0x deduced 'auto' feature.
...
This fixes PR 8738, 9060 and 9132.
llvm-svn: 126069
2011-02-20 03:19:35 +00:00
Anders Carlsson
479d6f51e3
Pass -fexceptions to all tests that use try/catch/throw.
...
llvm-svn: 126037
2011-02-19 19:23:03 +00:00
Douglas Gregor
fa7781384e
Implement access checking for the "delete" operator. Fixes PR9050,
...
from Alex Miller!
llvm-svn: 124663
2011-02-01 15:50:11 +00:00
Douglas Gregor
f30101186f
Implement substitution of a function parameter pack for its set of
...
instantiated function parameters, enabling instantiation of arbitrary
pack expansions involving function parameter packs. At this point, we
can now correctly compile a simple, variadic print() example:
#include <iostream>
#include <string>
void print() {}
template<typename Head, typename ...Tail>
void print(const Head &head, const Tail &...tail) {
std::cout << head;
print(tail...);
}
int main() {
std::string hello = "Hello";
print(hello, ", world!", " ", 2011, '\n');
}
llvm-svn: 123000
2011-01-07 16:43:16 +00:00
Douglas Gregor
820ba7ba43
Implement the sizeof...(pack) expression to compute the length of a
...
parameter pack.
Note that we're missing proper libclang support for the new
SizeOfPackExpr expression node.
llvm-svn: 122813
2011-01-04 17:33:58 +00:00
Douglas Gregor
e81f58e180
Properly diagnose invalid casts to function references. Patch by
...
Faisal Vali, tweaked by me. Fixes PR8230.
llvm-svn: 118400
2010-11-08 03:40:48 +00:00
John McCall
36226621f6
Progress.
...
llvm-svn: 116287
2010-10-12 02:09:17 +00:00
Douglas Gregor
db8c6fd18f
Check that an overloaded function name, when used by the ! operator,
...
actually resolves to a particular function. Fixes PR8181, from Faisal
Vali!
llvm-svn: 114331
2010-09-20 17:13:33 +00:00
Sebastian Redl
a8bac37bb1
Test destructors in delete expressions and of temporaries for throwing.
...
llvm-svn: 113664
2010-09-10 23:27:10 +00:00
Sebastian Redl
b8a76c42b5
Address Doug's comments.
...
llvm-svn: 113650
2010-09-10 22:34:40 +00:00
Sebastian Redl
e56be2f72c
Eli helped me understand how evaluation contexts work.
...
llvm-svn: 113642
2010-09-10 21:57:27 +00:00
Sebastian Redl
8c40ba392c
Test CXXNoexceptExpr codegen and serialization.
...
llvm-svn: 113630
2010-09-10 21:04:03 +00:00
Sebastian Redl
4fa4a6b85e
Add another small test case.
...
llvm-svn: 113628
2010-09-10 21:03:58 +00:00
Sebastian Redl
dbd14bdefc
Tests for noexcept in templates.
...
llvm-svn: 113625
2010-09-10 20:55:50 +00:00
Sebastian Redl
5f0180d815
First version of a testcase, plus fixes.
...
llvm-svn: 113624
2010-09-10 20:55:47 +00:00
John McCall
7d46051eea
Catch the case of trying to turn '&(X::a)' into a member pointer as well.
...
llvm-svn: 111997
2010-08-24 23:26:21 +00:00
John McCall
0f55a035cf
Restore r101841 without modification. Also mark 'operator delete' as used for
...
actual delete expressions, not just new expressions.
llvm-svn: 101861
2010-04-20 02:18:25 +00:00
John McCall
44adf26dd0
Revert r101841 and follow-up.
...
llvm-svn: 101859
2010-04-20 01:42:53 +00:00
John McCall
75b4746e7d
Don't bother looking for (or diagnosing problems with) the 'operator delete'
...
associated with a new expression if -fno-exceptions is set.
llvm-svn: 101841
2010-04-20 00:22:43 +00:00
John McCall
3155f573f5
Turn access control on by default in -cc1.
...
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under access control.
llvm-svn: 100880
2010-04-09 19:03:51 +00:00
Douglas Gregor
6642ca217e
Implement semantic analysis for C++ [expr.new]p18-20, which describe
...
how we find the operator delete that matches withe operator new we
found in a C++ new-expression.
This will also need CodeGen support. On a happy note, we're now a
"nans" away from building tramp3d-v4.
llvm-svn: 97209
2010-02-26 05:06:18 +00:00
Daniel Dunbar
8fbe78f6fc
Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
...
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).
llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Daniel Dunbar
dd6e6918e6
Add test for expr.delete p5, with a FIXME.
...
llvm-svn: 88678
2009-11-13 19:13:56 +00:00