NAKAMURA Takumi [Sat, 22 Oct 2011 11:28:32 +0000 (11:28 +0000)]
test/Driver/debug.c: Mark this as "REQUIRES: shell".
Former RUN line does not make sense on Win32 hosts.
Win32 hosts would not be expected to set appropriate $PWD.
Latter RUN line might be made valid if PathV2::is_absolute("/foo") would be true. Unfortunately, "/foo" should not be treated as absolute path on Win32.
FYI, on mingw32 with MSYS bash (it has 'shell' feature);
Former) $PWD is set as "X:/hogehoge/test/Driver"
Latter) PWD=/foo sets "X:/root/to/msys/foo" to $PWD.
Ted Kremenek [Sat, 22 Oct 2011 02:37:33 +0000 (02:37 +0000)]
Only emit implicit constant conversion truncation warnings in reachable code. Apparently this is what GCC does, and some code depends on this. Fixes <rdar://problem/10321089>.
objc: private methods can have their attributes, no diagnostic is required.
None private methods if their implementation have attribute, they must exactly
match those in their declarations. // rdar://10271563
[PCH] When serializing Stmts, keep track of when sub statements are referenced again and
in such a case just write out a reference of a previously serialized Stmt, instead
of serializing it all over again.
This saves memory + space + [de]serializing time, and avoids blowing up memory
with pathological cases. rdar://10293911
c++: support gcc's application of weak attribute on
class declaration which forces any such class and any
class that inherits from such a class to have their
typeinfo symbols be marked as weak.
// rdar://10246395
A test/CodeGenCXX/weak-extern-typeinfo.cpp
M lib/Sema/SemaDeclCXX.cpp
M lib/Sema/SemaDeclAttr.cpp
M lib/CodeGen/CGRTTI.cpp
Sean Callanan [Fri, 21 Oct 2011 16:15:18 +0000 (16:15 +0000)]
Added documentation for the recently-added
addDecl() and makeDeclVisibleInContextInternal()
functions, and made the latter private since it
does not and should not have external clients.
Douglas Gregor [Fri, 21 Oct 2011 15:47:52 +0000 (15:47 +0000)]
When performing name lookup for the previous declaration of a field,
be sure to consider all of the possible lookup results. We were
assert()'ing (but behaving correctly) for unresolved values. Fixes
PR11134 / <rdar://problem/10290422>.
Douglas Gregor [Fri, 21 Oct 2011 03:57:52 +0000 (03:57 +0000)]
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>.
Sean Callanan [Fri, 21 Oct 2011 02:57:43 +0000 (02:57 +0000)]
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.
Nick Lewycky [Fri, 21 Oct 2011 02:32:14 +0000 (02:32 +0000)]
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.
Richard Smith [Thu, 20 Oct 2011 21:42:12 +0000 (21:42 +0000)]
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.
Douglas Gregor [Thu, 20 Oct 2011 17:58:49 +0000 (17:58 +0000)]
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.
Douglas Gregor [Thu, 20 Oct 2011 15:58:54 +0000 (15:58 +0000)]
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>.
Eli Friedman [Wed, 19 Oct 2011 23:46:05 +0000 (23:46 +0000)]
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> .
Richard Smith [Wed, 19 Oct 2011 21:33:05 +0000 (21:33 +0000)]
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.
Richard Smith [Wed, 19 Oct 2011 16:55:56 +0000 (16:55 +0000)]
-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.
David Blaikie [Wed, 19 Oct 2011 05:19:50 +0000 (05:19 +0000)]
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.
Anna Zaks [Tue, 18 Oct 2011 23:06:44 +0000 (23:06 +0000)]
[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).
Anna Zaks [Tue, 18 Oct 2011 23:06:21 +0000 (23:06 +0000)]
[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.
Anna Zaks [Tue, 18 Oct 2011 23:05:58 +0000 (23:05 +0000)]
[analyzer] Node Builder refactoring: Introduce a simple Node Builder responsible for generating the node frontier.
Currently we have a bunch of different node builders which provide some common
functionality but are difficult to refactor. Each builder generates nodes of
different kinds and calculates the frontier nodes, which should be propagated
to the next step (after the builder dies).
Introduce a new NodeBuilder which provides very basic node generation facilities
but takes care of the second problem. The idea is that all the other builders
will eventually use it. Use this builder in CheckerContext instead of
StmtNodeBuilder (the way the frontier is propagated to the StmtBuilder
is a hack and will be removed later on).
objc: more changes in use of IBOutletCollection attribute.
'Class' is disallowed as argument. If the argument is missing,
NSObject is assumed. // rdar://10296078
[libclang] Since an objc extension semantically continues the interface of the class
don't use unique USRs for them, otherwise we fail to associate @implementation methods
with the methods in extensions.