public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wolfgang.roehrl@gi-de.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/97174] New: out-of-namespace function definition
Date: Wed, 23 Sep 2020 07:43:23 +0000	[thread overview]
Message-ID: <bug-97174-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97174

            Bug ID: 97174
           Summary: out-of-namespace function definition
           Product: gcc
           Version: 7.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wolfgang.roehrl@gi-de.com
  Target Milestone: ---

Hi,

I would like to post a bug report for the GNU C/C++ compiler 7.5.0.

We use the compiler to generate code for a PowerPC processor.

Invokation line for the GNU C++ compiler:

ccppc -c -x c++ --std=gnu++17 -Wall -Werror -g -mcpu=e6500 -m32
      -maltivec -mvrsave -ftls-model=local-exec -msdata=sysv
      -fno-common -fno-openmp -mbig -mmultiple -mno-string -misel
      -mstrict-align -fverbose-asm -G 8 -O3
      -I<some include paths>
      -D<some #define's>
      X.CPP -oX.O


// file X.CPP

#include <type_traits>

namespace N
{
  template <typename T>
  typename std::make_unsigned_t<T> conv (T);
}

template <typename T>
long N::conv (T val)
{ return static_cast<long>(val); }


The compiler accepts this code even though function "long N::conv (T)" is not
declared in namespace N. I think this is an illegal out-of-namespace definition
(cf. C++17 standard, 10.3.1.2/2).

With kind regards
W. Roehrl

             reply	other threads:[~2020-09-23  7:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23  7:43 wolfgang.roehrl@gi-de.com [this message]
2020-09-23  8:04 ` [Bug c++/97174] " rguenth at gcc dot gnu.org
2020-09-23  8:06 ` rguenth at gcc dot gnu.org
2020-09-23  9:04 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-97174-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).