diff options
| author | Larisse Voufo <lvoufo@google.com> | 2013-08-14 20:15:02 +0000 |
|---|---|---|
| committer | Larisse Voufo <lvoufo@google.com> | 2013-08-14 20:15:02 +0000 |
| commit | dbd65779649eb0a12e63c84c7f9d2cf9d3411a46 (patch) | |
| tree | 9d137e9e0007f6a75965d7eac5419935b1e20341 /clang/test/SemaCXX | |
| parent | 9b49f225007945d70cd0c903db010b398f24f0e4 (diff) | |
| download | bcm5719-llvm-dbd65779649eb0a12e63c84c7f9d2cf9d3411a46.tar.gz bcm5719-llvm-dbd65779649eb0a12e63c84c7f9d2cf9d3411a46.zip | |
Bug fix: note diagnosis on expression narrowing should say "variable template" instead of "static data member" when appropriate
llvm-svn: 188409
Diffstat (limited to 'clang/test/SemaCXX')
| -rw-r--r-- | clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp b/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp index 82e3c116aad..61fccac038b 100644 --- a/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp +++ b/clang/test/SemaCXX/cxx1y-variable-templates_top_level.cpp @@ -126,7 +126,7 @@ namespace odr_tmpl { } #endif -} +} namespace explicit_instantiation { template<typename T> @@ -321,6 +321,15 @@ namespace explicit_specialization { } } +namespace narrowing { + template<typename T> T v = {1234}; // expected-warning {{implicit conversion from 'int' to 'char' changes value from 1234 to}} +#ifdef CXX11 + // expected-error@-2 {{constant expression evaluates to 1234 which cannot be narrowed to type 'char'}}\ + // expected-note@-2 {{override this message by inserting an explicit cast}} +#endif + int k = v<char>; // expected-note {{in instantiation of variable template specialization 'narrowing::v<char>' requested here}} +} + namespace use_in_structs { // TODO: } |

