Commit Graph

33398 Commits

Author SHA1 Message Date
Douglas Gregor 60060d6f8f Treat the Microsoft/Borland keyword "__except" as a context-sensitive
keyword, because both libstdc++ and libc++ use "__except" as an
identifier. Fixes <rdar://problem/10322555>.

llvm-svn: 142636
2011-10-21 03:57:52 +00:00
Nick Lewycky 99cc8c01ee Massage this test a little so it works when run inside the Google environment.
llvm-svn: 142635
2011-10-21 03:07:40 +00:00
Sean Callanan 95e74be193 I added a new function to DeclContext called
addDeclInternal().  This function suppresses any
calls to FindExternalVisibleDeclsByName() while
a Decl is added to a DeclContext.  This behavior
is required for the ASTImporter, because in the
case of the LLDB client the ASTImporter would be
called recursively to import the visible decls,
which leads to assertions because the recursive
call is seeing partially-formed types.

I also modified the ASTImporter to use
addDeclInternal() in all places where it would
otherwise use addDecl().  This fix should not
affect the rest of Clang, passes Clang's
testsuite, and fixes several serious LLDB bugs.

llvm-svn: 142634
2011-10-21 02:57:43 +00:00
Nick Lewycky ba743b75cb Take DW_AT_comp_dir from $PWD when it's present and starts with a '/'. This is
closer to what GCC does, except that GCC also checks that the inodes for $PWD
and '.' match.

llvm-svn: 142633
2011-10-21 02:32:14 +00:00
Richard Smith fe2750db42 Add -Wc++98-compat diagnostics for jumps which bypass initialization of non-POD
but trivially constructible and destructible variables in C++11 mode. Also
incidentally improve the precision of the wording for jump diagnostics in C++98
mode.

llvm-svn: 142619
2011-10-20 21:42:12 +00:00
Douglas Gregor 7f4fbecbe2 When fixing up the storage class for an anonymous union, don't mark
the anonymous union as valid: our fixes have Fix-Its.

