YouCompleteMe/cpp/llvm/tools/clang/test/Parser/cxx-default-args.cpp
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

17 lines
463 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR6647
class C {
// After the error, the rest of the tokens inside the default arg should be
// skipped, avoiding a "expected ';' after class" after 'undecl'.
void m(int x = undecl + 0); // expected-error {{use of undeclared identifier 'undecl'}}
};
typedef struct Inst {
void m(int x=0);
} *InstPtr;
struct X {
void f(int x = 1:); // expected-error {{unexpected end of default argument expression}}
};