diff options
Diffstat (limited to 'gcc/ipa-devirt.c')
-rw-r--r-- | gcc/ipa-devirt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index cf8138a..534f6c0 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -166,6 +166,8 @@ along with GCC; see the file COPYING3. If not see #include "gimple-pretty-print.h" #include "stor-layout.h" #include "intl.h" +#include "streamer-hooks.h" +#include "lto-streamer.h" /* Hash based set of pairs of types. */ typedef struct @@ -935,6 +937,10 @@ warn_odr (tree t1, tree t2, tree st1, tree st2, if (!warn || !TYPE_NAME(t1)) return; + /* ODR warnings are output druing LTO streaming; we must apply location + cache for potential warnings to be output correctly. */ + lto_location_cache::current_cache->apply_location_cache (); + if (!warning_at (DECL_SOURCE_LOCATION (TYPE_NAME (t1)), OPT_Wodr, "type %qT violates one definition rule", t1)) |