• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: not %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -fms-extensions -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix CHECK -strict-whitespace %s
2 
3 namespace TestInvalidRParenOnCXXUnresolvedConstructExpr {
4 template <class T>
f(T i,T j)5 void f(T i, T j) {
6   return T (i, j;
7 }
8 }
9 
10 // CHECK: NamespaceDecl {{.*}} <{{.*}}> {{.*}} TestInvalidRParenOnCXXUnresolvedConstructExpr
11 // CHECK-NEXT: `-FunctionTemplateDecl
12 // CHECK-NEXT:   |-TemplateTypeParmDecl
13 // CHECK-NEXT:   `-FunctionDecl
14 // CHECK-NEXT:     |-ParmVarDecl
15 // CHECK-NEXT:     |-ParmVarDecl
16 // CHECK-NEXT:     `-CompoundStmt
17 // CHECK-NEXT:       `-ReturnStmt
18 // CHECK-NEXT:         `-CXXUnresolvedConstructExpr {{.*}} <col:10, col:16> 'T'
19 // CHECK-NEXT:           |-DeclRefExpr {{.*}} <col:13> 'T' lvalue ParmVar {{.*}} 'i' 'T'
20 // CHECK-NEXT:           `-DeclRefExpr {{.*}} <col:16> 'T' lvalue ParmVar {{.*}} 'j' 'T'
21 
22 
23 namespace TestInvalidIf {
24 int g(int i) {
25   if (invalid_condition)
26     return 4;
27   else
28     return i;
29 }
30 }
31 // CHECK: NamespaceDecl {{.*}} <{{.*}}> {{.*}} TestInvalidIf
32 // CHECK-NEXT: `-FunctionDecl
33 // CHECK-NEXT:   |-ParmVarDecl
34 // CHECK-NEXT:   `-CompoundStmt
35 // CHECK-NEXT:     `-IfStmt {{.*}} <line:25:3, line:28:12>
36 // CHECK-NEXT:       |-<<<NULL>>>
37 // CHECK-NEXT:       |-<<<NULL>>>
38 // CHECK-NEXT:       |-OpaqueValueExpr {{.*}} <<invalid sloc>> '_Bool'
39 // CHECK-NEXT:       |-ReturnStmt {{.*}} <line:26:5, col:12>
40 // CHECK-NEXT:       | `-IntegerLiteral {{.*}} <col:12> 'int' 4
41 // CHECK-NEXT:       `-ReturnStmt {{.*}} <line:28:5, col:12>
42 // CHECK-NEXT:         `-ImplicitCastExpr {{.*}} <col:12> 'int' <LValueToRValue>
43 // CHECK-NEXT:           `-DeclRefExpr {{.*}} <col:12> 'int' lvalue ParmVar {{.*}} 'i' 'int'
44 
45 namespace TestInvalidFunctionDecl {
46 struct Str {
47    double foo1(double, invalid_type);
48 };
49 double Str::foo1(double, invalid_type)
50 { return 45; }
51 }
52 // CHECK: NamespaceDecl {{.*}} <{{.*}}> {{.*}} TestInvalidFunctionDecl
53 // CHECK-NEXT: |-CXXRecordDecl {{.*}} <line:46:1, line:48:1> line:46:8 struct Str definition
54 // CHECK-NEXT: | |-CXXRecordDecl {{.*}} <col:1, col:8> col:8 implicit struct Str
55 // CHECK-NEXT: | `-CXXMethodDecl {{.*}} <line:47:4, col:36> col:11 invalid foo1 'double (double, int)'
56 // CHECK-NEXT: |   |-ParmVarDecl {{.*}} <col:16> col:22 'double'
57 // CHECK-NEXT: |   `-ParmVarDecl {{.*}} <col:24, <invalid sloc>> col:36 invalid 'int'
58 // CHECK-NEXT: `-CXXMethodDecl {{.*}} parent {{.*}} <line:49:1, line:50:14> line:49:13 invalid foo1 'double (double, int)'
59 // CHECK-NEXT:   |-ParmVarDecl {{.*}} <col:18> col:24 'double'
60 // CHECK-NEXT:   |-ParmVarDecl {{.*}} <col:26, <invalid sloc>> col:38 invalid 'int'
61 // CHECK-NEXT:   `-CompoundStmt {{.*}} <line:50:1, col:14>
62 // CHECK-NEXT:     `-ReturnStmt {{.*}} <col:3, col:10>
63 // CHECK-NEXT:       `-ImplicitCastExpr {{.*}} <col:10> 'double' <IntegralToFloating>
64 // CHECK-NEXT:         `-IntegerLiteral {{.*}} <col:10> 'int' 45
65