Commit Graph

16478 Commits

Author SHA1 Message Date
Sebastian Redl 5d43164bc2 Implement the core checking for compatible exception specifications in assignment and initialization.
The exception specification of the assignee must be the same or a subset of the target. In addition, exception specifications on arguments and return types must be equivalent, but this is not implemented yet.
This currently produces two diagnostics for every invalid assignment/initialization, due to the diagnostic produced outside PerformImplicitConversion, e.g. in CheckSingleInitializer. I don't know how to suppress this; in any case I think it is the wrong place for a diagnostic, since there are other diagnostics produced inside the function. So I'm leaving it as it is for the moment.

llvm-svn: 83710
2009-10-10 12:04:10 +00:00
John McCall 6538c93050 Qualified lookup through using declarations. Diagnose a new type of ambiguity.
Split the various ambiguous result enumerators into their own enum.  Tests
for most of C++ [namespace.qual].

llvm-svn: 83700
2009-10-10 05:48:19 +00:00
Anders Carlsson c4859baea4 Check that the return type is complete when calling a member function.
llvm-svn: 83694
2009-10-10 00:06:20 +00:00
Anders Carlsson 1040f2e9db Add another test.
llvm-svn: 83693
2009-10-09 23:58:25 +00:00
Anders Carlsson 7f84ed9287 Add CheckCallReturnType and start using it for regular call expressions. This will improve error messages. For
struct B;

B f();

void g() {
f();
}

We now get

t.cpp:6:3: error: calling 'f' with incomplete return type 'struct B'
  f();
  ^~~
t.cpp:3:3: note: 'f' declared here
B f();
  ^
t.cpp:1:8: note: forward declaration of 'struct B'
struct B;
       ^

llvm-svn: 83692
2009-10-09 23:51:55 +00:00
Douglas Gregor b385b7c62e Dead Code Elimination
llvm-svn: 83686
2009-10-09 22:56:12 +00:00
Douglas Gregor 7d195b93d8 Add some FIXMEs
llvm-svn: 83685
2009-10-09 22:54:25 +00:00
Douglas Gregor 8413751fab Experimental, ultra-hacking Emacs minor mode for Clang-based code completion.
llvm-svn: 83681
2009-10-09 22:17:40 +00:00
Douglas Gregor 58acf32af2 Minor tweaks for code-completion:
- Filter out unnamed declarations
  - Filter out declarations whose names are reserved for the
  implementation (e.g., __bar, _Foo) 
  - Place OVERLOAD: or COMPLETION: at the beginning of each
  code-completion result, so we can easily separate them from other
  compilation results.

llvm-svn: 83680
2009-10-09 22:16:47 +00:00
Anders Carlsson 82a108b4ed Update Xcode project.
llvm-svn: 83679
2009-10-09 22:16:24 +00:00
Devang Patel 3028a43f57 Revert 83567.
llvm-svn: 83676
2009-10-09 22:06:15 +00:00
John McCall 9f3059a192 Refactor the LookupResult API to simplify most common operations. Require users to
pass a LookupResult reference to lookup routines.  Call out uses which assume a single
result.

llvm-svn: 83674
2009-10-09 21:13:30 +00:00
Douglas Gregor 7f34baeb4b When declaring a friend class template, we may end up finding an
injected-class-name (e.g., when we're referring to other
specializations of the current class template). Make sure that we see
the template rather than the injected-class-name. Fixes PR4768.

llvm-svn: 83672
2009-10-09 21:11:42 +00:00
Mike Stump 1ba6edb030 Efficiency refinements.
llvm-svn: 83666
2009-10-09 20:16:49 +00:00
Axel Naumann c5b2d917de Do not install CMakeLists.txt (nor any other txt files) into include/ subdirectories
llvm-svn: 83665
2009-10-09 20:03:20 +00:00
Mike Stump e752333c66 Push all the way out to 80.
llvm-svn: 83664
2009-10-09 19:42:16 +00:00
Axel Naumann 04ca7e181f Passing const Triple& is sufficient for AddDefaultSystemIncludePaths()
llvm-svn: 83663
2009-10-09 19:37:12 +00:00
Mike Stump fc8ff639cb Allow customization for the producer information in the debug output.
llvm-svn: 83659
2009-10-09 18:38:12 +00:00
Mike Stump 727170d2d8 Allow customization for the version line.
llvm-svn: 83652
2009-10-09 17:31:54 +00:00
Fariborz Jahanian 0fe5e0308e Produce good looking diagnostics on ambiguous built-in operators.
Now we produce things like:
bug1.cpp:21:11: error: use of overloaded operator '->*' is ambiguous
        int i = c->*pmf;        // expected-error {{use of overloaded operator '->*' is ambiguous}} \
                ~^  ~~~
bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int const struct A::*')
bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int restrict struct A::*')
...

Still need to look at an issue (indicated as FIXME in the test case).

llvm-svn: 83650
2009-10-09 17:09:58 +00:00
Fariborz Jahanian 4dc1246d87 Use the new API for applying the qualifiers on built-in '->*'
operator's types.

llvm-svn: 83648
2009-10-09 16:34:40 +00:00
Zhongxing Xu 9b6a9be301 Remove unused code.
llvm-svn: 83612
2009-10-09 02:24:00 +00:00
Zhongxing Xu e77cd12f10 Make the behavior explicit by not using the method call.
llvm-svn: 83611
2009-10-09 02:18:31 +00:00
Zhongxing Xu fd15882213 Remove unused code.
llvm-svn: 83610
2009-10-09 02:12:00 +00:00
Mike Stump 0d479e6653 Avoid warning.
llvm-svn: 83609
2009-10-09 01:25:47 +00:00
Fariborz Jahanian 29f9d39568 Improve on reporting ambiguity involving built-in candidates.
I still don't like it but it is improvement over what we had.

