Commit 8b7033e0 by Jason Merrill Committed by Jason Merrill

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

From-SVN: r240802
parent 2e21fd4d
2016-10-05 Jason Merrill <jason@redhat.com>
* semantics.c (finish_compound_literal): Handle class placeholder.
2016-10-05 Marek Polacek <polacek@redhat.com> 2016-10-05 Marek Polacek <polacek@redhat.com>
Implement P0305R1, Selection statements with initializer. Implement P0305R1, Selection statements with initializer.
......
...@@ -2671,6 +2671,11 @@ finish_compound_literal (tree type, tree compound_literal, ...@@ -2671,6 +2671,11 @@ finish_compound_literal (tree type, tree compound_literal,
return error_mark_node; 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) if (processing_template_decl)
{ {
TREE_TYPE (compound_literal) = type; TREE_TYPE (compound_literal) = type;
......
// { dg-options -std=c++1z }
template<class T> struct S{S(T){}};
int main() {
S{1};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment