diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-02-10 21:40:29 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-02-10 21:40:29 +0000 |
commit | 8a48c1dce92f03ed6cb184ff9644376e22714172 (patch) | |
tree | 0b1af063cea06f30d4737310a5b5793313603e20 /test/Parser/cxx1z-class-template-argument-deduction.cpp | |
parent | d9e057632852b4a3a22fa7103ae7e99a183d0c4c (diff) |
[c++1z] Require an initializer for deduced class template specialization types.
It's actually meaningful and useful to allow such variables to have no
initializer, but we are strictly following the standard here until the C++
committee reaches consensus on allowing this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx1z-class-template-argument-deduction.cpp')
-rw-r--r-- | test/Parser/cxx1z-class-template-argument-deduction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/Parser/cxx1z-class-template-argument-deduction.cpp b/test/Parser/cxx1z-class-template-argument-deduction.cpp index 10be123eb0..ab8c867f60 100644 --- a/test/Parser/cxx1z-class-template-argument-deduction.cpp +++ b/test/Parser/cxx1z-class-template-argument-deduction.cpp @@ -52,7 +52,7 @@ struct member { operator A(); // expected-error {{requires template arguments; argument deduction not allowed in conversion function type}} - static A x; // FIXME: We deduce A<int> from the initializer despite this not being a definition! + static A x; // expected-error {{declaration of variable 'x' with deduced type 'A' requires an initializer}} static constexpr A y = 0; }; @@ -127,7 +127,7 @@ namespace decl { auto k() -> A; // expected-error{{requires template arguments}} - A a; // FIXME: This is (technically) syntactically invalid. + A a; // expected-error {{declaration of variable 'a' with deduced type 'A' requires an initializer}} A b = 0; const A c = 0; A (parens) = 0; // expected-error {{cannot use parentheses when declaring variable with deduced class template specialization type}} |