llvm-svn: 83603
2009-10-09 00:13:15 +00:00
Mike Stump acdc3158b3 Add a refactor pointer...
llvm-svn: 83599
2009-10-08 23:57:53 +00:00
Steve Naroff 3b08630b06 - Fixup SortCodeCompleteResult() to properly sort keywords on Mac OS (compare was system dependent). Worked on Linux, failed on Mac OS (which caused the recently added testcase to fail on Linux).
- Sort results in testcase.

llvm-svn: 83597
2009-10-08 23:45:10 +00:00
Mike Stump 904ad90bc8 Set up include paths for VC++ and Cygwin headers, along with the
existing MinGW headers, plus the newer 4.4.0 version.  Patch by John
Thompson.

llvm-svn: 83594
2009-10-08 23:29:47 +00:00
Mike Stump f8c1f0d1f0 Speed up testing by avoiding stdio.h, also helps testing on windows.
Patch by John Thompson.

llvm-svn: 83593
2009-10-08 23:05:06 +00:00
Mike Stump af9afe9bc9 "Someone pointed out that in my previous Targets.cpp patch I didn't
handle the long size difference for one of the Windows targets."  Patch
by John Thompson.

llvm-svn: 83592
2009-10-08 23:00:00 +00:00
Mike Stump c99c022841 This fixes support for complex literals, reworked to avoid a goto, and
to add a flag noting the presence of a Microsoft extension suffix (i8,
i16, i32, i64).  Patch by John Thompson.

llvm-svn: 83591
2009-10-08 22:55:36 +00:00
Douglas Gregor 1245e6ff69 Tests for C++ [expr], from James Porter!
llvm-svn: 83588
2009-10-08 22:38:14 +00:00
Mike Stump e07e33a196 Tolerate .exe on executables. Patch by John Thompson. Changed * to .* by me.
llvm-svn: 83586
2009-10-08 22:30:02 +00:00
Mike Stump 8409f9102b Tolerate .exe on executables. Patch by John Thompson.
llvm-svn: 83584
2009-10-08 22:25:29 +00:00
Fariborz Jahanian 8ae5b0a18b Fix up error reporting when object cannot be constructed
because of missing default constructor of a member.
Fixes pr5154.

llvm-svn: 83583
2009-10-08 22:15:49 +00:00
Douglas Gregor 01249503fe Installation of Clang libraries and headers, from Axel Naumann!
llvm-svn: 83582
2009-10-08 22:15:31 +00:00
Mike Stump 03686660b1 In VC++, the *printf functions put an extra "0" in the exponent part
of a floating point number.  This add regular expressions to account
for this.  Patch by John Thompson.

llvm-svn: 83581
2009-10-08 21:57:41 +00:00
Steve Naroff 936354c62a Add code completion support for ObjC property declarations/attributes.
llvm-svn: 83579
2009-10-08 21:55:05 +00:00
Mike Stump c2eeac617d Convert some tests to FileCheck to be more portable. Patch by John Thompson.
llvm-svn: 83578
2009-10-08 21:52:07 +00:00
Douglas Gregor 3beaf9bbcd Implement support for -Wunused-variable, from Oscar Bonilla!
llvm-svn: 83577
2009-10-08 21:35:42 +00:00
Douglas Gregor 18289eeb1d Fix an assertion in the XML output, from Olaf Krzikalla!
llvm-svn: 83576
2009-10-08 21:29:50 +00:00
Devang Patel abf71fa9fc Record location info before emiting alloca for arguments. This allows arguments to have proper location info.
llvm-svn: 83567
2009-10-08 18:53:37 +00:00
Fariborz Jahanian 03b4f666ed Implement [expr.mptr.oper]p6 for '->*' operator.
llvm-svn: 83562
2009-10-08 18:00:39 +00:00
Ted Kremenek 490b8c0f5b Remove use of std::ofstream in HTMLDiagnostics.cpp.
llvm-svn: 83560
2009-10-08 17:44:41 +00:00
Anders Carlsson a18ed9b113 If a global initializer has a non-trivial constructor or destructor, we never want to defer generation of it, even if it is declared static.
With this change we're finally able to compile and run the (infamous)

#include <string>
#include <iostream>

int main(int argc, char **argv) {
  std::cout << "Hello, World" << std::endl;
}

$ clang hello.cpp -lstdc++ -o hello
$ ./hello 
Hello, World

llvm-svn: 83559
2009-10-08 17:28:59 +00:00
Anders Carlsson 9776bd61bc Port test over to FileCheck.
llvm-svn: 83558
2009-10-08 17:22:47 +00:00
Anders Carlsson 3482b819db Mangle std::basic_ostream<char, std::char_traits<char>> as So.
llvm-svn: 83557
2009-10-08 17:20:26 +00:00
Douglas Gregor eeffde3a1d Add more testing for the properties of explicit specialization.
Also, eliminate a redundant diagnostic by marking a variable declared
with incomplete type as an invalid declaration.

llvm-svn: 83553
2009-10-08 16:41:22 +00:00
Fariborz Jahanian 4ff5f05782 Refactoring to further simplify collection of visible conversion
functions.

llvm-svn: 83552
2009-10-08 16:33:37 +00:00