summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/enum-scoped.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR35586: Relax two asserts that are overly restrictiveErich Keane2017-12-111-0/+5
| | | | | | | | | The two asserts are too aggressive. In C++ mode, an enum is NOT considered an integral type, but an enum value is allowed to be an enum. This patch relaxes the two asserts to allow the enum value as well (as typechecking does). llvm-svn: 320411
* Print nested name specifiers for typedefs and type aliasesAlex Lorenz2017-03-101-1/+1
| | | | | | | | | | | | Printing typedefs or type aliases using clang_getTypeSpelling() is missing the namespace they are defined in. This is in contrast to other types that always yield the full typename including namespaces. Patch by Michael Reiher! Differential Revision: https://reviews.llvm.org/D29944 llvm-svn: 297465
* Fix implementation of C++'s restrictions on using-declarations referring to ↵Richard Smith2016-05-051-2/+2
| | | | | | | | | | | enumerators: * an unscoped enumerator whose enumeration is a class member is itself a class member, so can only be the subject of a class-scope using-declaration. * a scoped enumerator cannot be the subject of a class-scope using-declaration. llvm-svn: 268594
* Look through sugar when determining whether a type is a scoped enumerationRichard Smith2015-01-141-0/+8
| | | | | | type. Patch by Stephan Bergmann! llvm-svn: 225889
* PR18551: accepts invalid strong enum to bool when operator! is usedAlp Toker2014-01-201-0/+5
| | | | llvm-svn: 199627
* Diagnose enum redeclarations properlyAlp Toker2014-01-061-4/+4
| | | | | | | | | | | | | | | | | | In all three checks, the note indicates a previous declaration and never a 'use'. Before: enum-scoped.cpp:92:6: note: previous use is here enum Redeclare6 : int; ^ After: enum-scoped.cpp:92:6: note: previous declaration is here enum Redeclare6 : int; ^ llvm-svn: 198600
* PR18044: Reject declarations of enumtype::X early to avoid an assertion inRichard Smith2013-11-251-0/+14
| | | | | | downstream code. llvm-svn: 195687
* Correctly skip type sugar when determining the width of an enum type. DerivedRichard Smith2013-10-151-0/+11
| | | | | | from a patch by Justin Bogner. llvm-svn: 192671
* Don't allow unary negation on scoped enums.Eli Friedman2013-08-161-0/+5
| | | | | | PR16900. llvm-svn: 188511
* PR15633: Note that we are EnteringContext when parsing the nested nameRichard Smith2013-04-011-0/+14
| | | | | | | specifier for an enumeration. Also fix a crash-on-invalid if a non-dependent name specifier is used to declare an enum template. llvm-svn: 178502
* Relaxed enumeration constant naming rules for scoped enumerators so they no ↵Aaron Ballman2012-07-191-0/+7
| | | | | | longer emit a diagnostic when the enumeration's name matches that of the class. Fixes PR13128. llvm-svn: 160490
* Handle instantiations of redeclarations of forward-declared enumerations withinRichard Smith2012-03-261-0/+24
| | | | | | | templated functions. Build a redeclaration chain, and only instantiate the definition of the enum when visiting the defining declaration. llvm-svn: 153427
* Delay checking of dependent underlying types for redeclarations of memberRichard Smith2012-03-261-0/+21
| | | | | | enumerations in templates until the template is instantiated. llvm-svn: 153426
* When defining a forward-declared enum, don't try to attach the definition toRichard Smith2012-03-231-0/+11
| | | | | | | a previous declaration if the redeclaration is invalid. That way lies madness. Fixes a crash-on-invalid reported by Abramo. llvm-svn: 153349
* Slightly tweak this condition. "isTransparentContext()" was checking whether anNick Lewycky2012-03-101-0/+5
| | | | | | | | enum is scoped or not, which is not relevant here. Instead, phrase the loop in the same terms that the standard uses, instead of this awkward set of conditions that is *nearly* equal. llvm-svn: 152489
* Loosen the precondition of isCXXInstanceMember() to simply returnDouglas Gregor2012-03-081-0/+10
| | | | | | "false" for declarations that aren't members of classes. Fixes PR12106. llvm-svn: 152284
* Don't allow a value of a scoped enumeration to be used as the first bound for anRichard Smith2012-02-041-1/+1
| | | | | | | array new expression. This lays some groundwork for the implicit conversion to integral or unscoped enumeration which C++11 ICEs undergo. llvm-svn: 149772
* constexpr: converted constant expression handling for enumerator values, caseRichard Smith2012-01-181-1/+1
| | | | | | | | | | values and non-type template arguments of integral and enumeration types. This change causes some legal C++98 code to no longer compile in C++11 mode, by enforcing the C++11 rule that narrowing integral conversions are not permitted in the final implicit conversion sequence for the above cases. llvm-svn: 148439
* Update C++11 scoped enumeration support to match the final proposal:Richard Smith2012-01-101-0/+27
| | | | | | | | - reject definitions of enums within friend declarations - require 'enum', not 'enum class', for non-declaring references to scoped enumerations llvm-svn: 147824
* Make sure we perform lvalue-to-rvalue conversions for enum initializers. ↵Eli Friedman2011-12-061-0/+5
| | | | | | PR11484. llvm-svn: 145874
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Fixed enum types can be complete without actually being valid to useJohn McCall2011-07-061-1/+13
| | | | | | | as scope specifiers; diagnose the attempt, rather than letting it go to an assert. The rest of PR10264. llvm-svn: 134479
* Properly protect colons when parsing a nested-name-specifier as partJohn McCall2011-07-061-0/+11
| | | | | | | of an enum specifier in dialects which permit fixed underlying types. Fixes the rejects-valid part of PR10264. llvm-svn: 134468
* Scoped enumerations should not be treated as integer types (in the CDouglas Gregor2011-05-051-0/+10
| | | | | | | | sense). Fixes <rdar://problem/9366066> by eliminating an inconsistency between C++ overloading (which handled scoped enumerations correctly) and C binary operator type-checking (which didn't). llvm-svn: 130924
* Implement comparison of C++0x scoped enumeration types. Fixes PR9333.Douglas Gregor2011-03-011-0/+6
| | | | llvm-svn: 126752
* Fix a little bug in the handling of enumeration types with a fixedDouglas Gregor2011-02-221-0/+7
| | | | | | | underlying type: we weren't parsing unnamed enumeration types with a fixed underlying type. llvm-svn: 126184
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-081-0/+98
bit by me). llvm-svn: 116122
OpenPOWER on IntegriCloud