Commit Graph

12 Commits

Author SHA1 Message Date
Chris Lattner 810d330cd3 Fix a long standard problem with clang retaining "too much" sugar
information about types.  We often print diagnostics where we say 
"foo_t" is bad, but the user doesn't know how foo_t is declared 
(because it is a typedef).  Fix this by expanding sugar when present
in a diagnostic (and not one of a few special cases, like vectors).

Before:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' and 'typeof(F)')
 MAX(P, F);
 ^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                             ^

After:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
 MAX(P, F);
 ^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B)    ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
                                                                             ^

llvm-svn: 65081
2009-02-19 23:45:49 +00:00
Chris Lattner 303284acfc If x is an invalid field decl, don't construct an expression for P->x,
just silently return an error to avoid bogus diagnostics.

llvm-svn: 64491
2009-02-13 22:08:30 +00:00
Chris Lattner 5eca6ada3a Implement C99 6.5.3.4p1, rejecting sizeof(bitfield)
llvm-svn: 62936
2009-01-24 21:29:22 +00:00
Chris Lattner 8dff017695 Fix PR3386 by handling GCC's rules for alignof, which are substantially
different than those for sizeof.  Reject alignof(bitfield) like gcc does.

llvm-svn: 62928
2009-01-24 20:17:12 +00:00
Chris Lattner dca17ceb19 add expected diag
llvm-svn: 60927
2008-12-12 05:59:56 +00:00
Chris Lattner 053441f39d Fix rdar://6095061 - gcc allows __builtin_choose_expr as an lvalue
llvm-svn: 60924
2008-12-12 05:35:08 +00:00
Chris Lattner 8cd9b96ee1 add a silly testcase
llvm-svn: 59877
2008-11-22 19:57:03 +00:00
Chris Lattner 40bb0c83d4 print a type in a diagnostic.
llvm-svn: 59829
2008-11-21 18:27:34 +00:00
Chris Lattner 9b3bbe9db7 Implement rdar://6319320: give a good diagnostic for cases where people
are trying to use the old GCC "casts as lvalue" extension.  We don't and
will hopefully never support this.

llvm-svn: 59460
2008-11-17 19:51:54 +00:00
Chris Lattner ea71438a93 add a simple check to warn people who type "=+" when they probably meant
"+=".

llvm-svn: 55131
2008-08-21 18:04:13 +00:00
Chris Lattner ec8996d771 Add support for __extension__ as an lvalue. rdar://6097308
llvm-svn: 54033
2008-07-25 18:07:19 +00:00
Chris Lattner c43926fe67 Implement support for __extension__ which silences extwarnings in its
scope.  This is part of the fix for PR1966

llvm-svn: 46669
2008-02-02 20:20:10 +00:00