public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96884] New: Missing diagnostics when applying the member operator on this in class template
@ 2020-09-01 16:20 anders.granlund.0 at gmail dot com
  2020-09-01 16:37 ` [Bug c++/96884] " mpolacek at gcc dot gnu.org
  2020-09-08  6:55 ` anders.granlund.0 at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: anders.granlund.0 at gmail dot com @ 2020-09-01 16:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96884
           Summary: Missing diagnostics when applying the member operator
                    on this in class template
           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: ---

Program (main.cpp):

  template<typename T>
  class V
  {
      int *a;
      void f()
      {
          this.a = 0;
      }
  };

  int main()
  {
  }

Compilation command line:

  g++ -std=c++17 -pedantic-errors main.cpp

Observed behaviour:

  No compilation errors.

Expected behaviour:

  Compilation error about incorrectly trying to use the member operator (.)
instead of (->) on the this keyword.

Note:

  clang++ gives the expected error message.

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

end of thread, other threads:[~2020-09-08  6:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01 16:20 [Bug c++/96884] New: Missing diagnostics when applying the member operator on this in class template anders.granlund.0 at gmail dot com
2020-09-01 16:37 ` [Bug c++/96884] " mpolacek at gcc dot gnu.org
2020-09-08  6:55 ` anders.granlund.0 at gmail dot com

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