llvm-project/clang/test
Joel E. Denny c2575a376a [Attr] Print enum attributes at correct position
For example, given:

  void fn() {
    enum __attribute__((deprecated)) T *p;
  }

-ast-print produced:

  void fn() {
    enum T __attribute__((deprecated(""))) *p;
  }

-ast-print on that produced:

  void fn() {
    enum T *p __attribute__((deprecated("")));
  }

The attribute is on enum T in the first case, but it's on p in the
other cases.

Details:

Within enum declarations, enum attributes were always printed after
the tag and any member list.  When no member list was present but the
enum was a type specifier in a variable declaration, the attribute
then applied to the variable not the enum, changing the semantics.

This patch fixes that by always printing attributes between the enum's
keyword and tag, as clang already does for structs, unions, and
classes.

Reviewed By: rsmith

Differential Revision: https://reviews.llvm.org/D45456

llvm-svn: 330722
2018-04-24 14:50:23 +00:00
..
ARCMT [ObjC] Allow declaring __strong pointer fields in structs in Objective-C 2018-02-28 07:15:55 +00:00
ASTMerge Fix typos in clang 2018-04-06 15:14:32 +00:00
Analysis [ASTImporter] Allow testing of import sequences; fix import of typedefs for anonymous decls 2018-04-24 10:11:53 +00:00
CXX DR727: remove wrong assertion for use of class-scope explicit 2018-04-23 18:38:30 +00:00
CodeCompletion [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
CodeGen [X86] Remove '#ifdef __x86_64__' around mask_set1_epi64 intrinsics. 2018-04-24 03:36:08 +00:00
CodeGenCUDA [CUDA] Set LLVM calling convention for CUDA kernel 2018-04-20 17:01:03 +00:00
CodeGenCXX [Solaris] __float128 is supported on Solaris/x86 2018-04-23 09:28:08 +00:00
CodeGenCoroutines [coroutines] Add __builtin_coro_noop => llvm.coro.noop 2018-04-02 17:35:37 +00:00
CodeGenObjC [CodeGen] Fix a crash that occurs when a non-trivial C struct with a 2018-04-16 20:23:52 +00:00
CodeGenObjCXX [Sema][ObjC] Ensure that the return type of an ObjC method is a complete 2018-04-12 06:01:41 +00:00
CodeGenOpenCL Fix some tests that were failing on Windows 2018-04-20 15:33:44 +00:00
Coverage
CoverageMapping [Coverage] Handle break/continue outside of loop bodies 2018-02-16 07:59:43 +00:00
Driver [GCC] Match a GCC version with a patch suffix without a third version component 2018-04-24 08:50:11 +00:00
FixIt [Parser][FixIt] Better diagnostics for "typedef" instead of "typename" typo 2018-02-08 14:37:58 +00:00
Format [clang-format] Fix bug where -dump-config failed on ObjC header 2018-01-29 17:36:43 +00:00
Frontend Improve checks in test/Frontend/ftime-report-template-decl.cpp 2018-04-23 18:05:35 +00:00
Headers Fix typos in clang 2018-04-06 15:14:32 +00:00
Import [ASTImporter] Support LambdaExprs and improve template support 2018-01-26 11:36:54 +00:00
Index [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
Integration
Layout DR1672, DR1813, DR1881, DR2120: Implement recent fixes to "standard 2018-04-05 18:55:37 +00:00
Lexer hwasan: add -fsanitize=kernel-hwaddress flag 2018-04-13 18:05:21 +00:00
Misc Add tests for llvm-bcanalyzer stream types 2018-04-22 00:04:35 +00:00
Modules Add some infuriatingly necessary comments to this test case. 2018-04-17 11:08:05 +00:00
OpenMP [OPENMP] Do not cast captured by value variables with pointer types in 2018-04-23 17:33:41 +00:00
PCH Add tests for llvm-bcanalyzer stream types 2018-04-22 00:04:35 +00:00
Parser [OpenCL] Reject virtual functions for OpenCL C++ 2018-04-23 11:23:47 +00:00
Preprocessor [X86] WaitPKG intrinsics 2018-04-20 18:44:33 +00:00
Profile [PGO] Detect more structural changes with the stable hash 2017-11-14 23:56:53 +00:00
Refactor [refactor][extract] avoid extracting expressions from types in functions 2017-11-14 18:59:01 +00:00
Rewriter
Sema [Attr] Print enum attributes at correct position 2018-04-24 14:50:23 +00:00
SemaCUDA Fix typos in clang 2018-04-06 15:14:32 +00:00
SemaCXX [AST] Another attempt at fixing the ARM bots. 2018-04-24 08:18:32 +00:00
SemaObjC [Sema] Warn about memcpy'ing non-trivial C structs. 2018-04-17 19:13:41 +00:00
SemaObjCXX [Sema][ObjC] Ensure that the return type of an ObjC method is a complete 2018-04-12 06:01:41 +00:00
SemaOpenCL [OpenCL] Add "cles_khr_int64" extension. 2018-01-26 11:48:46 +00:00
SemaTemplate Fix some handling of AST nodes with diagnostics. 2018-03-28 04:16:13 +00:00
TableGen TableGen: Give up on exact fixits for diagnostic groups 2018-03-06 17:55:00 +00:00
Templight [Templight] Template Instantiation Observer 2018-02-10 14:04:45 +00:00
Tooling Fix test clang-diff-json.cpp 2018-02-10 21:28:55 +00:00
Unit [lit] Set shlibpath_var on Solaris 2017-11-27 13:33:19 +00:00
VFS [vfs] Don't bail out after a missing -ivfsoverlay file 2018-03-23 17:37:27 +00:00
clang-rename
.clang-format
CMakeLists.txt [ThinLTO/CFI] Include TYPE_ID summaries into GLOBALVAL_SUMMARY_BLOCK 2018-02-14 22:41:15 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg.py [debuginfo] Remove temporary FIXME. 2017-12-14 22:12:46 +00:00
lit.site.cfg.py.in
make_test_dirs.pl