diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-09 00:35:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-09 00:35:39 +0000 |
commit | c68e140657e40cda2f027beff923276b36e33684 (patch) | |
tree | 1a32c9fcccd9102ab6ca64a098c771ec4ebea5a6 /clang/test/SemaTemplate/instantiate-member-class.cpp | |
parent | 48b1804e7957ce379441e477602ac860a606e469 (diff) | |
download | bcm5719-llvm-c68e140657e40cda2f027beff923276b36e33684.tar.gz bcm5719-llvm-c68e140657e40cda2f027beff923276b36e33684.zip |
Improve diagnostics when we fail to convert from a source type to a
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as
t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
expected 'char *' [-pedantic]
char *name = __func__;
^ ~~~~~~~~
We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:
t.c:2:9: warning: initializing 'char *' from an expression of type
'char const [2]' discards qualifiers [-pedantic]
char *name = __func__;
^ ~~~~~~~~
Fixes <rdar://problem/7447179>.
llvm-svn: 100832
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-member-class.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-member-class.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaTemplate/instantiate-member-class.cpp b/clang/test/SemaTemplate/instantiate-member-class.cpp index 44f396e47af..938c57b75e9 100644 --- a/clang/test/SemaTemplate/instantiate-member-class.cpp +++ b/clang/test/SemaTemplate/instantiate-member-class.cpp @@ -18,8 +18,8 @@ X<int>::X *xi; // expected-error{{qualified reference to 'X' is a constructor na X<float>::X *xf; // expected-error{{qualified reference to 'X' is a constructor name rather than a type wherever a constructor can be declared}} void test_naming() { - c1 = c2; // expected-error{{incompatible type assigning 'X<float>::C *', expected 'X<int>::C *'}} - xi = xf; // expected-error{{incompatible type assigning}} + c1 = c2; // expected-error{{assigning to 'X<int>::C *' from incompatible type 'X<float>::C *'}} + xi = xf; // expected-error{{assigning to 'X<int>::X<int> *' from incompatible type 'X<float>::X<float> *'}} // FIXME: error above doesn't print the type X<int>::X cleanly! } |