2019-02-20 Jakub Jelinek <jakub@redhat.com>
+ PR c++/89403
+ * decl2.c (c_parse_final_cleanups): Move TREE_ASM_WRITTEN setting
+ for flag_syntax_only from here...
+ * semantics.c (expand_or_defer_fn_1): ... here.
+
PR c++/89405
* decl.c (maybe_commonize_var): When clearing TREE_PUBLIC and
DECL_COMMON, set DECL_INTERFACE_KNOWN.
/* Generate RTL for this function now that we know we
need it. */
expand_or_defer_fn (decl);
- /* If we're compiling -fsyntax-only pretend that this
- function has been written out so that we don't try to
- expand it again. */
- if (flag_syntax_only)
- TREE_ASM_WRITTEN (decl) = 1;
reconsider = true;
}
}
/* There's no reason to do any of the work here if we're only doing
semantic analysis; this code just generates RTL. */
if (flag_syntax_only)
- return false;
+ {
+ /* Pretend that this function has been written out so that we don't try
+ to expand it again. */
+ TREE_ASM_WRITTEN (fn) = 1;
+ return false;
+ }
return true;
}
2019-02-20 Jakub Jelinek <jakub@redhat.com>
+ PR c++/89403
+ * g++.dg/cpp0x/pr89403.C: New test.
+
PR c++/89405
* g++.dg/cpp1z/inline-var5.C: New test.
--- /dev/null
+// PR c++/89403
+// { dg-do compile { target c++11 } }
+// { dg-options "-Os -fsyntax-only" }
+
+template <typename T>
+struct A : T {
+ constexpr A() : T() { }
+};
+
+template <typename T>
+struct B {
+ A<T> b;
+ constexpr B() { }
+};
+
+struct C { struct {} s; };
+constexpr B<C> b{};
+constexpr C c = b.b;