[Bug c++/61484] New: [C++11] [constexpr] can't initialize constexpr multi-dimentional array of a literal type

2014-06-12 Thread vmarko at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61484

Bug ID: 61484
   Summary: [C++11] [constexpr] can't initialize constexpr
multi-dimentional array of a literal type
   Product: gcc
   Version: 4.8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: vmarko at google dot com

Test case:

struct S {
  constexpr S() { }
};

constexpr S s[][1] = {
{ S() }
};

Bogus error:
test.cc:7:1: error: array must be initialized with a brace-enclosed initializer

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


[Bug c++/61484] [C++11] [constexpr] can't initialize constexpr multi-dimentional array of a literal type

2014-06-12 Thread vmarko at google dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61484

Vladimir Marko  changed:

   What|Removed |Added

Version|4.8.0   |4.9.0

--- Comment #1 from Vladimir Marko  ---
Fails with gcc 4.9.0 from AOSP prebuilts (aarch64-linux-android).


[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 Thread vmarko at google dot com
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 bar();
};

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

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