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.
Tested x86_64-pc-linux-gnu, applying to trunk. PR c++/100205 PR c++/99314 gcc/testsuite/ChangeLog: * g++.dg/cpp0x/decltype-nonstatic1.C: New test. --- gcc/testsuite/g++.dg/cpp0x/decltype-nonstatic1.C | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/decltype-nonstatic1.C 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); +}; base-commit: f71ca97def69b8aeb046d716eaea2367736f505e -- 2.27.0