summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/instantiate-enum.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR13403 (+duplicates): implement C++ DR1310 (http://wg21.link/cwg1310).Richard Smith2017-01-191-2/+3
| | | | | | | | | | | | | | | | | | | | | | Under this defect resolution, the injected-class-name of a class or class template cannot be used except in very limited circumstances (when declaring a constructor, in a nested-name-specifier, in a base-specifier, or in an elaborated-type-specifier). This is apparently done to make parsing easier, but it's a pain for us since we don't know whether a template-id using the injected-class-name is valid at the point when we annotate it (we don't yet know whether the template-id will become part of an elaborated-type-specifier). As a tentative resolution to a perceived language defect, mem-initializer-ids are added to the list of exceptions here (they generally follow the same rules as base-specifiers). When the reference to the injected-class-name uses the 'typename' or 'template' keywords, we permit it to be used to name a type or template as an extension; other compilers also accept some cases in this area. There are also a couple of corner cases with dependent template names that we do not yet diagnose, but which will also get this treatment. llvm-svn: 292518
* Do not add enums to prototype scope in C++ modes.Peter Collingbourne2014-02-221-0/+15
| | | | | | | | | | | | | | The language forbids defining enums in prototypes, so this check is normally redundant, but if an enum is defined during template instantiation it should not be added to the prototype scope. While at it, clean up the code that deals with tag definitions in prototype scope and expand the visibility warning to cover the case where an anonymous enum is defined. Differential Revision: http://llvm-reviews.chandlerc.com/D2742 llvm-svn: 201927
* When instantiating a function-scoped enum, make sure that it and itsDouglas Gregor2010-03-011-0/+16
| | | | | | | enumeration constants get placed into the local instantiation hash table. Fixes PR6375. llvm-svn: 97471
* 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
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Implement instantiation of enums within class templates. This isn'tDouglas Gregor2009-03-171-0/+11
quite as great as it sounds, because, while we can refer to the enumerator values outside the template, e.g., adder<long, 3, 4>::value we can't yet refer to them with dependent names, so no Fibonacci (yet). InstantiateClassTemplateSpecialization is getting messy; next commit will put it into a less-ugly state. llvm-svn: 67092
OpenPOWER on IntegriCloud