/*context*/std_node,
/*entering_scope*/false, tf_none);
inst = complete_type (inst);
- if (inst == error_mark_node || !COMPLETE_TYPE_P (inst))
+ if (inst == error_mark_node
+ || !COMPLETE_TYPE_P (inst)
+ || !CLASS_TYPE_P (type))
return NULL_TREE;
tree val = lookup_qualified_name (inst, value_identifier,
LOOK_want::NORMAL, /*complain*/false);
+ if (val == error_mark_node)
+ return NULL_TREE;
if (VAR_P (val) || TREE_CODE (val) == CONST_DECL)
val = maybe_constant_value (val);
if (TREE_CODE (val) == INTEGER_CST)
struct A1 { int i,j; } a1;
template<> struct std::tuple_size<A1> { };
-void f1() { auto [ x ] = a1; } // { dg-error "is not an integral constant expression" }
+void f1() { auto [ x ] = a1; } // { dg-error "only 1 name provided" }
struct A2 { int i,j; } a2;
template<> struct std::tuple_size<A2> { enum { value = 5 }; };
--- /dev/null
+// DR 2386
+// PR c++/110216
+// { dg-do compile { target c++17 } }
+
+
+namespace std{
+ template <typename T> struct tuple_size;
+}
+
+struct A {
+ int x = 0;
+};
+
+template <> struct std::tuple_size <::A> {};
+
+auto [x] = A{};
+
+int
+main ()
+{
+}