summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Move where block-related variables are initialized so that block Eli Friedman2009-03-281-2/+2
| | | | | | types don't get generated when blocks aren't used. llvm-svn: 67898
* Fix silly mistake in test.Eli Friedman2009-03-281-2/+2
| | | | llvm-svn: 67897
* Misc small fixes/cleanups/comment changes.Eli Friedman2009-03-281-0/+3
| | | | llvm-svn: 67895
* Change compound assignment operators to keep track of both the promoted Eli Friedman2009-03-282-1/+9
| | | | | | | | | | | | | | | | | LHS type and the computation result type; this encodes information into the AST which is otherwise non-obvious. Fix Sema to always come up with the right answer for both of these types. Fix IRGen and the analyzer to account for these changes. This fixes PR2601. The approach is inspired by PR2601 comment 2. Note that this changes real *= complex in CodeGen from a silent miscompilation to an explicit error. I'm not really sure that the analyzer changes are correct, or how to test them... someone more familiar with the analyzer should check those changes. llvm-svn: 67889
* Implement access checking for protected base classes.Anders Carlsson2009-03-281-0/+32
| | | | llvm-svn: 67887
* Make our diagnostics about the obsolete GNU designated-initializerDouglas Gregor2009-03-281-1/+2
| | | | | | | syntax into extension warnings, and provide code-modification hints showing how to fix the problem. llvm-svn: 67885
* Fix <rdar://problem/6724396>, where we were silently droppingDouglas Gregor2009-03-271-1/+6
| | | | | | GNU-style array designators, causing us to emit broken initializers. llvm-svn: 67878
* Initial implementation of parsing, semantic analysis, and templateDouglas Gregor2009-03-271-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | instantiation for C++ typename-specifiers such as typename T::type The parsing of typename-specifiers is relatively easy thanks to annotation tokens. When we see the "typename", we parse the typename-specifier and produce a typename annotation token. There are only a few places where we need to handle this. We currently parse the typename-specifier form that terminates in an identifier, but not the simple-template-id form, e.g., typename T::template apply<U, V> Parsing of nested-name-specifiers has a similar problem, since at this point we don't have any representation of a class template specialization whose template-name is unknown. Semantic analysis is only partially complete, with some support for template instantiation that works for simple examples. llvm-svn: 67875
* Better overload resolution for rvalue references.Sebastian Redl2009-03-271-2/+3
| | | | llvm-svn: 67870
* Finish off semantic analysis for regparm, and remove the warning. Also Eli Friedman2009-03-271-0/+7
| | | | | | remove a redundant error in CodeGen. llvm-svn: 67868
* It is OK to cast to a private base class if the current member belongs to ↵Anders Carlsson2009-03-271-0/+31
| | | | | | | | | | | the class that the private base class is a base of: class A {}; class B : private A { void f(B *b) { A* a = b; } }; llvm-svn: 67860
* Implement checking for base class access. Right now it's overly conservative ↵Anders Carlsson2009-03-271-0/+51
| | | | | | but that will change. (Also, protected isn't implemented right now). llvm-svn: 67827
* If the user is trying to apply the -> or . member reference operatorDouglas Gregor2009-03-271-0/+11
| | | | | | | to a function or function pointer, it's probably because the user forgot to put in parentheses () to call the function. llvm-svn: 67826
* Improve recovery when a constructor fails to type-check. Test case from AndersDouglas Gregor2009-03-272-1/+10
| | | | llvm-svn: 67818
* Tests and fixes for templates declared within (non-template)Douglas Gregor2009-03-271-0/+16
| | | | | | classes. Test case from Anders Carlsson, fix from Piotr Rak! llvm-svn: 67817
* Fix rdar://6719156 - clang should emit a better error when blocks are ↵Chris Lattner2009-03-271-1/+7
| | | | | | | | | disabled but are used anyway by changing blocks from being disabled in the parser to being disabled in Sema. llvm-svn: 67816
* Driver: Forward -fno-common to clang.Daniel Dunbar2009-03-261-0/+6
| | | | | | - <rdar://problem/6710978> ccc/clang-driver ignore -fno-common llvm-svn: 67762
* Driver: Test case for darwin::LinkDaniel Dunbar2009-03-261-0/+20
| | | | llvm-svn: 67761
* Driver: Add darwin::Link tool.Daniel Dunbar2009-03-261-1/+1
| | | | | | | - <rdar://problem/6717381> [driver] implement ld argument translation in new driver llvm-svn: 67760
* Fix <rdar://problem/6697053> instance variable is protected.Steve Naroff2009-03-261-0/+45
| | | | | | Treat @package the same as @public. The documentation for @package says it is analogous to private_extern for variables/functions. Fully implementing this requires some kind of linker support (so access is denied to code outside the classes executable image). I don't believe GCC fully implements this semantic. Will discuss with Fariborz offline. llvm-svn: 67755
* Sanity-check argument to indirect goto.Eli Friedman2009-03-261-0/+8
| | | | llvm-svn: 67746
* Set the access specifier for templates inside classes.Anders Carlsson2009-03-261-2/+10
| | | | llvm-svn: 67726
* Check that the access specifier of a member redeclaration is the same as the ↵Anders Carlsson2009-03-261-0/+15
| | | | | | original declaration. llvm-svn: 67722
* Fix for PR3869: actually enforce that the argument of an indirect goto Eli Friedman2009-03-261-0/+4
| | | | | | is of type void*. I'll try to add the appropriate checking later. llvm-svn: 67721
* The injected-class-name of class templates and class templateDouglas Gregor2009-03-262-2/+33
| | | | | | | | | | | | | | | | | | specializations can be treated as a template. Finally, we can parse and process the first implementation of Fibonacci I wrote! Note that this code does not handle all of the cases where injected-class-names can be treated as templates. In particular, there's an ambiguity case that we should be able to handle (but can't), e.g., template <class T> struct Base { }; template <class T> struct Derived : Base<int>, Base<char> { typename Derived::Base b; // error: ambiguous typename Derived::Base<double> d; // OK }; llvm-svn: 67720
* Tighten the setAccess assert. We now allow AS_none if the decl contex is not ↵Anders Carlsson2009-03-251-1/+0
| | | | | | | | a C++ record decl. Also, fix fallout from the change. llvm-svn: 67717
* Implement template instantiation for static data members of classDouglas Gregor2009-03-252-0/+43
| | | | | | | | | | | | | | | | | | templates, including in-class initializers. For example: template<typename T, T Divisor> class X { public: static const T value = 10 / Divisor; }; instantiated with, e.g., X<int, 5>::value to get the value '2'. llvm-svn: 67715
* Fix notes regarding the instantiation of member classes (and test 'em).Douglas Gregor2009-03-251-1/+6
| | | | llvm-svn: 67708
* Instantiation for member classes of class templates. Note that onlyDouglas Gregor2009-03-251-0/+33
| | | | | | | | | | | the declarations of member classes are instantiated when the owning class template is instantiated. The definitions of such member classes are instantiated when a complete type is required. This change also introduces the injected-class-name into a class template specialization. llvm-svn: 67707
* fix PR3880, fixing a comma swallowing bug handling macros that only takeChris Lattner2009-03-251-0/+5
| | | | | | ... arguments. llvm-svn: 67706
* Remove -f__block as codegen for __block variables should be solid.Mike Stump2009-03-252-33/+1
| | | | llvm-svn: 67697
* Fixup codegen for block literals that bleed copy/dispose informationMike Stump2009-03-251-0/+1
| | | | | | from previous block literals. llvm-svn: 67696
* Update to account for the great driver renaming.Mike Stump2009-03-251-1/+1
| | | | llvm-svn: 67695
* Fix parsing of template classes prefixed by nested-name-specifiersDouglas Gregor2009-03-251-0/+8
| | | | llvm-svn: 67685
* Driver: Handle -Xarch_, including warning for nasty -Xarch_ use casesDaniel Dunbar2009-03-251-0/+10
| | | | | | | we aren't going to support. For example: clang -Xarch_i386 -S -Xarch_i386 -o -Xarch_i386 myi386asm.s ... llvm-svn: 67680
* Improve handling of base initializers. We now parse initializers in out of ↵Anders Carlsson2009-03-252-1/+11
| | | | | | | | | | | | | | | | | | | | | | line decls, such as: class C { C() { } int a; }; C::C() : a(10) { } We also diagnose when initializers are used on declarations that aren't constructors: t.cpp:1:10: error: only constructors take base initializers void f() : a(10) { } ^ Doug and/or Sebastian: I'd appreciate a review, especially the nested-name-spec test results (from the looks of it we now match gcc in that test.) llvm-svn: 67672
* Template instantiation for conversion functionsDouglas Gregor2009-03-251-0/+11
| | | | llvm-svn: 67664
* Parse deleted function definitions and hook them up to Doug's machinery.Sebastian Redl2009-03-241-0/+22
| | | | llvm-svn: 67653
* Driver: Handle -flto, -O4, and tweak -emit-llvm to match llvm-gcc.Daniel Dunbar2009-03-241-0/+25
| | | | | | | | | | | | - -emit-llvm no longer changes what compilation steps are done. - -emit-llvm and -emit-llvm -S write output files with .o and .s suffixes, respectively. - <rdar://problem/6714125> clang-driver should support -O4 and -flto, like llvm-gcc llvm-svn: 67645
* Make sure to use RequireCompleteType rather than testing forDouglas Gregor2009-03-245-7/+62
| | | | | | | incomplete types. RequireCompleteType is needed when the type may be completed by instantiating a template. llvm-svn: 67643
* Driver: Change default use of "clang" compiler.Daniel Dunbar2009-03-241-6/+13
| | | | | | | | | | | | | | | | | | | | | | - Don't default to using clang for C++ (use -ccc-clang-cxx to override). - Default to only using clang on i386 and x86_64 (use -ccc-clang-archs "" to override). - <rdar://problem/6712350> [driver] clang should not be used on powerpc by default - <rdar://problem/6705767> driver should default to -ccc-no-clang-cxx I plan to add a warning that we are not using the clang compiler for the given compilation so that users do not think clang is being used in situations it isn't. This change is motivated by the desire to be able to drop clang into a build and have things "just work", even if it happens to get used to compile C++ code or code for an architecture we don't support yet. llvm-svn: 67640
* Driver: Translate -fverbose-asm for LLVM backend.Daniel Dunbar2009-03-241-1/+2
| | | | | | | - <rdar://problem/6715707> driver should translate -fverbose-asm into -asm-verbose llvm-svn: 67634
* Driver: ArgList::getLastArg was in fact returning the first matching arg.Daniel Dunbar2009-03-241-1/+1
| | | | | | | - <rdar://problem/6715818> clang doesn't honor gcc semantic that last -O optimization option wins. llvm-svn: 67628
* Fix the bug that Eli noticed where we wouldn't look at function decls ↵Anders Carlsson2009-03-241-0/+16
| | | | | | outside the class declaration. llvm-svn: 67627
* fix "Comment#1" from PR3872Chris Lattner2009-03-241-1/+9
| | | | llvm-svn: 67625
* Template instantiation for constructorsDouglas Gregor2009-03-241-0/+14
| | | | llvm-svn: 67623
* Update TestRunner.sh for renaming.Daniel Dunbar2009-03-241-1/+25
| | | | | | | | | | | | - Substitutes both clang and clang-cc. - Incorporates patch from Jon Simons to diagnose if clang or clang-cc isn't found. - Uses full path when running scripts, for more precision in the output. llvm-svn: 67610
* Rename clang-driver to clang.Daniel Dunbar2009-03-246-30/+30
| | | | | | Again, I tried to update cmake but it is untested. llvm-svn: 67606
* Support member reference on ?: of struct type.Daniel Dunbar2009-03-242-0/+22
| | | | llvm-svn: 67603
* Rename clang to clang-cc.Daniel Dunbar2009-03-24962-1224/+1228
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
OpenPOWER on IntegriCloud