History log of /external/clang/test/SemaTemplate/instantiate-expr-4.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
4967a710c84587c654b56c828382219c3937dacb 20-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master Clang for rebase to r275480

Bug: http://b/31320715

This merges commit ac9cc4764cf47a6c3f031687d8592e080c9f5001 from
aosp/dev.

Test: Build AOSP and run RenderScript tests (host tests for slang and
libbcc, RsTest, CTS)

Change-Id: Ic2875e5c3673c83448cd7d1013861e42947b1b55
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
31161c79edf73035ac36007f6ad935d61340dc51 26-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix crash due to missing array-to-pointer decay when instantiating an unresolved
member expression. Refactoring to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
2ad63cf7146268a336b5a931f626adaa8a5150f0 26-Jul-2011 Douglas Gregor <dgregor@apple.com> When we decide not to rebuild an instantiated C++ 'new' expression
that allocates an array of objects with a non-trivial destructor, be
sure to mark the destructor is "used". Fixes PR10480 /
<rdar://problem/9834317>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
abea951c34876a5374d0e3678c7989b225c5c895 28-Feb-2011 Anders Carlsson <andersca@mac.com> Add -fcxx-exceptions to all tests that use C++ exceptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
e41721e7dfabcc15cb50be9075a4153f1ad648ea 19-Feb-2011 Anders Carlsson <andersca@mac.com> Pass -fexceptions to all tests that use try/catch/throw.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
b2b5cc0cf908d516a107d373db963f692449a8a8 04-Jan-2011 Chandler Carruth <chandlerc@gmail.com> Enhance the diagnostic for negative array sizes to include the
declaration name of the array when present. This ensures that
a poor-man's C++03 static_assert will include the user error message
often embedded in the name.

Update all the tests to reflect the new wording, and add a test for the
name behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
58f9e13e87e57236fee4b914eea9be6f92a1c345 05-Sep-2010 Chris Lattner <sabre@nondot.org> make clang print types as "const int *" instead of "int const*",
which is should have done from the beginning. As usual, the most
fun with this sort of change is updating all the testcases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113090 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
7114cbab7eb6e8b714eb22f014327daf2c741c08 27-Aug-2010 John McCall <rjmccall@apple.com> Continue to instantiate sub-statements in a CompoundStmt as long as
we don't see a DeclStmt (failure to instantiate which generally causes
panic).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
a3ce8ae36144991fa125dafc5345a03cc875e503 31-Mar-2010 Chandler Carruth <chandlerc@gmail.com> Re-bind non-dependent CXXTemporaryObjectExpr nodes as temporaries when
instantiating a template, which ensures the destructor is called. This fixes
PR6671.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
7c2342dd4c9947806842e5aca3d2bb2e542853c9 10-Mar-2010 John McCall <rjmccall@apple.com> When pretty-printing tag types, only print the tag if we're in C (and
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98149 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
60c93c9981c467738369702e7aa23fd58c2b6aac 09-Feb-2010 Douglas Gregor <dgregor@apple.com> Migrate the mish-mash of declaration checks in
Sema::ActOnUninitializedDecl over to InitializationSequence (with
default initialization), eliminating redundancy. More importantly, we
now check that a const definition in C++ has an initilizer, which was
an #if 0'd code for many, many months. A few other tweaks were needed
to get everything working again:

- Fix all of the places in the testsuite where we defined const
objects without initializers (now that we diagnose this issue)
- Teach instantiation of static data members to find the previous
declaration, so that we build proper redeclaration
chains. Previously, we had the redeclaration chain but built it
too late to be useful, because...
- Teach instantiation of static data member definitions not to try
to check an initializer if a previous declaration already had an
initializer. This makes sure that we don't complain about static
const data members with in-class initializers and out-of-line
definitions.
- Move all of the incomplete-type checking logic out of
Sema::FinalizeDeclaratorGroup; it makes more sense in
ActOnUnitializedDecl.

