* semantics.c (finish_compound_literal): Handle class placeholder.

From-SVN: r240802
This commit is contained in:
Jason Merrill 2016-10-05 14:57:45 -04:00 committed by Jason Merrill
parent 2e21fd4d98
commit 8b7033e0e1
3 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2016-10-05 Jason Merrill <jason@redhat.com>
* semantics.c (finish_compound_literal): Handle class placeholder.
2016-10-05 Marek Polacek <polacek@redhat.com>
Implement P0305R1, Selection statements with initializer.

View File

@ -2671,6 +2671,11 @@ finish_compound_literal (tree type, tree compound_literal,
return error_mark_node;
}
if (tree anode = type_uses_auto (type))
if (CLASS_PLACEHOLDER_TEMPLATE (anode))
type = do_auto_deduction (type, compound_literal, anode, complain,
adc_variable_type);
if (processing_template_decl)
{
TREE_TYPE (compound_literal) = type;

View File

@ -0,0 +1,7 @@
// { dg-options -std=c++1z }
template<class T> struct S{S(T){}};
int main() {
S{1};
}