Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang_delta/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ EXTRA_DIST = \
tests/rename-fun/test1.h \
tests/rename-param/invalid.c \
tests/rename-var/rename-var.c \
tests/replace-dependent-typedef/test1.cc \
tests/replace-derived-class/replace-derived1.cpp \
tests/replace-derived-class/replace-derived2.cpp \
tests/replace-derived-class/replace-derived3.cpp \
Expand Down
1 change: 1 addition & 0 deletions clang_delta/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ EXTRA_DIST = \
tests/rename-fun/test1.h \
tests/rename-param/invalid.c \
tests/rename-var/rename-var.c \
tests/replace-dependent-typedef/test1.cc \
tests/replace-derived-class/replace-derived1.cpp \
tests/replace-derived-class/replace-derived2.cpp \
tests/replace-derived-class/replace-derived3.cpp \
Expand Down
19 changes: 19 additions & 0 deletions clang_delta/tests/replace-dependent-typedef/test1.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// RUN: %clang_delta --transformation=replace-dependent-typedef --counter=1 %s 2>&1 | %remove_lit_checks | FileCheck %s --check-prefix=CHECK-1
// RUN: %clang_delta --transformation=replace-dependent-typedef --counter=2 %s 2>&1 | %remove_lit_checks | FileCheck %s --check-prefix=CHECK-2
// RUN: %clang_delta --transformation=replace-dependent-typedef --counter=3 %s 2>&1 | %remove_lit_checks | FileCheck %s --check-prefix=CHECK-3

typedef long xx_t;
// CHECK-1: typedef long xx;
typedef xx_t xx;

template <class T> struct S { typedef T type; };
struct A { };
// CHECK-2: struct B { typedef A type; };
struct B { typedef S<A>::type type; };

template <typename T>
struct C {
typedef int Inner;
// CHECK-3: typedef int Bar;
typedef C::Inner Bar;
};