public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/46691] New: Null pointer in template deduction
@ 2010-11-28 10:25 ilpoilves at hotmail dot com
  2010-11-28 12:08 ` [Bug c++/46691] " paolo.carlini at oracle dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ilpoilves at hotmail dot com @ 2010-11-28 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Null pointer in template deduction
           Product: gcc
           Version: 4.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ilpoilves@hotmail.com


Have a look at the following code:

template <typename T>
struct identity
{
    typedef T type;
};

template <typename T>
void f(T t, typename identity<T>::type* p)
{
}

int main()
{
    int a = 0;
    f(a, 0);

    return 0;
}

Compiling this on GCC 4.4.5 gives the following error:

g++ test.cpp

test.cpp: "error: no matching function for call to 'f(int&, int)'"

The 0 should match a null pointer. The code is accepted by Visual Studio 2008,
2010, and Comeau C++, all in strict mode.

g++ -v

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.4-8'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc
--with-arch-32=i586 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.5 20100728 (prerelease) (Debian 4.4.4-8)


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

* [Bug c++/46691] Null pointer in template deduction
  2010-11-28 10:25 [Bug c++/46691] New: Null pointer in template deduction ilpoilves at hotmail dot com
@ 2010-11-28 12:08 ` paolo.carlini at oracle dot com
  2021-05-06 13:44 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2010-11-28 12:08 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2010-11-28 10:48:46 UTC ---
Looks like yet another duplicate to me.

*** This bug has been marked as a duplicate of bug 23055 ***


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

* [Bug c++/46691] Null pointer in template deduction
  2010-11-28 10:25 [Bug c++/46691] New: Null pointer in template deduction ilpoilves at hotmail dot com
  2010-11-28 12:08 ` [Bug c++/46691] " paolo.carlini at oracle dot com
@ 2021-05-06 13:44 ` cvs-commit at gcc dot gnu.org
  2021-05-07  8:26 ` pault at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-05-06 13:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

https://gcc.gnu.org/g:a2c593009fef1564dbef2237ee71e9fd08f5361e

commit r12-570-ga2c593009fef1564dbef2237ee71e9fd08f5361e
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Thu May 6 14:41:33 2021 +0100

    Fortran: Assumed and explicit size class arrays [PR46691/99819].

    2021-05-06  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran/ChangeLog

            PR fortran/46691
            PR fortran/99819
            * class.c (gfc_build_class_symbol): Remove the error that
            disables assumed size class arrays. Class array types that are
            not deferred shape or assumed rank are given a unique name and
            placed in the procedure namespace.
            * trans-array.c (gfc_trans_g77_array): Obtain the data pointer
            for class arrays.
            (gfc_trans_dummy_array_bias): Suppress the runtime error for
            extent violations in explicit shape class arrays because it
            always fails.
            * trans-expr.c (gfc_conv_procedure_call): Handle assumed size
            class actual arguments passed to non-descriptor formal args by
            using the data pointer, stored as the symbol's backend decl.

    gcc/testsuite/ChangeLog

            PR fortran/46691
            PR fortran/99819
            * gfortran.dg/class_dummy_6.f90: New test.
            * gfortran.dg/class_dummy_7.f90: New test.

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

* [Bug c++/46691] Null pointer in template deduction
  2010-11-28 10:25 [Bug c++/46691] New: Null pointer in template deduction ilpoilves at hotmail dot com
  2010-11-28 12:08 ` [Bug c++/46691] " paolo.carlini at oracle dot com
  2021-05-06 13:44 ` cvs-commit at gcc dot gnu.org
@ 2021-05-07  8:26 ` pault at gcc dot gnu.org
  2021-08-28 18:28 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pault at gcc dot gnu.org @ 2021-05-07  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu.org

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to CVS Commits from comment #2)
> The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:
> 
 Apologies for the noise : This should have been PR46991.

Paul

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

* [Bug c++/46691] Null pointer in template deduction
  2010-11-28 10:25 [Bug c++/46691] New: Null pointer in template deduction ilpoilves at hotmail dot com
                   ` (2 preceding siblings ...)
  2021-05-07  8:26 ` pault at gcc dot gnu.org
@ 2021-08-28 18:28 ` cvs-commit at gcc dot gnu.org
  2021-08-30 20:13 ` cvs-commit at gcc dot gnu.org
  2021-09-06 19:03 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-28 18:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:be64e725111fdb9caa05374823b4423b8ab49dc7

