summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/declspec.c
Commit message (Collapse)AuthorAgeFilesLines
* Warn on duplicate function specifierSerge Pavlov2013-11-131-0/+13
| | | | | | | | | This patch fixes PR8264. Duplicate qualifiers already are diagnozed, now the same diagnostics is issued for duplicate function specifiers. Differential Revision: http://llvm-reviews.chandlerc.com/D2025 llvm-svn: 194559
* Add missing diagnostic for a nested-name-specifier on a free-standing type ↵Richard Smith2013-03-181-1/+1
| | | | | | definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations. llvm-svn: 177335
* Downgrade the "declaration does not declare anything" error to aDouglas Gregor2010-04-081-1/+1
| | | | | | | warning. It's not harmful to have such pointless declarations, and GCC does not diagnose this issue consistently. llvm-svn: 100814
* Implement PR6423 by using one token of lookahead to disambiguate Chris Lattner2010-02-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | an *almost* always incorrect case. This only does the lookahead in the insanely unlikely case, so it shouldn't impact performance. On this testcase: struct foo { } typedef int x; Before: t.c:3:9: error: cannot combine with previous 'struct' declaration specifier typedef int x; ^ After: t.c:2:2: error: expected ';' after struct } ^ ; llvm-svn: 97403
* the declspec of a declaration can have storage-class specifiers,Chris Lattner2010-02-021-0/+3
| | | | | | | | | type qualifiers and type specifiers in any order. For example, this is valid: struct x {...} typedef y; This fixes PR6208. llvm-svn: 95094
* Implement PR6180, substantially improving the diagnostics we get fromChris Lattner2010-02-021-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | forgetting a ';' at the end of a struct. For something like: class c { } void foo() {} we now produce: t.cc:3:2: error: expected ';' after class } ^ ; instead of: t.cc:4:1: error: cannot combine with previous 'class' declaration specifier void foo() {} ^ t.cc:2:7: error: 'class c' can not be defined in the result type of a function class c { ^ GCC produces: t.cc:4: error: new types may not be defined in a return type t.cc:4: note: (perhaps a semicolon is missing after the definition of ‘c’) t.cc:4: error: two or more data types in declaration of ‘foo’ I *think* I got the follow set right, but if I forgot anything, we'll start getting spurious "expected ';' after class" errors, let me know if you see any. llvm-svn: 95042
* Tighten up the "cannot return array or function type" diagnostic toDouglas Gregor2010-01-111-1/+1
| | | | | | | say either "array type" or "function type", whichever it is. No reason to make the user guess. llvm-svn: 93164
* implement PR3962: diagnose more faulty cases of usage of the restrict ↵Nuno Lopes2009-12-171-0/+1
| | | | | | qualifier. this also removes a FIXME llvm-svn: 91601
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Fix a long standard problem with clang retaining "too much" sugar Chris Lattner2009-02-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Change a whole lot of diagnostics to take QualType's directly Chris Lattner2008-11-241-2/+2
| | | | | | | | instead of converting them to strings first. This also fixes a bunch of minor inconsistencies in the diagnostics emitted by clang and adds a bunch of FIXME's to DiagnosticKinds.def. llvm-svn: 59948
* improve error to be something end users will actually understand :)Chris Lattner2008-04-021-2/+2
| | | | llvm-svn: 49097
* 1) Enforce C99 6.7.3p2: "Types other than pointer types derived fromChris Lattner2008-04-021-0/+7
| | | | | | | | | | | | | | object or incomplete types shall not be restrict-qualified." 2) Warn about qualifiers on function types: C99 6.7.3p8: "If the specification of a function type includes any type qualifiers, the behavior is undefined." 3) Implement restrict on C++ references. 4) fix some locations for various C++ reference diagnostics. llvm-svn: 49081
* A much better fix for http://llvm.org/bugs/show_bug.cgi?id=1987.Steve Naroff2008-02-141-3/+7
| | | | llvm-svn: 47103
* Allow the parser to detect invalid DeclSpec's. This fixes ↵Steve Naroff2008-02-121-1/+5
| | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=1987. This commit only "guards" the call to ParseDeclarationSpecifiers() in ParseDeclarationOrFunctionDefinition(). We could consider guarding all calls, however this is a bit radical (since it effectively stops parsing the declaration once we have a bad declspec). Will discuss with Chris tomorrow. llvm-svn: 46984
* Declarator::clear(): Null out variable after it's been deleted.Steve Naroff2008-01-171-0/+3
| | | | | | | | This avoids a double free (which is good:-) Bug submitted by Eli. llvm-svn: 46105
* Implement C99 6.7.5.3p1Chris Lattner2007-12-191-0/+5
llvm-svn: 45188
OpenPOWER on IntegriCloud