summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/enum.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement the lvalue-to-rvalue conversion where needed. TheDouglas Gregor2010-02-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lvalue-to-rvalue conversion adjusts lvalues of qualified, non-class type to rvalue expressions of the unqualified variant of that type. For example, given: const int i; (void)(i + 17); the lvalue-to-rvalue conversion for the subexpression "i" will turn it from an lvalue expression (a DeclRefExpr) with type 'const int' into an rvalue expression with type 'int'. Both C and C++ mandate this conversion, and somehow we've slid through without implementing it. We now have both DefaultFunctionArrayConversion and DefaultFunctionArrayLvalueConversion, and which gets used depends on whether we do the lvalue-to-rvalue conversion or not. Generally, we do the lvalue-to-rvalue conversion, but there are a few notable exceptions: - the left-hand side of a '.' operator - the left-hand side of an assignment - a C++ throw expression - a subscript expression that's subscripting a vector Making this change exposed two issues with blocks: - we were deducing const-qualified return types of non-class type from a block return, which doesn't fit well - we weren't always setting the known return type of a block when it was provided with the ^return-type syntax Fixes the current Clang-on-Clang compile failure and PR6076. llvm-svn: 95167
* When looking up enumerator names for redeclaration, use theDouglas Gregor2010-01-191-0/+11
| | | | | | | ForRedeclaration flag so that we don't look into base classes. Fixes PR6061. llvm-svn: 93862
* Fix test.Eli Friedman2009-12-161-10/+1
| | | | llvm-svn: 91566
* Make sure C-specific enum warning doesn't trigger in C++.Eli Friedman2009-12-161-11/+11
| | | | llvm-svn: 91563
* 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
* First pass at implementing C++ enum semantics: calculate (and store) anJohn McCall2009-12-091-0/+30
| | | | | | | | | | | | "integer promotion" type associated with an enum decl, and use this type to determine which type to promote to. This type obeys C++ [conv.prom]p2 and is therefore generally signed unless the range of the enumerators forces it to be unsigned. Kills off a lot of false positives from -Wsign-compare in C++, addressing rdar://7455616 llvm-svn: 90965
* When recovering from an invalid forward reference to an enum type in C++,John McCall2009-12-041-2/+2
| | | | | | create the enum type in the same scope as you would a record type. llvm-svn: 90500
* Add CheckCallReturnType and start using it for regular call expressions. ↵Anders Carlsson2009-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-6/+5
| | | | llvm-svn: 81346
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Check that the return/argument types of calls are complete.Eli Friedman2009-03-221-2/+2
| | | | llvm-svn: 67485
* Print the context of tag types as part of pretty-printing, e.g.,Douglas Gregor2009-03-191-3/+1
| | | | | | struct N::M::foo llvm-svn: 67284
* Implement the GNU semantics for forward declarations of enum types inDouglas Gregor2009-03-061-0/+15
| | | | | | C and C++. Fixes PR3688. llvm-svn: 66282
* Fix <rdar://problem/6502934>. We were creating an ImplicitCastExprDouglas Gregor2009-01-161-1/+12
| | | | | | with reference type (it should be an lvalue with non-reference type). llvm-svn: 62345
* Add test of enumerator typesDouglas Gregor2008-12-121-0/+14
llvm-svn: 60940
OpenPOWER on IntegriCloud