commit r11-8936-gbe64e725111fdb9caa05374823b4423b8ab49dc7
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Thu May 6 14:41:33 2021 +0100

    Fortran: Assumed and explicit size class arrays [PR46691/99819].

    2021-05-06  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran/ChangeLog

            PR fortran/46691
            PR fortran/99819
            * class.c (gfc_build_class_symbol): Remove the error that
            disables assumed size class arrays. Class array types that are
            not deferred shape or assumed rank are given a unique name and
            placed in the procedure namespace.
            * trans-array.c (gfc_trans_g77_array): Obtain the data pointer
            for class arrays.
            (gfc_trans_dummy_array_bias): Suppress the runtime error for
            extent violations in explicit shape class arrays because it
            always fails.
            * trans-expr.c (gfc_conv_procedure_call): Handle assumed size
            class actual arguments passed to non-descriptor formal args by
            using the data pointer, stored as the symbol's backend decl.

    gcc/testsuite/ChangeLog

            PR fortran/46691
            PR fortran/99819
            * gfortran.dg/class_dummy_6.f90: New test.
            * gfortran.dg/class_dummy_7.f90: New test.

    (cherry picked from commit a2c593009fef1564dbef2237ee71e9fd08f5361e)

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

* [Bug c++/46691] Null pointer in template deduction
  2010-11-28 10:25 [Bug c++/46691] New: Null pointer in template deduction ilpoilves at hotmail dot com
                   ` (3 preceding siblings ...)
  2021-08-28 18:28 ` cvs-commit at gcc dot gnu.org
@ 2021-08-30 20:13 ` cvs-commit at gcc dot gnu.org
  2021-09-06 19:03 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-30 20:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:53907e20ee1fdf91163ff19b8f1dc716563e903a

commit r10-10081-g53907e20ee1fdf91163ff19b8f1dc716563e903a
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Thu May 6 14:41:33 2021 +0100

    Fortran: Assumed and explicit size class arrays [PR46691/99819].

    2021-05-06  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran/ChangeLog

            PR fortran/46691
            PR fortran/99819
            * class.c (gfc_build_class_symbol): Remove the error that
            disables assumed size class arrays. Class array types that are
            not deferred shape or assumed rank are given a unique name and
            placed in the procedure namespace.
            * trans-array.c (gfc_trans_g77_array): Obtain the data pointer
            for class arrays.
            (gfc_trans_dummy_array_bias): Suppress the runtime error for
            extent violations in explicit shape class arrays because it
            always fails.
            * trans-expr.c (gfc_conv_procedure_call): Handle assumed size
            class actual arguments passed to non-descriptor formal args by
            using the data pointer, stored as the symbol's backend decl.

    gcc/testsuite/ChangeLog

            PR fortran/46691
            PR fortran/99819
            * gfortran.dg/class_dummy_6.f90: New test.
            * gfortran.dg/class_dummy_7.f90: New test.

    (cherry picked from commit a2c593009fef1564dbef2237ee71e9fd08f5361e)

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

* [Bug c++/46691] Null pointer in template deduction
  2010-11-28 10:25 [Bug c++/46691] New: Null pointer in template deduction ilpoilves at hotmail dot com
                   ` (4 preceding siblings ...)
  2021-08-30 20:13 ` cvs-commit at gcc dot gnu.org
@ 2021-09-06 19:03 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-06 19:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:c8cd1acae4c26929400fae0d7fb17cfef8c15be0

commit r9-9712-gc8cd1acae4c26929400fae0d7fb17cfef8c15be0
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Thu May 6 14:41:33 2021 +0100

    Fortran: Assumed and explicit size class arrays [PR46691/99819].

    2021-05-06  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran/ChangeLog

            PR fortran/46691
            PR fortran/99819
            * class.c (gfc_build_class_symbol): Remove the error that
            disables assumed size class arrays. Class array types that are
            not deferred shape or assumed rank are given a unique name and
            placed in the procedure namespace.
            * trans-array.c (gfc_trans_g77_array): Obtain the data pointer
            for class arrays.
            (gfc_trans_dummy_array_bias): Suppress the runtime error for
            extent violations in explicit shape class arrays because it
            always fails.
            * trans-expr.c (gfc_conv_procedure_call): Handle assumed size
            class actual arguments passed to non-descriptor formal args by
            using the data pointer, stored as the symbol's backend decl.

    gcc/testsuite/ChangeLog

            PR fortran/46691
            PR fortran/99819
            * gfortran.dg/class_dummy_6.f90: New test.
            * gfortran.dg/class_dummy_7.f90: New test.

    (cherry picked from commit a2c593009fef1564dbef2237ee71e9fd08f5361e)

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

end of thread, other threads:[~2021-09-06 19:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-28 10:25 [Bug c++/46691] New: Null pointer in template deduction ilpoilves at hotmail dot com
2010-11-28 12:08 ` [Bug c++/46691] " paolo.carlini at oracle dot com
2021-05-06 13:44 ` cvs-commit at gcc dot gnu.org
2021-05-07  8:26 ` pault at gcc dot gnu.org
2021-08-28 18:28 ` cvs-commit at gcc dot gnu.org
2021-08-30 20:13 ` cvs-commit at gcc dot gnu.org
2021-09-06 19:03 ` cvs-commit 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).