default-expr-arguments-2.cpp 517 B

12345678910111213141516171819
  1. // RUN: %clang_cc1 -ast-dump %s 2>&1 | FileCheck %s
  2. // This is a wacky test to ensure that we're actually instantiating
  3. // the default arguments of the constructor when the function type is
  4. // otherwise non-dependent.
  5. namespace PR6733 {
  6. template <class T>
  7. class bar {
  8. public: enum { kSomeConst = 128 };
  9. bar(int x = kSomeConst) {}
  10. };
  11. // CHECK: FunctionDecl{{.*}}f 'void (void)'
  12. void f() {
  13. // CHECK: VarDecl{{.*}}tmp 'bar<int>'
  14. // CHECK: CXXDefaultArgExpr{{.*}}'int'
  15. bar<int> tmp;
  16. }
  17. }