On 01/22/2018 06:06 PM, Jakub Jelinek wrote:
Hi!

I've recently added the complete_type call in case the structured binding
is a reference to a type that needs to be instantiated.
This testcase shows a problem where it can't be instantiated and we ICE
because we don't expect an incomplete type.  If decl isn't a reference,
cp_finish_decl for it should handle everything.
I've considered using complete_type_or_else, but we aren't checking that
decl's type is complete, but rather that the type it refers to is complete,
and furthermore not sure if it is very nice to print <structured bindings>
in the diagnostics.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2018-01-22  Jakub Jelinek  <ja...@redhat.com>

        PR c++/83958
        * decl.c (cp_finish_decomp): Diagnose if reference structure binding
        refers to incomplete type.

        * g++.dg/cpp1z/decomp35.C: New test.


ok, thanks


--
Nathan Sidwell

Reply via email to