File indexing completed on 2024-06-16 04:24:20

0001 // this file is allowed to have erroneous code, which is still parseable
0002 
0003 /*This example used to crash while building the type of Bar*/
0004 /// "type" : { "toString" : "Bar< T >" }
0005 template <typename T>
0006 class Bar
0007 {
0008     /// "type" : { "toString" : "function void (int)" }
0009     void foo(UnknownType);
0010     /// "returnType" : { "toString" : "int" }
0011     UnknownType foo();
0012 };
0013 
0014 /* Contains invalid namespace aliases, used to crash*/
0015 namespace dr373 { // dr373: no
0016   // FIXME: This is valid.
0017   namespace X { int dr373; } // expected-note 2{{here}}
0018   struct dr373 { // expected-note {{here}}
0019     void f() {
0020       using namespace dr373::X; // expected-error {{no namespace named 'X' in 'dr373::dr373'}}
0021       int k = dr373; // expected-error {{does not refer to a value}}
0022 
0023       namespace Y = dr373::X; // expected-error {{no namespace named 'X' in 'dr373::dr373'}}
0024       k = Y::dr373;
0025     }
0026   };
0027 }
0028 
0029 #define BAR 2
0030 /// "internalContext" : { "localDeclarationCount" : 4, "findDeclarations" : {
0031 ///    "sure" : { "defaultParameter" : "nullptr" },
0032 ///    "a" : { "defaultParameter" : "<parse error>" },
0033 ///    "b" : { "defaultParameter" : "BAR" },
0034 ///    "c" : { "defaultParameter" : "3" }
0035 /// } }
0036 int asdf(int *sure = nullptr, int a = NOT_DEFINED, int b = BAR, int c = 3);