Sebastian Redl
14236c8e82
Special-case default argument expression in instantiation. This should fix PR4301. Doug, please double-check my assumptions. Read the PR for more details.
...
llvm-svn: 86465
2009-11-08 13:56:19 +00:00
Anders Carlsson
561f793890
Make sure to call CompleteConstructorCall for bases and members that are initialized implicitly in constructors so that default arguments etc are set correctly. Fixes PR5283.
...
llvm-svn: 85510
2009-10-29 15:46:07 +00:00
Douglas Gregor
4f15f4dec1
Merge uninstantiated default arguments more carefully, and try not to
...
complain about specializations of member functions that are not
definitions. Fixes PR4995.
llvm-svn: 82159
2009-09-17 19:51:30 +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
Douglas Gregor
c732aba9a9
Cleanup and test C++ default arguments. Improvements include:
...
- Diagnose attempts to add default arguments to templates (or member
functions of templates) after the initial declaration (DR217).
- Improve diagnostics when a default argument is redefined. Now, the
note will always point at the place where the default argument was
previously defined, rather than pointing to the most recent
declaration of the function.
llvm-svn: 81548
2009-09-11 18:44:32 +00:00
Anders Carlsson
faf1ced5ee
Reapply 81096, now with a fix. Spot the bug:
...
for (unsigned i = numargs; i < NumArgs; ++i)
Args[0] = 0;
;)
llvm-svn: 81123
2009-09-06 16:54:02 +00:00
Daniel Dunbar
94bcae46d5
Revert "Initialize default CXXConstructExpr arguments to 0. Fixes a crash when
...
destroying the CXXConstructExpr.", this is causing test failures across the
board.
llvm-svn: 81100
2009-09-06 01:31:23 +00:00
Anders Carlsson
8284d7caa3
Initialize default CXXConstructExpr arguments to 0. Fixes a crash when destroying the CXXConstructExpr.
...
llvm-svn: 81096
2009-09-05 22:51:06 +00:00
Anders Carlsson
dc6d2c3cda
Report errors for member functions correctly.
...
llvm-svn: 81063
2009-09-05 05:38:54 +00:00
Anders Carlsson
657bad441e
Use a separate diagnostic for default function argument expressions.
...
llvm-svn: 81062
2009-09-05 05:14:19 +00:00
Douglas Gregor
7315672a60
Add a little more testing for default arguments of constructors in a class template
...
llvm-svn: 79989
2009-08-25 15:24:38 +00:00
Anders Carlsson
114056f22c
If a parameter has a default argument expression, make sure to instantiate the parameter type before checking that the expression is a valid initializer.
...
llvm-svn: 79986
2009-08-25 13:46:13 +00:00
Anders Carlsson
10ebe78730
Improved support for default arguments in constructors for class templates.
...
llvm-svn: 79984
2009-08-25 13:07:08 +00:00
Anders Carlsson
4562f1f066
Basic support for default argument expressions for function templates.
...
llvm-svn: 79972
2009-08-25 03:18:48 +00:00