public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ PATCH to add test for c++/67853
@ 2019-07-21 21:50 Marek Polacek
  0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2019-07-21 21:50 UTC (permalink / raw)
  To: GCC Patches

Tested on x86_64-linux, applying.

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

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

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, "");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-21 21:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-21 21:50 C++ PATCH to add test for c++/67853 Marek Polacek

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