public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter.
@ 2020-09-07 15:32 anders.granlund.0 at gmail dot com
  2020-09-07 15:36 ` [Bug c++/96957] " anders.granlund.0 at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: anders.granlund.0 at gmail dot com @ 2020-09-07 15:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96957
           Summary: No name-lookup into base class when using an non
                    dependent base class via template alias with dummy
                    parameter.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anders.granlund.0 at gmail dot com
  Target Milestone: ---

Consider the following c++ program:

  class A
  {
      protected:
          int x;
  };

  template<typename X>
  using B = A;

  template<typename T>
  class C : public B<T>
  {
      public:
          void f()
          {
              x = 0;
          }
  };

  int main()
  {
  }

Compile it with "-std=c++17 -pedantic-errors".

Expected behaviour:

  Since the base class is not dependent (see http://wg21.link/cwg1390 ) the
  name lookup of x should succeed and no error message should be outputed
  during the compilation.

Observed behaviour:

  An compilation error about failing the name lookup of x was outputed during
  the compilation.

GCC is correctly compiling the program with no error messages outputed. See the
discussion in: https://bugs.llvm.org/show_bug.cgi?id=47435

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

* [Bug c++/96957] No name-lookup into base class when using an non dependent base class via template alias with dummy parameter.
  2020-09-07 15:32 [Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter anders.granlund.0 at gmail dot com
@ 2020-09-07 15:36 ` anders.granlund.0 at gmail dot com
  2020-09-08  6:53 ` anders.granlund.0 at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: anders.granlund.0 at gmail dot com @ 2020-09-07 15:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Anders Granlund <anders.granlund.0 at gmail dot com> ---
Also see the following stack overflow post:

https://stackoverflow.com/questions/63761866/difference-in-behaviour-between-clang-and-gcc-when-trying-to-confuse-them-by-usi

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

* [Bug c++/96957] No name-lookup into base class when using an non dependent base class via template alias with dummy parameter.
  2020-09-07 15:32 [Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter anders.granlund.0 at gmail dot com
  2020-09-07 15:36 ` [Bug c++/96957] " anders.granlund.0 at gmail dot com
@ 2020-09-08  6:53 ` anders.granlund.0 at gmail dot com
  2021-08-03  5:44 ` [Bug c++/96957] [9/10/11/12 Regression] GCC thinks a non-dependent base is dependent because of template alias pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: anders.granlund.0 at gmail dot com @ 2020-09-08  6:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Anders Granlund <anders.granlund.0 at gmail dot com> ---
Correction to my first comment:

"GCC is correctly compiling the program with no error messages outputed. See
the discussion in: https://bugs.llvm.org/show_bug.cgi?id=47435"

should be:

"Clang is correctly rejecting the program with a error message outputed. See
the discussion in: https://bugs.llvm.org/show_bug.cgi?id=47435"

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

* [Bug c++/96957] [9/10/11/12 Regression] GCC thinks a non-dependent base is dependent because of template alias
  2020-09-07 15:32 [Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter anders.granlund.0 at gmail dot com
  2020-09-07 15:36 ` [Bug c++/96957] " anders.granlund.0 at gmail dot com
  2020-09-08  6:53 ` anders.granlund.0 at gmail dot com
@ 2021-08-03  5:44 ` pinskia at gcc dot gnu.org
  2022-01-17 15:06 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-03  5:44 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-08-03
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |5.1.0
     Ever confirmed|0                           |1
      Known to fail|                            |6.1.0
   Target Milestone|---                         |9.5
            Summary|No name-lookup into base    |[9/10/11/12 Regression] GCC
                   |class when using an non     |thinks a non-dependent base
                   |dependent base class via    |is dependent because of
                   |template alias with dummy   |template alias
                   |parameter.                  |

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.  Note I suspect the reason why it worked in GCC 5 was because there
was some rewrite in GCC 6 to correct aliases.

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

* [Bug c++/96957] [9/10/11/12 Regression] GCC thinks a non-dependent base is dependent because of template alias
  2020-09-07 15:32 [Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter anders.granlund.0 at gmail dot com
                   ` (2 preceding siblings ...)
  2021-08-03  5:44 ` [Bug c++/96957] [9/10/11/12 Regression] GCC thinks a non-dependent base is dependent because of template alias pinskia at gcc dot gnu.org
@ 2022-01-17 15:06 ` rguenth at gcc dot gnu.org
  2022-04-21 22:11 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-17 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug c++/96957] [9/10/11/12 Regression] GCC thinks a non-dependent base is dependent because of template alias
  2020-09-07 15:32 [Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter anders.granlund.0 at gmail dot com
                   ` (3 preceding siblings ...)
  2022-01-17 15:06 ` rguenth at gcc dot gnu.org
@ 2022-04-21 22:11 ` mpolacek at gcc dot gnu.org
  2022-05-27  9:43 ` [Bug c++/96957] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-04-21 22:11 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |SUSPENDED
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
DR1390 is still not resolved.

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

* [Bug c++/96957] [10/11/12/13 Regression] GCC thinks a non-dependent base is dependent because of template alias
  2020-09-07 15:32 [Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter anders.granlund.0 at gmail dot com
                   ` (4 preceding siblings ...)
  2022-04-21 22:11 ` mpolacek at gcc dot gnu.org
@ 2022-05-27  9:43 ` rguenth at gcc dot gnu.org
  2022-06-28 10:41 ` jakub at gcc dot gnu.org
  2023-07-07 10:38 ` [Bug c++/96957] [11/12/13/14 " rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug c++/96957] [10/11/12/13 Regression] GCC thinks a non-dependent base is dependent because of template alias
  2020-09-07 15:32 [Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter anders.granlund.0 at gmail dot com
                   ` (5 preceding siblings ...)
  2022-05-27  9:43 ` [Bug c++/96957] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:41 ` jakub at gcc dot gnu.org
  2023-07-07 10:38 ` [Bug c++/96957] [11/12/13/14 " rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:41 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug c++/96957] [11/12/13/14 Regression] GCC thinks a non-dependent base is dependent because of template alias
  2020-09-07 15:32 [Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter anders.granlund.0 at gmail dot com
                   ` (6 preceding siblings ...)
  2022-06-28 10:41 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:38 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

end of thread, other threads:[~2023-07-07 10:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-07 15:32 [Bug c++/96957] New: No name-lookup into base class when using an non dependent base class via template alias with dummy parameter anders.granlund.0 at gmail dot com
2020-09-07 15:36 ` [Bug c++/96957] " anders.granlund.0 at gmail dot com
2020-09-08  6:53 ` anders.granlund.0 at gmail dot com
2021-08-03  5:44 ` [Bug c++/96957] [9/10/11/12 Regression] GCC thinks a non-dependent base is dependent because of template alias pinskia at gcc dot gnu.org
2022-01-17 15:06 ` rguenth at gcc dot gnu.org
2022-04-21 22:11 ` mpolacek at gcc dot gnu.org
2022-05-27  9:43 ` [Bug c++/96957] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-07-07 10:38 ` [Bug c++/96957] [11/12/13/14 " rguenth 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).