There may still be a few places where we can improve these
diagnostics. I'll address that as a separate commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
2bbae5de98f486d03e10c039668182075b5569dd 23-Jan-2010 Anders Carlsson <andersca@mac.com> Use the new init code for member subobjects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
220ccbf2c9ef97034cce80561f9f46c4f1f63bc7 13-Jan-2010 John McCall <rjmccall@apple.com> Improve the reporting of non-viable overload candidates by noting the reason
why the candidate is non-viable. There's a lot we can do to improve this, but
it's a good start. Further improvements should probably be integrated with the
bad-initialization reporting routines.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
b1622a1fd7b7f4ab8d00d0183d17c90ad25c14e3 06-Jan-2010 John McCall <rjmccall@apple.com> Improve the diagnostics used to report implicitly-generated class members
as parts of overload sets. Also, refer to constructors as 'constructors'
rather than functions.

Adjust a lot of tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
765ccba920269eefbf572ec4bcd6ac7b6e9f9f77 23-Dec-2009 Douglas Gregor <dgregor@apple.com> Diagnose the use of incomplete types in C++ typeid expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
5b5ad8453c8e79f642c3ddfeeadf162ae67309c0 22-Dec-2009 Douglas Gregor <dgregor@apple.com> When transforming a C++ "new" expression that was not explicitly given
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
18ef5e28a9a2677f8b1dce1fb2638d66e0a1621f 18-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch the initialization required by return statements over to the
new InitializationSequence. This fixes some bugs (e.g., PR5808),
changed some diagnostics, and caused more churn than expected. What's
new:

- InitializationSequence now has a "C conversion sequence" category
and step kind, which falls back to
- Changed the diagnostics for returns to always have the result type
of the function first and the type of the expression second.
CheckSingleAssignmentConstraints to peform checking in C.
- Improved ASTs for initialization of return values. The ASTs now
capture all of the temporaries we need to create, but
intentionally do not bind the tempoary that is actually returned,
so that it won't get destroyed twice.
- Make sure to perform an (elidable!) copy of the class object that
is returned from a class.
- Fix copy elision in CodeGen to properly see through the
subexpressions that occur with elidable copies.
- Give "new" its own entity kind; as with return values and thrown
objects, we don't bind the expression so we don't call a
destructor for it.

Note that, with this patch, I've broken returning move-only types in
C++0x. We'll fix it later, when we tackle NRVO.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91669 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
99a2e600f9e2e51d3ce10fb6f27191677ac65b2a 16-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization.

Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.

Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.

Implemented support for default initialization in
InitializationSequence.

Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.

Taught CXXConstructExpr to store more location information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
a5728872c7702ddd09537c95bc3cbd20e1f2fb09 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> 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).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
a88cfbfac9bbcbb9858f048d6d73a48711d8e93d 12-Dec-2009 Douglas Gregor <dgregor@apple.com> Rework the way we handle template instantiation for
implicitly-generated AST nodes. We previously built instantiated nodes
for each of these AST nodes, then passed them on to Sema, which was
not prepared to see already-type-checked nodes (see PR5755). In some
places, we had ugly workarounds to try to avoid re-type-checking
(e.g., in VarDecl initializer instantiation).

Now, we skip implicitly-generated nodes when performing instantiation,
preferring instead to build just the AST nodes that directly reflect
what was written in the source code. This has several advantages:

- We don't need to instantiate anything that doesn't have a direct
correlation to the source code, so we can have better location
information.
- Semantic analysis sees the same thing at template instantiation
time that it would see for a non-template.
- At least one ugly hack (VarDecl initializers) goes away.

Fixes PR5755.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
20093b4bf698f292c664676987541d5103b65b15 10-Dec-2009 Douglas Gregor <dgregor@apple.com> Reimplement reference initialization (C++ [dcl.init.ref]) using the
new notion of an "initialization sequence", which encapsulates the
computation of the initialization sequence along with diagnostic
information and the capability to turn the computed sequence into an
expression. At present, I've only switched one CheckReferenceInit
callers over to this new mechanism; more will follow.

Aside from (hopefully) being much more true to the standard, the
diagnostics provided by this reference-initialization code are a bit
better than before. Some examples:

