Index: tools/clang/rewrite_to_chrome_style/tests/template-expected.cc |
diff --git a/tools/clang/rewrite_to_chrome_style/tests/template-expected.cc b/tools/clang/rewrite_to_chrome_style/tests/template-expected.cc |
index dc46c19a3aa345014db984d2128b1f13d9cf8c86..4f339ee16bcbc3ff21407204af95da2e4a08109a 100644 |
--- a/tools/clang/rewrite_to_chrome_style/tests/template-expected.cc |
+++ b/tools/clang/rewrite_to_chrome_style/tests/template-expected.cc |
@@ -76,6 +76,40 @@ void F() { |
const int kIsAConstToo = number; |
} |
+namespace test_member_in_template { |
+ |
+template <typename T> |
+class HasAMember { |
+ public: |
+ HasAMember() {} |
+ HasAMember(const T&) {} |
+ |
+ void UsesMember() { const int not_const = i_; } |
+ void AlsoUsesMember(); |
+ |
+ private: |
+ int i_; |
+}; |
+ |
+template <typename T> |
+void HasAMember<T>::AlsoUsesMember() { |
+ const int not_const = i_; |
+} |
+ |
+template <typename T> |
+static void BasedOnSubType(const HasAMember<T>& t) { |
+ const HasAMember<T> problematic_not_const(t); |
+} |
+ |
+void Run() { |
+ HasAMember<int>().UsesMember(); |
+ |
+ BasedOnSubType<int>(HasAMember<int>()); |
+ enum E { A }; |
+ BasedOnSubType<E>(HasAMember<E>()); |
+} |
+} |
+ |
namespace test_template_arg_is_function { |
void F(int x) {} |