public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61500] New: [C++11] [4.8/4.9 Regression] Can't take pointer to member referenced via member pointer template parameter.
@ 2014-06-13 15:18 vmarko at google dot com
  2014-06-13 18:55 ` [Bug c++/61500] " jason at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vmarko at google dot com @ 2014-06-13 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61500
           Summary: [C++11] [4.8/4.9 Regression] Can't take pointer to
                    member referenced via member pointer template
                    parameter.
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vmarko at google dot com

struct X {
  int i;
  int j;

  int foo(int X::* ptr);

  template <int X::* ptr>
  int bar();
};

int X::foo(int X::* ptr) {
  int* p = &(this->*ptr);  // OK.
  return *p;
}

template <int X::* ptr>
int X::bar() {
  int* p = &(this->*ptr);  // gcc 4.9.0: OK in C++98 mode, fails in C++11 mode.
  return *p;
}

gcc 4.9.0, C++11:
test.cc:18:24: error: lvalue required as unary '&' operand

Reproduced with gcc 4.9.0 from AOSP prebuilts (aarch64-linux-android) and gcc
4.8.0 from AOSP prebuilts (x86_64-linux-android). Works fine with gcc 4.6.3 on
host (x86_64-linux-gnu).


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

end of thread, other threads:[~2014-06-30 16:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-13 15:18 [Bug c++/61500] New: [C++11] [4.8/4.9 Regression] Can't take pointer to member referenced via member pointer template parameter vmarko at google dot com
2014-06-13 18:55 ` [Bug c++/61500] " jason at gcc dot gnu.org
2014-06-16 11:46 ` jason at gcc dot gnu.org
2014-06-25 11:17 ` [Bug c++/61500] [4.8/4.9 Regression][C++11] " rguenth at gcc dot gnu.org
2014-06-25 11:17 ` rguenth at gcc dot gnu.org
2014-06-26 12:50 ` rguenth at gcc dot gnu.org
2014-06-30 12:37 ` jason at gcc dot gnu.org
2014-06-30 15:06 ` jason at gcc dot gnu.org
2014-06-30 16:00 ` 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).