From 1236cd666661babbcf37820e8e2118e39f476632 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 17 Apr 2018 10:28:21 +0200 Subject: [PATCH] Fix coding style and add a new test-case (PR lto/85405). 2018-04-17 Martin Liska PR lto/85405 * ipa-devirt.c (odr_types_equivalent_p): Remove trailing in message, remote space in between '_G' and '('. 2018-04-17 Martin Liska PR lto/85405 * g++.dg/lto/pr85405b_0.C: New test. * g++.dg/lto/pr85405b_1.C: New test. From-SVN: r259431 --- gcc/ChangeLog | 6 ++++++ gcc/ipa-devirt.c | 2 +- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/g++.dg/lto/pr85405b_0.C | 18 ++++++++++++++++++ gcc/testsuite/g++.dg/lto/pr85405b_1.C | 9 +++++++++ 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/lto/pr85405b_0.C create mode 100644 gcc/testsuite/g++.dg/lto/pr85405b_1.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a086530e968..186665e5b51 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-04-17 Martin Liska + + PR lto/85405 + * ipa-devirt.c (odr_types_equivalent_p): Remove trailing + in message, remote space in between '_G' and '('. + 2018-04-17 Jakub Jelinek PR target/85281 diff --git a/gcc/ipa-devirt.c b/gcc/ipa-devirt.c index 5da0f72d14f..bdda7d6b4a9 100644 --- a/gcc/ipa-devirt.c +++ b/gcc/ipa-devirt.c @@ -1590,7 +1590,7 @@ odr_types_equivalent_p (tree t1, tree t2, bool warn, bool *warned, if (DECL_BIT_FIELD (f1) != DECL_BIT_FIELD (f2)) { warn_odr (t1, t2, f1, f2, warn, warned, - G_ ("one field is bitfield while other is not ")); + G_("one field is bitfield while other is not")); return false; } else diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 23c519efcf1..d1d15605cfa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-04-17 Martin Liska + + PR lto/85405 + * g++.dg/lto/pr85405b_0.C: New test. + * g++.dg/lto/pr85405b_1.C: New test. + 2018-04-17 Martin Liska PR lto/85405 diff --git a/gcc/testsuite/g++.dg/lto/pr85405b_0.C b/gcc/testsuite/g++.dg/lto/pr85405b_0.C new file mode 100644 index 00000000000..a692abb7715 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr85405b_0.C @@ -0,0 +1,18 @@ +// { dg-lto-do link } +// { dg-lto-options {{-fPIC -shared -flto}} } + +class VclReferenceBase { // { dg-lto-warning "7: type 'struct VclReferenceBase' violates the C\\+\\+ One Definition Rule" } + int mnRefCnt; + int mbDisposed : 3; + virtual ~VclReferenceBase(); +}; +class a; +class b { + a &e; + bool c(); +}; +class B { + VclReferenceBase d; +}; +class a : B {}; +bool b::c() { return false; } diff --git a/gcc/testsuite/g++.dg/lto/pr85405b_1.C b/gcc/testsuite/g++.dg/lto/pr85405b_1.C new file mode 100644 index 00000000000..fd98e631d56 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr85405b_1.C @@ -0,0 +1,9 @@ +class VclReferenceBase { + int mnRefCnt; + int mbDisposed: 7; // { dg-lto-message "19: a field of same name but different type is defined in another translation unit" } + +protected: + virtual ~VclReferenceBase(); +}; +class : VclReferenceBase { +} a; -- 2.30.2