@@ -24,7 +24,7 @@ template<typename T> class myclass2;
2424class myclass3 ;
2525
2626
27- #line 53 "pure2-type-and-namespace-aliases.cpp2"
27+ #line 49 "pure2-type-and-namespace-aliases.cpp2"
2828class myclass4 ;
2929
3030template <typename T> class myclass6 ;
@@ -59,7 +59,7 @@ auto myfunc() -> void;
5959
6060#line 25 "pure2-type-and-namespace-aliases.cpp2"
6161template <typename T> class myclass2 {
62- public: static constexpr int value = 42 ;
62+ public: static const int value;
6363
6464 public: myclass2() = default ;
6565 public: myclass2(myclass2 const &) = delete ; /* No 'that' constructor, suppress copy */
@@ -75,24 +75,20 @@ using myclass5 = myclass4;
7575
7676class myclass3 {
7777 public: static constexpr auto v0 = std::array{0 };
78- public: static constexpr std::array v1 = v0;
79- public: static const myclass3 v2;
78+ public: static constexpr auto v1 = v0;// OK: Also uses the Cpp2 placeholder type.
79+ public: static const myclass3 v2;// OK: Doesn't use the Cpp2 placeholder type.
8080 public: static constexpr auto v3 = v0;
81- // v4 :== v2; // Not (yet) supported.
82- // v5: myclass4 == :myclass4 = ();; // Not yet supported.
83- // v6: myclass5 == :myclass5 = ();; // Not yet supported.
84- // v7 :== myclass3(); // Not (yet) supported.
85-
86- // There's also a false positive:
87- // <https://github.com/hsutter/cppfront/issues/666#issuecomment-1722329609>.
81+ public: static const myclass3 v4;// OK: Doesn't use the Cpp2 placeholder type.
82+ public: static const myclass4 v5;// OK: Doesn't use the Cpp2 placeholder type.
83+ public: static const myclass5 v6;// OK: Doesn't use the Cpp2 placeholder type.
8884};
8985
9086class myclass4 {};
9187
9288template <typename T> class myclass6 {
9389 public: template <typename U>
9490CPP2_REQUIRES_ (true )
95- #line 56 "pure2-type-and-namespace-aliases.cpp2"
91+ #line 52 "pure2-type-and-namespace-aliases.cpp2"
9692 static constexpr auto v = 0 ;
9793};
9894
@@ -118,6 +114,9 @@ auto const& v2 = std::move(v);
118114#line 23 "pure2-type-and-namespace-aliases.cpp2"
119115}
120116
117+ #line 26 "pure2-type-and-namespace-aliases.cpp2"
118+ template <typename T> inline CPP2_CONSTEXPR int myclass2<T>::value = 42 ;
119+
121120#line 29 "pure2-type-and-namespace-aliases.cpp2"
122121auto main () -> int{
123122 using view = std::string_view;
@@ -128,6 +127,9 @@ auto main() -> int{
128127}
129128
130129#line 42 "pure2-type-and-namespace-aliases.cpp2"
131- inline CPP2_CONSTEXPR myclass3 myclass3::v2 = myclass3{} ;
130+ inline CPP2_CONSTEXPR myclass3 myclass3::v2 = myclass3() ;
132131
132+ inline CPP2_CONSTEXPR myclass3 myclass3::v4 = v2;
133+ inline CPP2_CONSTEXPR myclass4 myclass3::v5 = myclass4();
134+ inline CPP2_CONSTEXPR myclass5 myclass3::v6 = myclass5();
133135
0 commit comments