+2018-04-04 Richard Biener <rguenther@suse.de>
+
+ PR lto/85176
+ * dwarf2out.c (dwarf2out_register_external_die): Peel namespaces
+ from contexts for DINFO_LEVEL_TERSE and below.
+
2018-04-04 Kito Cheng <kito.cheng@gmail.com>
* config/nds32/nds32-doubleword.md (move_<mode>): Require
}
else
ctx = DECL_CONTEXT (decl);
+ /* Peel types in the context stack. */
while (ctx && TYPE_P (ctx))
ctx = TYPE_CONTEXT (ctx);
+ /* Likewise namespaces in case we do not want to emit DIEs for them. */
+ if (debug_info_level <= DINFO_LEVEL_TERSE)
+ while (ctx && TREE_CODE (ctx) == NAMESPACE_DECL)
+ ctx = DECL_CONTEXT (ctx);
if (ctx)
{
if (TREE_CODE (ctx) == BLOCK)
+2018-04-04 Richard Biener <rguenther@suse.de>
+
+ PR lto/85176
+ * g++.dg/lto/pr85176_0.C: New testcase.
+
2018-04-04 Richard Biener <rguenther@suse.de>
PR testsuite/85191
--- /dev/null
+// { dg-lto-do link }
+// { dg-lto-options { { -flto -g1 } } }
+// { dg-extra-ld-options "-r -nostdlib" }
+namespace a {
+ template <typename b, typename = b> class c;
+ template <typename b, typename d> void e(c<b, d> &);
+ void operator<<(c<char> &f, const char *) { e(f); }
+ extern c<char> cout;
+}
+int main() { a::cout << ""; }