diff options
author | Jason Merrill <jason@redhat.com> | 2021-05-18 12:18:56 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-05-18 15:44:24 -0400 |
commit | 8c114759b8c9c9e2ec90b82d92a24b5a71647017 (patch) | |
tree | 105b07b559c6055d4c37002f8ddf38420a40abb8 /gcc | |
parent | f71ca97def69b8aeb046d716eaea2367736f505e (diff) | |
download | gcc-8c114759b8c9c9e2ec90b82d92a24b5a71647017.zip gcc-8c114759b8c9c9e2ec90b82d92a24b5a71647017.tar.gz gcc-8c114759b8c9c9e2ec90b82d92a24b5a71647017.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/decltype-nonstatic1.C | 16 |
1 files changed, 16 insertions, 0 deletions
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 0000000..bc488ff --- /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); +}; |