summaryrefslogtreecommitdiff
path: root/clang/test/Parser/cxx-default-args.cpp
blob: 7fe8474142bac66f7957e580e5b83b2e89f1a663 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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}}
};