diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-07-14 20:08:49 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-07-14 20:08:49 +0000 |
commit | 38a50c0a1620bfee536d292207100678ce7ab471 (patch) | |
tree | a89fd4ec22a767891e535863da4c4d9d59663dcc /clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp | |
parent | f69606b117c9f141469b164f306906485dad78f1 (diff) | |
download | bcm5719-llvm-38a50c0a1620bfee536d292207100678ce7ab471.tar.gz bcm5719-llvm-38a50c0a1620bfee536d292207100678ce7ab471.zip |
[Sema] Emit a better diagnostic when variable redeclarations disagree
We referred to all declaration in definitions in our diagnostic messages
which is can be inaccurate. Instead, classify the declaration and emit
an appropriate diagnostic for the new declaration and an appropriate
note pointing to the old one.
This fixes PR24116.
llvm-svn: 242190
Diffstat (limited to 'clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp')
-rw-r--r-- | clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp b/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp index 9ff73daa82d..123fcfff7f7 100644 --- a/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp +++ b/clang/test/SemaCXX/cxx1y-variable-templates_in_class.cpp @@ -214,7 +214,7 @@ namespace in_class_template { template<typename T> class D0a { template<typename U> static U Data; - template<typename U> static CONST U Data<U*> = U(10); // expected-note {{previous definition is here}} + template<typename U> static CONST U Data<U*> = U(10); // expected-note {{previous declaration is here}} }; template<> template<typename U> U D0a<float>::Data<U*> = U(100); // expected-error {{redefinition of 'Data'}} @@ -228,7 +228,7 @@ namespace in_class_template { template<typename T> class D1 { template<typename U> static U Data; - template<typename U> static CONST U Data<U*> = U(10); // expected-note {{previous definition is here}} + template<typename U> static CONST U Data<U*> = U(10); // expected-note {{previous declaration is here}} }; template<> template<typename U> U D1<float>::Data = U(10); |