Hi Martin,

> The PR is about a function (__tls_init) that ends before it begins
> (from line point of view). The patch uses location of a variable where
> we first create the function declaration. I'm not much familiar with C++ FE,
> but it works.
>
> Survives bootstrap and regression test on ppc64le-linux-gnu.
>
> Ready for trunk?
> Thanks,
> Martin
>
> gcc/cp/ChangeLog:
>
> 2018-11-30  Martin Liska  <mli...@suse.cz>
>
>       PR c++/88263
>       * decl2.c (get_local_tls_init_fn): Add location_t argument and
>       use it.
>       (get_tls_init_fn): Call it with location of variable for which
>       we'll need to create tls_init function.
>       (handle_tls_init): Likewise.
>
> gcc/testsuite/ChangeLog:
>
> 2018-11-30  Martin Liska  <mli...@suse.cz>
>
>       * g++.dg/gcov/pr88263.C: New test.

the new testcase FAILs on Solaris:

+FAIL: g++.dg/gcov/pr88263.C   (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/gcov/pr88263.C:7:11: error: 
'namespace log { }' conflicts with a previous declaration
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/gcov/pr88263.C:19:11: error: 
'namespace log { }' conflicts with a previous declaration
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/gcov/pr88263.C:21:33: error: 
'Logstream' has not been declared

/var/gcc/regression/trunk/11.5-gcc/build/gcc/include-fixed/iso/math_iso.h:69:15:
 note: previous declaration 'namespace std { }::log'

+UNRESOLVED: g++.dg/gcov/pr88263.C   compilation failed to produce executable
+FAIL: g++.dg/gcov/pr88263.C   gcov failed: pr88263.C.gcov does not exist

<iso/math_iso.h> has

namespace std {
extern double log __P((double));
extern "C++" {
        inline float log(float __X) { return __logf(__X); }
        inline long double log(long double __X) { return __logl(__X); }
}
}

Fixed by renaming namespace log to logging to avoid the clash.  Tested
on i386-pc-solaris2.11, sparc-sun-solaris2.11, and x86_64-pc-linux-gnu.
Installed no mainline.

        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2018-12-28  Rainer Orth  <r...@cebitec.uni-bielefeld.de>

        * g++.dg/gcov/pr88263.C: Rename namespace log to logging.

# HG changeset patch
# Parent  2f1e3e01d8c86c4908cd3e52bf256667f8ae9bb8
Fix g++.dg/gcov/pr88263.C compilation on Solaris

diff --git a/gcc/testsuite/g++.dg/gcov/pr88263.C b/gcc/testsuite/g++.dg/gcov/pr88263.C
--- a/gcc/testsuite/g++.dg/gcov/pr88263.C
+++ b/gcc/testsuite/g++.dg/gcov/pr88263.C
@@ -4,7 +4,7 @@
 
 #include <sstream>
 
-namespace log {
+namespace logging {
 
 class Logstream {
 public:
@@ -16,7 +16,7 @@ private:
 
 }
 
-namespace log {
+namespace logging {
 
 thread_local std::ostringstream Logstream::os_;
 

Reply via email to