llvm-project/clang/test/CXX/temp
Sebastian Redl a935179ab7 Represent C++ direct initializers as ParenListExprs before semantic analysis
instead of having a special-purpose function.

- ActOnCXXDirectInitializer, which was mostly duplication of
  AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days
  ago), is dropped completely.
- MultiInitializer, which was an ugly hack I added, is dropped again.
- We now have the infrastructure in place to distinguish between
  int x = {1};
  int x({1});
  int x{1};
-- VarDecl now has getInitStyle(), which indicates which of the above was used.
-- CXXConstructExpr now has a flag to indicate that it represents list-
   initialization, although this is not yet used.
- InstantiateInitializer was renamed to SubstInitializer and simplified.
- ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which
  always produces a ParenListExpr. Placed that so far failed to convert that
  back to a ParenExpr containing comma operators have been fixed. I'm pretty
  sure I could have made a crashing test case before this.

The end result is a (I hope) considerably cleaner design of initializers.
More importantly, the fact that I can now distinguish between the various
initialization kinds means that I can get the tricky generalized initializer
test cases Johannes Schaub supplied to work. (This is not yet done.)

This commit passed self-host, with the resulting compiler passing the tests. I
hope it doesn't break more complicated code. It's a pretty big change, but one
that I feel is necessary.

llvm-svn: 150318
2012-02-11 23:51:47 +00:00
..
temp.arg Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
temp.decls Represent C++ direct initializers as ParenListExprs before semantic analysis 2012-02-11 23:51:47 +00:00
temp.fct.spec Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
temp.names Reinstate r104117, Chandler Carruth's change that "[provides] a naming 2010-05-20 20:58:56 +00:00
temp.param Fix pr9789, assert-on-invalid while instantiating an (invalid) class template with a non-final parameter pack. Also improve the warning for non-final parameter packs in this scenario so it only fires once, rather than once for every template parameter after the non-final parameter pack. 2011-10-19 05:19:50 +00:00
temp.res Some tests missed from r144056. 2011-11-08 02:18:13 +00:00
temp.spec Fix "note" of a duplicate explicit instantiation definition following a specialization. 2012-01-09 19:52:25 +00:00
temp.type Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
p3.cpp PR10359: Template declarations which define classes are not permitted to also contain declarators. Previously we would accept code like this: 2011-07-14 21:35:26 +00:00