[PATCH] Variable templates w/ partial support for static data members

Larisse Voufo lvoufo at google.com
Mon Aug 5 07:53:35 PDT 2013



================
Comment at: test/SemaCXX/cxx1y-variable-templates_in_class.cpp:161-169
@@ +160,11 @@
+
+#ifdef PRECXX11
+// expected-warning at 8 {{in-class initialization of non-static data member is a C++11 extension}}
+// expected-warning at 12 {{in-class initialization of non-static data member is a C++11 extension}}
+#endif
+
+#ifndef CXX1Y
+// expected-warning at 9 {{variable templates are a C++1y extension}}
+// expected-warning at 10 {{variable templates are a C++1y extension}}
+// expected-warning at 13 {{variable templates are a C++1y extension}}
+// expected-warning at 14 {{variable templates are a C++1y extension}}
----------------
Richard Smith wrote:
> This is going to be a maintenance nightmare if we ever change these tests. Please instead turn the relevant warnings off for this test, and add a test for this warning to test/SemaCXX/cxx98-compat.cpp
Yes. I was a little bit worried about this too. But I wasn't sure how to balance out thoroughness against maintenance...

I will change this in the next update.

================
Comment at: test/SemaCXX/cxx1y-variable-templates_top_level.cpp:403-413
@@ +402,13 @@
+
+#ifndef PRECXX11
+// expected-error at 383 {{explicit instantiation of 'pi1a<float>' not in a namespace enclosing 'n1'}}
+// expected-note at 373 {{explicit instantiation refers here}}
+// expected-error at 393 {{explicit instantiation of 'pi1b<float>' not in a namespace enclosing 'n1'}}
+// expected-note at 376 {{explicit instantiation refers here}}
+#else
+// expected-warning at 355 {{first declaration of variable template specialization of 'pi0a' outside namespace 'n0a' is a C++11 extension}}
+// expected-note at 346 {{explicitly specialized declaration is here}}
+// expected-warning at 368 {{first declaration of variable template specialization of 'pi0b' outside namespace 'n0b' is a C++11 extension}}
+// expected-note at 360 {{explicitly specialized declaration is here}}
+#endif
+
----------------
Richard Smith wrote:
> Put these next to the corresponding parts of the test, and use relative line numbers not absolute, to make the test less fragile.
Ok.

================
Comment at: test/SemaCXX/cxx1y-variable-templates_top_level.cpp:416-419
@@ +415,6 @@
+#ifndef CXX1Y
+// expected-warning at 13 {{variable templates are a C++1y extension}}
+// expected-warning at 16 {{variable templates are a C++1y extension}}
+// expected-warning at 67 {{variable templates are a C++1y extension}}
+// expected-warning at 70 {{variable templates are a C++1y extension}}
+// expected-warning at 74 {{variable templates are a C++1y extension}}
----------------
Richard Smith wrote:
> Likewise please turn this warning off.
Ok.


http://llvm-reviews.chandlerc.com/D1067



More information about the cfe-commits mailing list