public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-886] c++: non-static member, decltype, {} [PR100205]
@ 2021-05-18 19:45 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2021-05-18 19:45 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:8c114759b8c9c9e2ec90b82d92a24b5a71647017
commit r12-886-g8c114759b8c9c9e2ec90b82d92a24b5a71647017
Author: Jason Merrill <jason@redhat.com>
Date: Tue May 18 12:18:56 2021 -0400
c++: non-static member, decltype, {} [PR100205]
This test was fixed by my second patch for PR93314, which distinguishes
between constant-expression and potentially-constant-evaluated contexts in a
way that my first patch did not.
PR c++/100205
PR c++/99314
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/decltype-nonstatic1.C: New test.
Diff:
---
gcc/testsuite/g++.dg/cpp0x/decltype-nonstatic1.C | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-nonstatic1.C b/gcc/testsuite/g++.dg/cpp0x/decltype-nonstatic1.C
new file mode 100644
index 00000000000..bc488ff388b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype-nonstatic1.C
@@ -0,0 +1,16 @@
+// PR c++/100205
+// { dg-do compile { target c++11 } }
+
+struct coordinate_matrix {
+ using index_t = unsigned;
+ struct convert_to_matrix_coordinate {
+ index_t column_id;
+ };
+ index_t column_id;
+
+ // does not work
+ using value_type2 = decltype(convert_to_matrix_coordinate{column_id});
+
+ // does work
+ using value_type5 = decltype(column_id);
+};
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-18 19:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 19:45 [gcc r12-886] c++: non-static member, decltype, {} [PR100205] Jason Merrill
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).