Commit Graph

16 Commits

Author SHA1 Message Date
Douglas Gregor 1b30b3c9fa When transforming a C++ "new" expression's constructor arguments, drop
any arguments that are default-argument expressions. The can show up
when we have a new expression whose constructor arguments are not
type-dependent and whose allocated type is not dependent and has a
constructor with default arguments. Fixes PR7202.

llvm-svn: 104690
2010-05-26 07:10:06 +00:00
Douglas Gregor b33eed0ced Collapse the three separate initialization paths in
TryStaticImplicitCast (for references, class types, and everything
else, respectively) into a single invocation of
InitializationSequence.

One of the paths (for class types) was the only client of
Sema::TryInitializationByConstructor, which I have eliminated. This
also simplified the interface for much of the cast-checking logic,
eliminating yet more code.

I've kept the representation of C++ functional casts with <> 1
arguments the same, despite the fact that I hate it. That fix will
come soon. To satisfy my paranoia, I've bootstrapped + tested Clang
with these changes.

llvm-svn: 101549
2010-04-16 22:09:46 +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
Douglas Gregor 4bbd1acf8b When type-checking a C++ "new" expression, don't type-check the actual
initialization if any of the constructor/initialization arguments are
type-dependent. Fixes PR5224.

llvm-svn: 84365
2009-10-17 21:40:42 +00:00
Douglas Gregor 2ffd96549d Implement proper substitution for OverloadedFunctionDecls, but substituting each of the functions in the overload set
llvm-svn: 80692
2009-09-01 17:53:10 +00:00
Douglas Gregor 32e2c8472e Fix a crasher involving template instantiation of non-dependent
expressions making use of an overloaded operator. Thanks for the test
case, Anders!

llvm-svn: 80679
2009-09-01 16:58:52 +00:00
Douglas Gregor f14b46f9a8 Implement template instantiation for member operator access.
llvm-svn: 80609
2009-08-31 20:00:26 +00:00
Douglas Gregor b4850465b7 Introduce basic support for instantiating the definitions of member
functions of class templates. Only compound statements and expression
statements are currently implemented.

llvm-svn: 71814
2009-05-14 23:26:13 +00:00
Douglas Gregor 372565211e Introduce a stack of instantiation scopes that are used to store the mapping from variable declarations that occur within templates to their instantiated counterparts
llvm-svn: 71799
2009-05-14 21:44:34 +00:00
Douglas Gregor 24c332b140 Link FunctionDecls instantiated from the member functions of a class
template to the FunctionDecls from which they were instantiated. This
is a necessary first step to support instantiation of the definitions
of such functions, but by itself does essentially nothing.

llvm-svn: 71792
2009-05-14 21:06:31 +00:00
Daniel Dunbar a45cf5b6b0 Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
2009-03-24 02:24:46 +00:00
Gabor Greif 7b5243a1fc added type dependent testcase
llvm-svn: 67230
2009-03-18 20:26:44 +00:00
Gabor Greif 68cfd78375 cleanup instantiation code, tighten testcase
llvm-svn: 67148
2009-03-18 01:16:08 +00:00
Gabor Greif 8af7837b08 instantiate ?: expressions
llvm-svn: 67145
2009-03-18 00:55:04 +00:00
Douglas Gregor 084d855a17 Implement template instantiation for the prefix unary operators. As
always, refactored the existing logic to tease apart the parser action
and the semantic analysis shared by the parser and template
instantiation.

llvm-svn: 66987
2009-03-13 23:49:33 +00:00
Douglas Gregor 4b7f3d7344 Devious test-case involved overload resolution and ADL during template instantiation.
llvm-svn: 66951
2009-03-13 21:04:12 +00:00