re PR c++/67853 (decltype of parenthesized xvalue does not correctly yield rvalue...
authorMarek Polacek <polacek@redhat.com>
Sun, 21 Jul 2019 21:20:27 +0000 (21:20 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Sun, 21 Jul 2019 21:20:27 +0000 (21:20 +0000)
PR c++/67853
* g++.dg/cpp0x/decltype72.C: New test.

From-SVN: r273652

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/decltype72.C [new file with mode: 0644]

index 234bc10442c306aa84371f5e8516c2cc13905a1d..12774c06466effc733f4efe6a5f7726693046fb7 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-21  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/67853
+       * g++.dg/cpp0x/decltype72.C: New test.
+
 2019-07-22  Stafford Horne  <shorne@gmail.com>
 
        * gcc.target/or1k/ror-4.c: New file.
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype72.C b/gcc/testsuite/g++.dg/cpp0x/decltype72.C
new file mode 100644 (file)
index 0000000..071e0e7
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/67853
+// { dg-do compile { target c++11 } }
+
+template<typename T, typename U>
+struct is_same
+{
+  static const bool value = false;
+};
+
+template<typename T>
+struct is_same<T, T>
+{
+  static const bool value = true;
+};
+
+struct Member {};
+struct A { Member x; };
+A MakeA();
+static_assert(is_same<decltype((MakeA().x)), Member&&>::value, "");