* semantics.c (finish_compound_literal): Handle class placeholder.
From-SVN: r240802
This commit is contained in:
parent
2e21fd4d98
commit
8b7033e0e1
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// { dg-options -std=c++1z }
|
||||
|
||||
template<class T> struct S{S(T){}};
|
||||
|
||||
int main() {
|
||||
S{1};
|
||||
}
|
Loading…
Reference in New Issue