gcc/testsuite/g++.dg/debug/localclass2.C
raw| 1 | // PR c++/97918 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-require-effective-target lto } |
| 4 | // { dg-additional-options "-g -O -flto" } |
| 5 | |
| 6 | namespace { class A {}; } |
| 7 | class B {}; |
| 8 | template <typename T> struct H { |
| 9 | constexpr static unsigned h = 0; |
| 10 | }; |
| 11 | |
| 12 | template <typename T> A bar () |
| 13 | { |
| 14 | struct J { |
| 15 | static void foo(); |
| 16 | }; |
| 17 | H<J>(); |
| 18 | return A (); |
| 19 | } |
| 20 | |
| 21 | void fn () |
| 22 | { |
| 23 | bar<B>; // only mentions the function |
| 24 | } |