p5-var.cpp:54:12: error: non-const lvalue reference to type 'struct
Derived'
cannot bind to a value of unrelated type 'struct Base'
Derived &dr2 = b; // expected-error{{non-const lvalue reference to
...
^ ~
p5-var.cpp:55:9: error: binding of reference to type 'struct Base' to
a value of
type 'struct Base const' drops qualifiers
Base &br3 = bc; // expected-error{{drops qualifiers}}
^ ~~

p5-var.cpp:57:15: error: ambiguous conversion from derived class
'struct Diamond' to base class 'struct Base':
struct Diamond -> struct Derived -> struct Base
struct Diamond -> struct Derived2 -> struct Base
Base &br5 = diamond; // expected-error{{ambiguous conversion from
...
^~~~~~~
p5-var.cpp:59:9: error: non-const lvalue reference to type 'long'
cannot bind to
a value of unrelated type 'int'
long &lr = i; // expected-error{{non-const lvalue reference to type
...
^ ~

p5-var.cpp:74:9: error: non-const lvalue reference to type 'struct
Base' cannot
bind to a temporary of type 'struct Base'
Base &br1 = Base(); // expected-error{{non-const lvalue reference to
...
^ ~~~~~~

p5-var.cpp:102:9: error: non-const reference cannot bind to bit-field
'i'
int & ir1 = (ib.i); // expected-error{{non-const reference cannot
...
^ ~~~~~~
p5-var.cpp:98:7: note: bit-field is declared here
int i : 17; // expected-note{{bit-field is declared here}}
^






git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
e30d0bdda24708e9a667722a56b9c96153fe8b4d 23-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for qualified declaration reference
expressions. We are now missing template instantiation logic for only
three classes of expressions:
- Blocks-related expressions (BlockExpr, BlockDeclRefExpr)
- C++ default argument expressions
- Objective-C expressions

Additionally, our handling of DeclRefExpr is still quite poor, since
it cannot handle references to many kinds of declarations.

As part of this change, converted the TemplateExprInstantiator to use
iteration through all of the expressions via clang/AST/StmtNodes.def,
ensuring that we don't forget to add template instantiation logic for
any new expression node kinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
08d3e7c9ccbed9b26c301390d5997871b2dd41b7 22-May-2009 Douglas Gregor <dgregor@apple.com> Add a few tests to ensure that member functions of class templates can
call other member functions of class templates, including after
template instantiation. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
1c0ca59416999129d0439c2661d137ef38e86209 22-May-2009 Douglas Gregor <dgregor@apple.com> Representation of and template instantiation for member
expressions. This change introduces another AST node,
CXXUnresolvedMemberExpr, that captures member references (x->m, x.m)
when the base of the expression (the "x") is type-dependent, and we
therefore cannot resolve the member reference yet.

Note that our parsing of member references for C++ is still quite
poor, e.g., we don't handle x->Base::m or x->operator int.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
ccb97f52afeb4ce5b239a6f3b44956d9e220e5e3 21-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for initializer lists

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
36bb03b86ab6f905b336ee9ec11f288291b22b45 21-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for unary type traits, e.g., __is_pod

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
12d0c307369e4a523e2e40025bf124c310f98dff 21-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C++ "typeid" expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
42e5b50f4dc897f252e0d476063a7f9846d96624 21-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C++ throw expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
d0c02674e32cea54e386a52094f89abb71b274da 21-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C++ delete expression

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
3433cf7dfda405bf51bba914a338adf645a87e3b 21-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for C++ "new" expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
e06274d5c5c6b2decc9f217a8913b28f846bfcfa 20-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for CXXExprWithTemporaries, which occurs when
temporaries are generated for some object-constructing expressions in
templates that are not type-dependent.

Also, be sure to introduce the variable from a CXXConditionDeclExpr
into the set of instantiated local variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp
d94546a0a1deef7286c13e49b9584621ae81cc9a 20-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for the various kinds of AST nodes that occur
due to C++ type construction of the form T(a1, a2, ..., aN).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72183 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/SemaTemplate/instantiate-expr-4.cpp