llvm-svn: 142616
2011-10-20 20:40:00 +00:00
Ted Kremenek 77a0eb20ab Add test case for analyzer crash reported in <rdar://problem/10308201> (which is already fixed in mainline).
llvm-svn: 142606
2011-10-20 19:33:06 +00:00
Richard Smith f411196d15 'extern template' is a C++11 feature. Add an Extension for C++98 (this matches
gcc's behaviour), and a -Wc++98-compat-pedantic warning for C++11.

llvm-svn: 142597
2011-10-20 18:35:58 +00:00
Douglas Gregor f4ef4d2ec5 There's no point in marking a declaration invalid just because it
shadows a template parameter. Complain about the shadowing (or not,
under -fms-extensions), but don't invalidate the declaration. Merely
forget about the template parameter declaration.

llvm-svn: 142596
2011-10-20 17:58:49 +00:00
Argyrios Kyrtzidis 9006807dcd [libclang] Don't use C++-style comments in c-index-test.c.
llvm-svn: 142590
2011-10-20 17:21:46 +00:00
Douglas Gregor 44e5a0a72b Diagnose class template (partial) specializations that occur in the
*wrong* class scope. This is one of the problems behind
<rdar://problem/9676205>.

llvm-svn: 142588
2011-10-20 16:41:18 +00:00
Douglas Gregor f65d8ffca7 When we parse something that looks like a templated friend tag but
actually just has an extraneous 'template<>' header, strip off the
'template<>' header and treat it as a normal friend tag. Fixes PR10660
/ <rdar://problem/9958322>.

llvm-svn: 142587
2011-10-20 15:58:54 +00:00
Ted Kremenek 337c5b880c Further refine the diagnostic categories for ARC diagnostics. Addresses <rdar://problem/10245086>.
llvm-svn: 142571
2011-10-20 05:07:47 +00:00
Richard Smith 91c7bbde4b Add -Wc++98-compat warning for enumerations in nested name specifiers.
llvm-svn: 142568
2011-10-20 03:28:47 +00:00
David Blaikie 733f7bb81f FixIt insert 'static' for anonymous unions at global or namespace scope.
llvm-svn: 142566
2011-10-20 02:49:08 +00:00
David Blaikie 6f686fc271 Add a fixit to remove storage specifiers on anonymous enums.
llvm-svn: 142565
2011-10-20 02:10:55 +00:00
David Blaikie 357cd4e715 Fix all 80 col violations in include/clang/Basic, plus any trailing whitespace in the files I'm touching anyway.
llvm-svn: 142564
2011-10-20 01:45:20 +00:00
Richard Smith 4e9ea71dab Make the -verify bits in this test actually test something, and fix a few cases
where the test didn't work.

llvm-svn: 142563
2011-10-20 01:41:28 +00:00
Eli Friedman 7bba3ef862 Define __STDC__ in -fms-extensions mode; defining it is consistent with gcc, and not defining it causes the system headers on multiple platforms to break with -fms-extensions because they assume the lack of a definition of __STDC__ implies a traditional (pre-ANSI) preprocessor. PR10324 and <rdar://problem/10313809> .
llvm-svn: 142554
2011-10-19 23:46:05 +00:00
David Blaikie 30d15445ed 80 cols (one I created in my last commit, plus a bunch of others that were already there)
llvm-svn: 142552
2011-10-19 22:56:21 +00:00
David Blaikie 0a8e8999d6 Don't provide errors for anonymous unions when they're actually anonymous classes.
llvm-svn: 142551
2011-10-19 22:43:29 +00:00
Richard Smith 09f76ee63c Improve the diagnostic when a comma ends up at the end of a declarator group
instead of a semicolon (as sometimes happens during refactorings). When such a
comma is seen at the end of a line, and is followed by something which can't
possibly be a declarator (or even something which might be a plausible typo for
a declarator), suggest that a semicolon was intended.

llvm-svn: 142544
2011-10-19 21:33:05 +00:00
Richard Smith f720df0ed6 -Wc++98-compat: warn on nontrivial types used in unions and anonymous structs.
llvm-svn: 142541
2011-10-19 20:41:51 +00:00
Matt Beaumont-Gay 4b489fa629 Only warn at self-initialization if some later use is always uninitialized.
llvm-svn: 142538
2011-10-19 18:53:03 +00:00
Richard Smith c620f554b9 -Wc++98-compat: diagnose if a reference is bound to a prvalue which does not
have an unambiguous accessible copying constructor; this is ill-formed in C++98.

llvm-svn: 142533
2011-10-19 16:55:56 +00:00
Rafael Espindola 5450f218a6 Fix the signatures of vfork, __sigsetjmp and sigsetjmp.
Patch by Dimitry Andric.

llvm-svn: 142531
2011-10-19 14:50:34 +00:00
Hans Wennborg cc8ce7b1d7 Break out ssize_t test from Sema/format-strings-fixit.c
Move to a separate test that sets a specific target triple
so that the type of ssize_t is known.

llvm-svn: 142481
2011-10-19 07:55:50 +00:00
Douglas Gregor e248eea214 Improve the warning for cv-qualifiers on free functions, from Ahmed Charles!
llvm-svn: 142478
2011-10-19 06:04:55 +00:00
Douglas Gregor 5fdc4de718 Add support for constant arrays, from Anders Waldenborg!.
llvm-svn: 142477
2011-10-19 05:51:43 +00:00
Douglas Gregor 89861066ed Add TypeKind.CONSTANTARRAY, from Anders Waldenborg!
llvm-svn: 142476
2011-10-19 05:50:34 +00:00
Douglas Gregor d59d02cc38 Fix error message for unknown type kind, from Anders Waldenborg!
llvm-svn: 142475
2011-10-19 05:49:29 +00:00
Douglas Gregor 32df3664be This new field was introduced in clang-c in r141277
Python needs this in its structure definition so it allocates enough
memory. From Anders Waldenborg!

llvm-svn: 142474
2011-10-19 05:47:46 +00:00
David Blaikie 651c73ce78 Fix pr9789, assert-on-invalid while instantiating an (invalid) class template with a non-final parameter pack. Also improve the warning for non-final parameter packs in this scenario so it only fires once, rather than once for every template parameter after the non-final parameter pack.
llvm-svn: 142473
2011-10-19 05:19:50 +00:00
Douglas Gregor dab63c1434 Tweak this test to test more directly what we want, and hopefully work around the brokenness of code completion under -fdelayed-template-parsing
llvm-svn: 142472
2011-10-19 04:17:22 +00:00
Argyrios Kyrtzidis 4e8b13613b Don't forget to complete the objc interface before asking for information,
otherwise lldb will suffer.

llvm-svn: 142471
2011-10-19 02:25:16 +00:00
Richard Smith a066ccfcf1 Add a -Wc++98-compat warning for friend functions of class templates which would
be implicitly instantiated (resulting in a redefinition) in C++98.

llvm-svn: 142468
2011-10-19 00:54:10 +00:00
Eric Christopher 7ec8ec8581 Add block information for ObjC @catch blocks.
Fixes rdar://10282889

llvm-svn: 142467
2011-10-19 00:44:01 +00:00
Eric Christopher a9d3497b5e Add a new subclass of RunCleanupScopes that also handles creating new
lexical blocks for debug info.

llvm-svn: 142466
2011-10-19 00:43:52 +00:00
Peter Collingbourne a48f33f951 Move static array parameter checks to SemaExpr, per Doug's request
llvm-svn: 142465
2011-10-19 00:16:45 +00:00
Richard Smith 38c0e0417c -Wc++98-compat: warn if a SFINAE substitution in C++11 suppresses an access
control diagnostic.

llvm-svn: 142463
2011-10-19 00:07:01 +00:00
Fariborz Jahanian 7f73302b4f objc: allow class name qualified with protocols in
iboutletcollection attribute. But ignore protocol
list. // rdar://10296078

llvm-svn: 142459
2011-10-18 23:13:50 +00:00
Anna Zaks d009bfac0c [analyzer] Move predecessor into the NodeBuilder context.
llvm-svn: 142454
2011-10-18 23:06:48 +00:00
Anna Zaks a99b41f37f [analyzer] Make NodeBuilder and Pred node loosely coupled
NodeBuilder should not assume it's dealing with a single predecessor. Remove predecessor getters. Modify the BranchNodeBuilder to not be responsible for doing auto-transitions (which depend on a predecessor).

llvm-svn: 142453
2011-10-18 23:06:44 +00:00
Anna Zaks 1dd965eaa5 [analyzer] Remove StmtNodeBuilder from CheckerContext
It now only depends on a generic NodeBuilder instead. As part of this change, make the generic node builder results finalized by default.

llvm-svn: 142452
2011-10-18 23:06:38 +00:00
Anna Zaks 88d9462b73 [analyzer] Subclassing StmtBuilder from the NodeBuilder
llvm-svn: 142451
2011-10-18 23:06:33 +00:00
Anna Zaks e83ddcc4ec [analyzer] Remove dead code.
ExprEngineBuilders is not used.

llvm-svn: 142450
2011-10-18 23:06:29 +00:00
Anna Zaks ea96f5b852 [analyzer] Remove redundant method + whitespace.
llvm-svn: 142449
2011-10-18 23:06:25 +00:00
Anna Zaks 6d285c58ec [analyzer] Modularize builder use in processBranch.
Take advantage of the new builders for branch processing. As part of this change pass generic NodeBuilder (instead of BranchNodeBuilder) to the BranchCondition callback and remove the unused methods form BranchBuilder.

llvm-svn: 142448
2011-10-18 23:06:21 +00:00
Anna Zaks eebbbc7253 [analyzer] Pull Pred out of NodeBuilderContext.
Each builder will have a different one, so it doesn't make sense to keep it in the context.

llvm-svn: 142447
2011-10-18 23:06:16 +00:00
Anna Zaks 2e2eb49f7f [analyzer] Rely only on NodeBuilder inside CheckerContext.
llvm-svn: 142446
2011-10-18 23:06:11 +00:00