C++ PATCH to add test for c++/67853

Message ID 20190721212133.GR32749@redhat.com
State New
Headers show
Series
  • C++ PATCH to add test for c++/67853
Related show

Commit Message

Marek Polacek July 21, 2019, 9:21 p.m.
Tested on x86_64-linux, applying.

2019-07-21  Marek Polacek  <polacek@redhat.com>

	PR c++/67853
	* g++.dg/cpp0x/decltype72.C: New test.

Patch

diff --git gcc/testsuite/g++.dg/cpp0x/decltype72.C gcc/testsuite/g++.dg/cpp0x/decltype72.C
new file mode 100644
index 00000000000..071e0e76210
--- /dev/null
+++ gcc/testsuite/g++.dg/cpp0x/decltype72.C
@@ -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, "");