From 0752e75d9b9093cb88f7e8c505e2511f97b52159 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Wed, 20 Dec 2017 23:17:29 +0000 Subject: Reverting r321223 and its follow-up commit because of failing bots due to Misc/ast-dump-color.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321229 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaTemplate/default-expr-arguments-3.cpp | 110 ++++++++++++------------- 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'test/SemaTemplate/default-expr-arguments-3.cpp') diff --git a/test/SemaTemplate/default-expr-arguments-3.cpp b/test/SemaTemplate/default-expr-arguments-3.cpp index 4d04209e11..4449eb7100 100644 --- a/test/SemaTemplate/default-expr-arguments-3.cpp +++ b/test/SemaTemplate/default-expr-arguments-3.cpp @@ -1,55 +1,55 @@ -// RUN: %clang_cc1 -std=c++14 -verify -ast-dump %s | FileCheck %s -// expected-no-diagnostics - -// CHECK: FunctionDecl {{.*}} used func 'void ()' -// CHECK-NEXT: TemplateArgument type 'int' -// CHECK: LambdaExpr {{.*}} '(lambda at -// CHECK: ParmVarDecl {{.*}} used f 'foo' cinit -// CHECK-NEXT: DeclRefExpr {{.*}} 'foo' EnumConstant {{.*}} 'a' 'foo' - -namespace PR28795 { - template - void func() { - enum class foo { a, b }; - auto bar = [](foo f = foo::a) { return f; }; - bar(); - } - - void foo() { - func(); - } -} - -// CHECK: ClassTemplateSpecializationDecl {{.*}} struct class2 definition -// CHECK: TemplateArgument type 'int' -// CHECK: LambdaExpr {{.*}} '(lambda at -// CHECK: ParmVarDecl {{.*}} used f 'foo' cinit -// CHECK-NEXT: DeclRefExpr {{.*}} 'foo' EnumConstant {{.*}} 'a' 'foo' - -// Template struct case: -template struct class2 { - void bar() { - enum class foo { a, b }; - [](foo f = foo::a) { return f; }(); - } -}; - -template struct class2; - -// CHECK: FunctionTemplateDecl {{.*}} f1 -// CHECK-NEXT: TemplateTypeParmDecl {{.*}} typename depth 0 index 0 T -// CHECK-NEXT: FunctionDecl {{.*}} f1 'void ()' -// CHECK: FunctionDecl {{.*}} f1 'void ()' -// CHECK-NEXT: TemplateArgument type 'int' -// CHECK: ParmVarDecl {{.*}} n 'foo' cinit -// CHECK-NEXT: DeclRefExpr {{.*}} 'foo' EnumConstant {{.*}} 'a' 'foo' - -template -void f1() { - enum class foo { a, b }; - struct S { - int g1(foo n = foo::a); - }; -} - -template void f1(); +// RUN: %clang_cc1 -std=c++14 -verify -ast-dump %s | FileCheck %s +// expected-no-diagnostics + +// CHECK: FunctionDecl {{.*}} used func 'void (void)' +// CHECK-NEXT: TemplateArgument type 'int' +// CHECK: LambdaExpr {{.*}} 'class (lambda at +// CHECK: ParmVarDecl {{.*}} used f 'enum foo' cinit +// CHECK-NEXT: DeclRefExpr {{.*}} 'enum foo' EnumConstant {{.*}} 'a' 'enum foo' + +namespace PR28795 { + template + void func() { + enum class foo { a, b }; + auto bar = [](foo f = foo::a) { return f; }; + bar(); + } + + void foo() { + func(); + } +} + +// CHECK: ClassTemplateSpecializationDecl {{.*}} struct class2 definition +// CHECK: TemplateArgument type 'int' +// CHECK: LambdaExpr {{.*}} 'class (lambda at +// CHECK: ParmVarDecl {{.*}} used f 'enum foo' cinit +// CHECK-NEXT: DeclRefExpr {{.*}} 'enum foo' EnumConstant {{.*}} 'a' 'enum foo' + +// Template struct case: +template struct class2 { + void bar() { + enum class foo { a, b }; + [](foo f = foo::a) { return f; }(); + } +}; + +template struct class2; + +// CHECK: FunctionTemplateDecl {{.*}} f1 +// CHECK-NEXT: TemplateTypeParmDecl {{.*}} typename depth 0 index 0 T +// CHECK-NEXT: FunctionDecl {{.*}} f1 'void (void)' +// CHECK: FunctionDecl {{.*}} f1 'void (void)' +// CHECK-NEXT: TemplateArgument type 'int' +// CHECK: ParmVarDecl {{.*}} n 'enum foo' cinit +// CHECK-NEXT: DeclRefExpr {{.*}} 'enum foo' EnumConstant {{.*}} 'a' 'enum foo' + +template +void f1() { + enum class foo { a, b }; + struct S { + int g1(foo n = foo::a); + }; +} + +template void f1(); -- cgit v1.2.1