• 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:       |-OpaqueValueExpr {{.*}} <<invalid sloc>> 'bool'
37 // CHECK-NEXT:       |-ReturnStmt {{.*}} <line:26:5, col:12>
38 // CHECK-NEXT:       | `-IntegerLiteral {{.*}} <col:12> 'int' 4
39 // CHECK-NEXT:       `-ReturnStmt {{.*}} <line:28:5, col:12>
40 // CHECK-NEXT:         `-ImplicitCastExpr {{.*}} <col:12> 'int' <LValueToRValue>
41 // CHECK-NEXT:           `-DeclRefExpr {{.*}} <col:12> 'int' lvalue ParmVar {{.*}} 'i' 'int'
42 
43 namespace TestInvalidFunctionDecl {
44 struct Str {
45    double foo1(double, invalid_type);
46 };
47 double Str::foo1(double, invalid_type)
48 { return 45; }
49 }
50 // CHECK: NamespaceDecl {{.*}} <{{.*}}> {{.*}} TestInvalidFunctionDecl
51 // CHECK-NEXT: |-CXXRecordDecl {{.*}} <line:44:1, line:46:1> line:44:8 struct Str definition
52 // CHECK:      | |-CXXRecordDecl {{.*}} <col:1, col:8> col:8 implicit struct Str
53 // CHECK-NEXT: | `-CXXMethodDecl {{.*}} <line:45:4, col:36> col:11 invalid foo1 'double (double, int)'
54 // CHECK-NEXT: |   |-ParmVarDecl {{.*}} <col:16> col:22 'double'
55 // CHECK-NEXT: |   `-ParmVarDecl {{.*}} <col:24, <invalid sloc>> col:36 invalid 'int'
56 // CHECK-NEXT: `-CXXMethodDecl {{.*}} parent {{.*}} <line:47:1, line:48:14> line:47:13 invalid foo1 'double (double, int)'
57 // CHECK-NEXT:   |-ParmVarDecl {{.*}} <col:18> col:24 'double'
58 // CHECK-NEXT:   |-ParmVarDecl {{.*}} <col:26, <invalid sloc>> col:38 invalid 'int'
59 // CHECK-NEXT:   `-CompoundStmt {{.*}} <line:48:1, col:14>
60 // CHECK-NEXT:     `-ReturnStmt {{.*}} <col:3, col:10>
61 // CHECK-NEXT:       `-ImplicitCastExpr {{.*}} <col:10> 'double' <IntegralToFloating>
62 // CHECK-NEXT:         `-IntegerLiteral {{.*}} <col:10> 'int' 45
63