public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/57043] New: converting overloaded complex function pow in C++11 is ambiguous
@ 2013-04-23 10:17 frederic.hecht at upmc dot fr
  2013-04-23 11:12 ` [Bug c++/57043] " redi at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: frederic.hecht at upmc dot fr @ 2013-04-23 10:17 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57043

             Bug #: 57043
           Summary: converting overloaded complex function pow in C++11 is
                    ambiguous
    Classification: Unclassified
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: frederic.hecht@upmc.fr


problem template the code is trivial 2 lines:
do not  compile in version 4.9, 4.8.1 4.9  with 
/usr/local/bin/g++ -v -save-temps -std=c++11 -c bugcc.cpp 

the code: 

#include <complex> 
std::complex<double>  (* powcc  )( const  std::complex<double>  &, const
std::complex<double>  &) =std::pow;

the output is 

COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.8.3' '-v' '-save-temps'
'-std=c++11' '-c' '-shared-libgcc' '-mtune=core2'
 /usr/local/libexec/gcc/x86_64-apple-darwin12.3.0/4.8.1/cc1plus -fpreprocessed
bugcc.ii -fPIC -quiet -dumpbase bugcc.cpp -mmacosx-version-min=10.8.3
-mtune=core2 -auxbase bugcc -std=c++11 -version -o bugcc.s
GNU C++ (GCC) version 4.8.1 20130404 (prerelease) (x86_64-apple-darwin12.3.0)
    compiled by GNU C version 4.8.1 20130404 (prerelease), GMP version 4.3.1,
MPFR version 2.4.1, MPC version 0.8.1
heuristiques GGC: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++ (GCC) version 4.8.1 20130404 (prerelease) (x86_64-apple-darwin12.3.0)
    compiled by GNU C version 4.8.1 20130404 (prerelease), GMP version 4.3.1,
MPFR version 2.4.1, MPC version 0.8.1
heuristiques GGC: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 848d439cd6121247863767d4caeedace
bugcc.cpp:2:100: erreur: converting overloaded function ‘pow’ to type ‘struct
std::complex<double> (*)(const struct std::complex<double>&, const struct
std::complex<double>&)’ is ambiguous
 std::complex<double>  (* powcc  )( const  std::complex<double>  &, const
std::complex<double>  &) =std::pow;
                                                                               
                    ^
In file included from bugcc.cpp:1:0:
/usr/local/include/c++/4.8.1/complex:1023:5: note: candidats sont:
std::complex<_Tp> std::pow(const std::complex<_Tp>&, const std::complex<_Tp>&)
[with _Tp = double]
     pow(const complex<_Tp>& __x, const complex<_Tp>& __y)
     ^
In file included from bugcc.cpp:1:0:
/usr/local/include/c++/4.8.1/complex:1871:5: note:                
std::complex<typename __gnu_cxx::__promote_2<_Tp, _Up>::__type> std::pow(const
std::complex<_Tp>&, const std::complex<_Up>&) [with _Tp = double; _Up = double;
typename __gnu_cxx::__promote_2<_Tp, _Up>::__type = double]
     pow(const std::complex<_Tp>& __x, const std::complex<_Up>& __y)
     ^
>From gcc-bugs-return-420789-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 23 10:29:50 2013
Return-Path: <gcc-bugs-return-420789-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20825 invoked by alias); 23 Apr 2013 10:29:50 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 20799 invoked by uid 48); 23 Apr 2013 10:29:48 -0000
From: "pberuto at yahoo dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57044] New: The following code won't compile with -std=c++0x
Date: Tue, 23 Apr 2013 10:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Keywords:
X-Bugzilla-Severity: major
X-Bugzilla-Who: pberuto at yahoo dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57044-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg01934.txt.bz2
Content-length: 1073


http://gcc.gnu.org/bugzilla/show_bug.cgi?idW044

             Bug #: 57044
           Summary: The following code won't compile with -std=c++0x
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pberuto@yahoo.com


The following code causes a GCC internal error Segmentation fault:

class myclass
{
public:
   template<typename T_>
   inline explicit myclass(T_ *s)
   {
      char buf[mylib::someclass::some_const]; // this line causes the fault
      // ... do something useful with buf
   }

   ...
};

// somewhere else:
nemaspace mylib
{
   class someclass
   {
   public:
      static const uint32_t some_const;
   }
}

// other info:
all GCC versions from 4.5.3 and below compile that code fine. Not tested with
other gcc versions before 4.7.2.
compile flags are CXXFLAGS="-g -O0 -pipe -std=c++0x"

Thank you.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-01-31 16:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-23 10:17 [Bug libstdc++/57043] New: converting overloaded complex function pow in C++11 is ambiguous frederic.hecht at upmc dot fr
2013-04-23 11:12 ` [Bug c++/57043] " redi at gcc dot gnu.org
2013-05-20 23:48 ` [Bug c++/57043] [4.7/4.8/4.9 Regression] " paolo.carlini at oracle dot com
2013-07-09  7:43 ` jason at gcc dot gnu.org
2013-09-06 11:27 ` rguenth at gcc dot gnu.org
2013-10-25 13:01 ` rguenth at gcc dot gnu.org
2014-01-31  3:51 ` jason at gcc dot gnu.org
2014-01-31 15:20 ` jason at gcc dot gnu.org
2014-01-31 15:21 ` jason at gcc dot gnu.org
2014-01-31 15:56 ` jason at gcc dot gnu.org
2014-01-31 16:09 ` jason at gcc dot gnu.org

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).