]> granicus.if.org Git - clang/commit
Implement pretty diagnostics when doing on-the-fly vector sizing (for vector componen...
authorSteve Naroff <snaroff@apple.com>
Sun, 29 Jul 2007 16:33:31 +0000 (16:33 +0000)
committerSteve Naroff <snaroff@apple.com>
Sun, 29 Jul 2007 16:33:31 +0000 (16:33 +0000)
commitbea0b34d99dddb7829857bbc96628713ab9c274b
treef30715d2e600d8aec62291e3cfebef2573f01420
parent31a458462c6cf417a84e0c47852b18fb22d79acb
Implement pretty diagnostics when doing on-the-fly vector sizing (for vector component access).

For example, before this commit, the following diagnostics would be emitted...

ocu.c:49:12: error: incompatible types assigning 'float  __attribute__((ocu_vector_type(3)))' to 'float4'
    vec4_2 = vec4.rgb; // shorten
    ~~~~~~ ^ ~~~~~~~~
ocu.c:51:7: error: incompatible types assigning 'float  __attribute__((ocu_vector_type(2)))' to 'float'
    f = vec2.xx; // shorten
    ~ ^ ~~~~~~~

Now, the diagnostics look as you would expect...

ocu.c:49:12: error: incompatible types assigning 'float3' to 'float4'
    vec4_2 = vec4.rgb; // shorten
    ~~~~~~ ^ ~~~~~~~~
ocu.c:51:7: error: incompatible types assigning 'float2' to 'float'
    f = vec2.xx; // shorten
    ~ ^ ~~~~~~~

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40579 91177308-0d34-0410-b5e6-96231b3b80d8
Sema/Sema.h
Sema/SemaDecl.cpp
Sema/SemaExpr.cpp
include/clang/AST/Decl.h