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 | d4eea8362605807327735727a9098abe1eb23b19 (patch) | |
tree | ffa33b82edfd313505b5bf83dac9fd6b6e844fa9 /test/SemaTemplate/fun-template-def.cpp | |
parent | 355fa3a65d2bffb2cb230e5c3d8cd14ec5570329 (diff) | |
download | clang-d4eea8362605807327735727a9098abe1eb23b19.tar.gz clang-d4eea8362605807327735727a9098abe1eb23b19.tar.bz2 clang-d4eea8362605807327735727a9098abe1eb23b19.tar.xz |
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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100832 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/fun-template-def.cpp')
-rw-r--r-- | test/SemaTemplate/fun-template-def.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/SemaTemplate/fun-template-def.cpp b/test/SemaTemplate/fun-template-def.cpp index 1c9b232f6d..309921c0a6 100644 --- a/test/SemaTemplate/fun-template-def.cpp +++ b/test/SemaTemplate/fun-template-def.cpp @@ -42,7 +42,7 @@ T f1(T t1, U u1, int i1) dummy d1 = sizeof(t1); // expected-error {{no viable conversion}} dummy d2 = offsetof(T, foo); // expected-error {{no viable conversion}} dummy d3 = __alignof(u1); // expected-error {{no viable conversion}} - i1 = typeid(t1); // expected-error {{incompatible type assigning}} + i1 = typeid(t1); // expected-error {{assigning to 'int' from incompatible type 'std::type_info const'}} return u1; } |